Index: trunk/doc/conf/groups.html =================================================================== --- trunk/doc/conf/groups.html (nonexistent) +++ trunk/doc/conf/groups.html (revision 5594) @@ -0,0 +1,116 @@ + +
++This works well for a small amount of settings but lack of categories or +hierarchy (or sets or groups) makes it harder to understand what setting does +what and orients users to just accept defaults. After a while it also +makes programmers think twice before adding a new setting, increasing the +crowd in a bag. This in turn results in a less configurable +system. +
+Introducing a hierarchy of settings can solve these problems by grouping +and categorizing settings. If the user is interested in how footprints are +searched, they can ignore the settings the editor/ subtree has. It is also +easier to save and reload selectively: when the hierarchy is done right, +closely related settings end up in the same category (thus the same subtree). +Thus saving or loading a subtree can fully save or restore a property of the +program, even if that property is affected by multiple settings. + +
+Details/constraints: +A valid path unambiguously identifies a setting (or a setting group). Settings +and groups always have exactly one parent (except for the root group that +has no parent). There is only one root of the config tree. +
+The main groups in the logical tree are: + +
(root) | (config root) + | ||
| | + | ||
+- rc | run control (program startup) + | ||
| | + | ||
| | | | + | |
| | +- path | paths automatically set up by the program at startup - do not specify these + | |
| | + | ||
+- design | some default settings of a new design; minimum/maximum value of some design settings + | ||
| | + | ||
+- editor | how the pcb editor behaves - independent of HIDs or the GUI + | ||
| | | | + | |
| | +- increments_mm | interactive increment/decrement steps when active unit is mm + | |
| | | | + | |
| | +- increments_mil | interactive increment/decrement steps when active unit is mil + | |
| | | | + | |
| | +- view | default view parameters + | |
| | + | ||
+- appearance | how the GUI looks like - common to all GUI HIDs + | ||
| | | | + | |
| | +- color | layer colors, GUI colors, misc design colors + | |
| | | | + | |
| | +- pinout | pin label properties + | |
| | | | + | |
| | +- messages | message window properties + | |
| | | | + | |
| | +- misc | non-GUI settings handled by the GUI HIDs + | |
| | + | ||
+- plugins | dynamic subtree for various plugin settings + | ||
| | | | + | |
| | +- foo | all settings of the imaginary foo plugin are registered in this group + | |
| | + | ||
+- utils | dynamic subtree for various plugin settings + | ||
| | + | ||
+- bar | all settings of the imaginary bar utility are registered in this group + |
+In plugins/ each plugin should create a group for its own settings. What +this subtree should contain depends on what plugins are actually loaded. +The benefit of this approach is that plugins can use the central config +infrastructure instead of inventing their own config files. This makes +user's life easier on many levels: single config syntax to learn; uniform +GUI (gtk HID's preferences window) to change all settings; uniform way to +save/restore parts of the settings. +
+The utils/ subtree is very similar in all aspects except that it is for +external utility programs. Utils that are closely related to pcb-rnd, such +as gsch2pcb-rnd, should work from the same configuration (e.g. to +make sure the same footprint paths are searched). If they already load the +pcb-rnd config files it's easier to keep their settings in the same tree, +in the same format. +
+Pcb-rnd doesn't generate warning for unrecognized settings in dynamic subtrees. +This lets the user configure plugins that are not always loaded and let util +settings sit in their subtree. + +
+All in all, the extra features the user needs to learn is comparable with +the old customs that he/she can forget. + +
+Read access, which is far the most common way to use the config in the +code (e.g. if (setting == true) { }) is very similar to the old Settings +system. Write access needs to go through a function call API, but this +is usually a single call per setting (instead of directly modifying a +variable). +
+For plugin programmers, the new system makes life much easier as they can +plug their settings in. + + +
+ +Since configuration is stored in new files, pcb-rnd settings do not interfere +with pcb settings on any level. + + + Index: trunk/doc/conf/index_prog.html =================================================================== --- trunk/doc/conf/index_prog.html (nonexistent) +++ trunk/doc/conf/index_prog.html (revision 5594) @@ -0,0 +1,8 @@ + +
++Config settings are imported from multiple sources: from different files, +from environment vareiables, from command line arguments, from the .pcb +files on load. Any source can define any part of the config tree. +When the configuration is processed, each source is read into a temporary +tree and then all the temporary trees are merged into the final +config tree. The following diagram demonstrates all configuration +related data flows. +
+ +
+The leftmost column of nodes are the sources. (Note: paths mentioned there are +the default paths, for reference, it is possible to change them compile-time.) +Along the black arrows, from left to right, each source is imported into a +tree representing a role: the role or +purpose of the source. The next +step is following the red arrows in two steps: ++When multiple sources are describing a value for the same setting, +priority decides the final value. Most settings are scalar: +a single integer, string or a single "yes/no" or "on/off" value (e.g. +the background color or whether polygons are thin-drawn). For scalars +the rule is simple: the higher priority value wins and all lower priority +values are discarded when putting the values into the hash. More +details: how different roles and priorities +can be used with scalars. + +
+There are some settings that are represented as an array or list of +values. They are described in a lihata list item ("li:") in the config +files and are generally called lists in this document. How lists +are merged is controlled by the merging policy, which can be +in each source, just like the prioirty is set. Check out the +list merging section for more details. + +
+There are three active policies: overwrite, prepend and append. +When dealing with lists: +
+In practice this means the user can replace, prepend or append ordered lists +from various sources. A common example is setting the library search paths. + +
role | priority | policy | content + |
---|---|---|---|
system | 200 | overwrite | A,B,C + |
user | 400 | overwrite | (not defined) + |
project | 600 | overwrite | D,E + |
Merge iterations: +
step | description | output list after executing this step | remarks + |
---|---|---|---|
0. | reset the output | (empty) | + |
1. | apply system | A,B,C | + |
2. | apply user | A,B,C | "not defined" doesn't mean "empty", so the list is not deleted - no change + |
3. | apply project | D,E | replace the original output because of the overwrite policy + |
Example scenario: the project is restricted to local footprint libs; this setup +makes sure no system or user configuration injects external footprint paths. + +
role | priority | policy | content + |
---|---|---|---|
system | 200 | overwrite | A,B,C + |
user | 400 | overwrite | (not defined) + |
project | 600 | overwrite | defined to be an empty list + |
Merge iterations: +
step | description | output list after executing this step | remarks + |
---|---|---|---|
0. | reset the output | (empty) | + |
1. | apply system | A,B,C | + |
2. | apply user | A,B,C | "not defined" doesn't mean "empty", so the list is not deleted - no change + |
3. | apply project | (empty) | replace the original output because of the overwrite policy + |
role | priority | policy | content + |
---|---|---|---|
system | 200 | overwrite | A,B,C + |
user | 400 | prepend | (not defined) + |
project | 600 | prepend | D,E + |
Merge iterations: +
step | description | output list after executing this step | remarks + |
---|---|---|---|
0. | reset the output | (empty) | + |
1. | apply system | A,B,C | + |
2. | apply user | A,B,C | "not defined" doesn't mean "empty", so the list is not deleted - no change + |
3. | apply project | D,E,A,B,C | + |
Example scenario: the project has its own footprint libs with two paths; these +should be searched before system and user paths, still, system path is also +kept so stock footprints can be found. +
+This is better than hardwiring A,B,C in the project's list: A, B and C may +depend on the installation on a given system. A project file has no idea +about how the system is installed but it is assumed system installation +and the system configuration file are consistent. + +
role | priority | policy | content + |
---|---|---|---|
system | 200 | overwrite | A,B,C + |
user | 400 | append | (not defined) + |
project | 600 | append | D,E + |
Merge iterations: +
step | description | output list after executing this step | remarks + |
---|---|---|---|
0. | reset the output | (empty) | + |
1. | apply system | A,B,C | + |
2. | apply user | A,B,C | "not defined" doesn't mean "empty", so the list is not deleted - no change + |
3. | apply project | A,B,C,D,E | + |
Example scenario: the project has its own footprint libs with two paths; these +should be searched after system and user paths. This means the local footprint +lib has lower priority than the stock footprints. See system-dependent +installation remarks in the previous point. + + +
role | priority | policy | content + |
---|---|---|---|
system | 200 | overwrite | A,B,C + |
user | 400 | prepend | X,Y,Z + |
project | 600 | append | D,E + |
Merge iterations: +
step | description | output list after executing this step | remarks + |
---|---|---|---|
0. | reset the output | (empty) | + |
1. | apply system | A,B,C | + |
2. | apply user | X,Y,Z,A,B,C | + |
3. | apply project | X,Y,Z,A,B,C,D,E | + |
+On the downside, the actual items this system knew about was pretty much +static, hardwired in core. A plugin could not register its own settings. +Multiple parallel methods were present in the code to overcome this +limitation: +
+In turn, this also limited (again somewhat randomly) what settings can be +stored system-wise, user-wise, or on project or design level. +
+Finally, handling of file search paths was not very sophisticated. There +was the system and user configuration that reflected where the stock +library or the user's generic library were installed. And then +there was the per-project local footprint libs that had to be somehow +added too. +
+There was a hardwired way of handling the situation where multiple set +of paths were specified. In practice it was usually possible to get this +to work for the simpler cases, but it was not powerful enough to express +things like "use all system and user libraries first, then the project's local +library" vs. "the project's local library has priority over system libraries". Index: trunk/doc/conf/plugin_chk.html =================================================================== --- trunk/doc/conf/plugin_chk.html (nonexistent) +++ trunk/doc/conf/plugin_chk.html (revision 5594) @@ -0,0 +1,7 @@ + +
++For scalar settings, the highest priority +value determines the final value of a setting after the merge. If there +is a tie, role decides: the role closer to the CLI is stronger. +
+For lists and arrays, priority determines the +order of merge, which changes the order of itmes in the final list as +config roots prepend and append items. + + + Index: trunk/doc/conf/scalars.html =================================================================== --- trunk/doc/conf/scalars.html (nonexistent) +++ trunk/doc/conf/scalars.html (revision 5594) @@ -0,0 +1,56 @@ + +
+role | priority | policy | content + |
---|---|---|---|
system | 200 | overwrite | A + |
user | 400 | overwrite | (not defined) + |
project | 600 | overwrite | Q + |
+Merge iterations: +
step | description | output list after executing this step | remarks + |
---|---|---|---|
0. | reset the output | (empty) | + |
1. | apply system | A | + |
2. | apply user | A | "not defined" doesn't mean "empty", so the list is not deleted - no change + |
3. | apply project | Q | replace the original output because of the overwrite policy + |
Example scenario: system default overriden by a project setting. + +
role | priority | policy | content + |
---|---|---|---|
system | 200 | overwrite | A + |
user | 650 | overwrite | E + |
project | 600 | overwrite | Q + |
+Merge iterations: +
step | description | output list after executing this step | remarks + |
---|---|---|---|
0. | reset the output | (empty) | + |
1. | apply system | A | + |
2. | apply project | Q | + |
3. | apply user | E | + |
Example scenario: user preference enforced: even if the project file would use +'Q' for the given setting, the user prefers 'E'. This affects runtime +(the value of the setting after the merge, in other words how pcb-rnd works), +but does nto change the project configuration. This allows the given user to +always use 'E' for the given setting while lets other users working on the +same project use the value set in the project file. + + + Index: trunk/doc/conf/sources.html =================================================================== --- trunk/doc/conf/sources.html (nonexistent) +++ trunk/doc/conf/sources.html (revision 5594) @@ -0,0 +1,72 @@ + +
+role | default setting prio | location | presence | remarks + |
---|---|---|---|---|
internal + | 100 + | (compiled into the executable) + | always + | the ultimate fallback; allows pcb-rnd even if no other configuration file is found + + + |
system + | 200 + | /usr/share/pcb-rnd/pcb-conf.lht + | recommended + | should hold system and installation specific settigns, e.g. path to the system-wise installed footprint library + + |
default.pcb + | 300 + | /usr/share/pcb-rnd/default.pcb + | deprecated + | pcb editable defaults + + |
user + | 400 + | ~/.pcb-rnd/pcb-conf.lht + | recommended + | store user preferences, user's common footprint lib path, etc; this is the first file the user can modify (even from the GUI) + + |
environment + | 500 + | environment variables (TODO) + | occassional + | inject the same (temporary) settings in multiple pcb-rnd sessions without having to change config files + + |
project + | 600 + | projdect.lht in the project directory + | optional + | local project settings - useful for large projects with multiple design (.pcb) files + + |
design + | 700 + | saved in the design (.pcb) file + | optional, common + | per design deviation from the user+system config + + |
cli + | 800 + | command line argument + | occassional + | inject/change a setting for a single session; useful in batch/automated processing + |
+Pcb-rnd reads them all, then merges all settings into a master binary +representation. If a setting is specified in multiple sources, the one +with the higher priority wins, except for lists where it is also possible +to prepend/append items. Default priorities are designed to result +precedence in an intuitive way (e.g. design settigns overwrite user settings). +However, priority can be changed per setting, resulting +in weak settings ("use this value if it was not already set") or strong settings +("I always want to use mincut, so I enable it from my user's config with high +priority and a version controlled project setting can not turn it off") + + Index: trunk/doc/conf/src/Makefile =================================================================== --- trunk/doc/conf/src/Makefile (nonexistent) +++ trunk/doc/conf/src/Makefile (revision 5594) @@ -0,0 +1,2 @@ +../merging.png: merging.dot + dot -Tpng merging.dot > ../merging.png \ No newline at end of file Index: trunk/doc/conf/src/merging.dot =================================================================== --- trunk/doc/conf/src/merging.dot (nonexistent) +++ trunk/doc/conf/src/merging.dot (revision 5594) @@ -0,0 +1,103 @@ +digraph g { + rankdir=LR; + + subgraph cluster_memtree { + label="in-memory lihata trees" + bgcolor=grey + rank=same + CFR_INTERNAL [label="CFR_INTERNAL\nultimate fallback"] + CFR_SYSTEM [label="CFR_SYSTEM\nsystem level configuration"] + CFR_DEFAULTPCB [label="CFR_DEFAULTPCB"] + CFR_USER [label="CFR_USER\nuser level configuration"] + CFR_ENV [label="CFR_ENV"] + CFR_PROJECT [label="CFR_PROJECT\nproject level configuration"] + CFR_DESIGN [label="CFR_DESIGN"] + CFR_CLI [label="CFR_CLI"] + } + + subgraph cluster_fields { + label="string -> conf_native_t hash" + bgcolor=grey + conf_fields [label="conf_fields\ncentral hash\nof all\nknown settings"] + } + + subgraph cluster_native { + label="native C structures\nper module" + bgcolor=grey + conf_core [label="conf_core\npcb-rnd core settings"] + conf_hid_gtk [label="conf_hid_gtk\nthe hid_gtk plugin's settings"] + conf_mincut [label="conf_mincut\nthe mincut plugin's settings"] + conf_report [label="conf_report\nthe report plugin's settings"] + conf_other [label="...\nother plugin's settings"] + } + + CFR_INTERNAL -> conf_fields [color=red] + CFR_SYSTEM -> conf_fields [color=red] + CFR_DEFAULTPCB -> conf_fields [color=red] + CFR_USER -> conf_fields [color=red] + CFR_ENV -> conf_fields [color=red] + CFR_PROJECT -> conf_fields [color=red] + CFR_DESIGN -> conf_fields [color=red] + CFR_CLI -> conf_fields [color=red] + + +# CFR_INTERNAL -> CFR_SYSTEM +# CFR_SYSTEM -> CFR_DEFAULTPCB +# CFR_DEFAULTPCB -> CFR_USER +# CFR_USER -> CFR_ENV +# CFR_ENV -> CFR_PROJECT +# CFR_PROJECT -> CFR_DESIGN +# CFR_DESIGN -> CFR_CLI + + conf_fields -> conf_core [color=red] + conf_fields -> conf_hid_gtk [color=red] + conf_fields -> conf_mincut [color=red] + conf_fields -> conf_report [color=red] + conf_fields -> conf_other [color=red] + + + + subgraph cluster_files { + label="config files" + bgcolor=grey + lht_system [label="/usr/share/pcb-rnd/pcb-conf.lht" shape=hexagon] + pcb_default [label="/usr/share/pcb-rnd/default.pcb" shape=hexagon] + project [label="./project.lht" shape=hexagon] + lht_user [label="~/.pcb-rnd/pcb-conf.lht" shape=hexagon] + } + + subgraph cluster_exec_env { + label="execution environment" + bgcolor=grey + env [label="environmental variables"] + cli [label="command line arguments\ne.g. -c or\npluginspecific args"] + } + + lht_internal [label="hardwired\nin the\nexecutable"] + design [label="settings\nin the\n.pcb file" shape=hexagon] + + lht_internal -> CFR_INTERNAL [label="program startup"] + lht_system -> CFR_SYSTEM [label="loaded at startup"] + pcb_default -> CFR_DEFAULTPCB [label="loadad in CreateNewPCB()"] + lht_user -> CFR_USER [label="loaded at startup" dir=both] + env -> CFR_ENV [label="built at startup"] + project -> CFR_PROJECT [label="loaded when a\nnew .pcb or project\nis loaded" dir=both] + design -> CFR_DESIGN [label="extracted when loading a design" dir=both] + cli -> CFR_CLI [label="built during\ncommand line argument\nparsing"] + + + hid_gtk [label="the GTK HID"] + + conf_core -> hid_gtk [weight=100] + conf_hid_gtk -> hid_gtk + + hid_gtk -> CFR_DESIGN [color=blue weigth=0] + hid_gtk -> CFR_PROJECT [color=blue weigth=0 style=dashed] + hid_gtk -> CFR_USER [color=blue weigth=0 style=dashed] + + + editor [label="core:\nediting pcb"] + conf_core -> editor [weight=100] + editor -> CFR_DESIGN [color=blue weigth=0] + +} \ No newline at end of file Index: trunk/doc/conf/syntax.html =================================================================== --- trunk/doc/conf/syntax.html (nonexistent) +++ trunk/doc/conf/syntax.html (revision 5594) @@ -0,0 +1,45 @@ + +
++A pcb-rnd config file, (or document for short) has a single root +node whose name must be li:pcb-rnd-conf-v1 - this is the signature of the +document. It is a flat list of one or more config root/ subtrees. +TODO: is this really a list or a hash? +
+Each config root is a partial description of the + config tree (which is the logical +confgiuration of all possible settings). Config roots have a policy and +a priority attached. This is done in the name +of the config root, which must be of the form of policy-priority, +e.g. "overwrite-300" or "append-125". The priority part (with the dash) +can be omitted (and then the per role default priority is used), e.g. +"overwrite" or "append" are valid config root names. +
+Under the config root, a tree of sections (hashes) and setting values +(text nodes) are built. These structures and values are in 1:1 +correspondance with the config tree. Excess +(unknown) keys are considered a warning (except in the plugin/ and +utils/ subtrees). Missing keys or missing subtrees is normal because a config +root can be partial. +
+TODO: examples + +
+Example values: true, false, on, off, yes, no, 1, 0. Index: trunk/doc/conf/tree/CFN_COLOR.html =================================================================== --- trunk/doc/conf/tree/CFN_COLOR.html (nonexistent) +++ trunk/doc/conf/tree/CFN_COLOR.html (revision 5594) @@ -0,0 +1,9 @@ + +
++Example values: #ff0000 for red, #555555 for grey. Index: trunk/doc/conf/tree/CFN_COORD.html =================================================================== --- trunk/doc/conf/tree/CFN_COORD.html (nonexistent) +++ trunk/doc/conf/tree/CFN_COORD.html (revision 5594) @@ -0,0 +1,10 @@ + +
++Example values: 1.5mm, 15 mil + + Index: trunk/doc/conf/tree/CFN_INCREMENTS.html =================================================================== --- trunk/doc/conf/tree/CFN_INCREMENTS.html (nonexistent) +++ trunk/doc/conf/tree/CFN_INCREMENTS.html (revision 5594) @@ -0,0 +1,8 @@ + +
++TODO + Index: trunk/doc/conf/tree/CFN_INTEGER.html =================================================================== --- trunk/doc/conf/tree/CFN_INTEGER.html (nonexistent) +++ trunk/doc/conf/tree/CFN_INTEGER.html (revision 5594) @@ -0,0 +1,10 @@ + +
++Example values: 4, 1500, 2545343, -6 + + Index: trunk/doc/conf/tree/CFN_LIST.html =================================================================== --- trunk/doc/conf/tree/CFN_LIST.html (nonexistent) +++ trunk/doc/conf/tree/CFN_LIST.html (revision 5594) @@ -0,0 +1,10 @@ + +
++Example values: +
+li:{ foo; bar; {foo/bar/with-punctuation}; 123} +Index: trunk/doc/conf/tree/CFN_REAL.html =================================================================== --- trunk/doc/conf/tree/CFN_REAL.html (nonexistent) +++ trunk/doc/conf/tree/CFN_REAL.html (revision 5594) @@ -0,0 +1,9 @@ + + +
+Example values: 3.141592654, 5, -12, 0 + + Index: trunk/doc/conf/tree/CFN_STRING.html =================================================================== --- trunk/doc/conf/tree/CFN_STRING.html (nonexistent) +++ trunk/doc/conf/tree/CFN_STRING.html (revision 5594) @@ -0,0 +1,13 @@ + +
++Example values: +
+foo +bar +{long text with / punctuation?} ++ Index: trunk/doc/conf/tree/CFN_UNIT.html =================================================================== --- trunk/doc/conf/tree/CFN_UNIT.html (nonexistent) +++ trunk/doc/conf/tree/CFN_UNIT.html (revision 5594) @@ -0,0 +1,9 @@ + + +
+Example values: mm, cm, m, mil + + Index: trunk/doc/conf/tree/appearance.html =================================================================== --- trunk/doc/conf/tree/appearance.html (nonexistent) +++ trunk/doc/conf/tree/appearance.html (revision 5594) @@ -0,0 +1,8 @@ +
+node name | type | flags | description + | ||||
---|---|---|---|---|---|---|---|
rat_thickness | coord | 0 | mark_size | coord | 0 | relative marker size
+ | |
node name | type | flags | description + | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
black | color | 0 | white | color | 0 | | background | color | 0 | background and cursor color ...
+ | crosshair | color | 0 | different object colors
+ | cross | color | 0 | | via | color | 0 | | via_selected | color | 0 | | pin | color | 0 | | pin_selected | color | 0 | | pin_name | color | 0 | | element | color | 0 | | element_nonetlist | color | 0 | | rat | color | 0 | | invisible_objects | color | 0 | | invisible_mark | color | 0 | | element_selected | color | 0 | | rat_selected | color | 0 | | connected | color | 0 | | off_limit | color | 0 | | grid | color | 0 | | layer | color | 0 | | layer_selected | color | 0 | | warn | color | 0 | | mask | color | 0 | | |
node name | type | flags | description + |
---|---|---|---|
char_per_line | integer | 0 | width of an output line in characters (used by separator drawing in find.c) + |
node name | type | flags | description + |
---|---|---|---|
volume | integer | 0 | the speakers volume -100..100 + |
node name | type | flags | description + | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name_length | integer | 0 | zoom | real | 0 | | offset_x | coord | 0 | X offset of origin
+ | offset_y | coord | 0 | Y offset of origin
+ | text_offset_x | coord | 0 | X offset of text from pin center
+ | text_offset_y | coord | 0 | Y offset of text from pin center
+ | |
node name | type | flags | description + | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
via_thickness | coord | 0 | via_drilling_hole | coord | 0 | | line_thickness | coord | 0 | | clearance | coord | 0 | | max_width | coord | 0 | | max_height | coord | 0 | | alignment_distance | coord | 0 | default drc size
+ | bloat | coord | 0 | default drc size
+ | shrink | coord | 0 | | min_wid | coord | 0 | | min_slk | coord | 0 | | min_drill | coord | 0 | | min_ring | coord | 0 | | text_scale | integer | 0 | text scaling in %
+ | poly_isle_area | real | 0 | polygon min area
+ | default_layer_name | string | 0 | | fab_author | string | 0 | Full name of author for FAB drawings
+ | initial_layer_stack | string | 0 | If set, the initial layer stack is set to this
+ | groups | string | 0 | string with layergroups
+ | routes | string | 0 | string with route styles
+ | |
node name | type | flags | description + |
---|---|---|---|
grid_unit | unit | 0 | select whether you draw in mm or mil + |
grid | coord | 0 | grid in pcb-units + |
increments_mm | increments | 0 | increments (size deltas) when drawing in mil + |
increments_mil | increments | 0 | increments (size deltas) when drawing in mil + |
zoom | real | 0 | default zoom + |
mode | integer | 0 | currently active mode + |
buffer_number | integer | 0 | number of the current buffer + |
clear_line | boolean | 0 | new lines/arc clear polygons. + |
full_poly | boolean | 0 | new polygons are full polygons. + |
unique_names | boolean | 0 | force unique names + |
snap_pin | boolean | 0 | snap to pins and pads + |
snap_offgrid_line | boolean | 0 | Snap to certain off-grid points along a line. + |
highlight_on_point | boolean | 0 | Highlight if crosshair is on endpoints. + |
show_solder_side | boolean | 0 | mirror output + |
save_last_command | boolean | 0 | the command entry editline always starts with the last command entered by user in the current session + |
line_refraction | integer | 0 | value for line lookahead setting + |
save_in_tmp | boolean | 0 | emergency save unsaved PCB data (despite the user clicks don't save) when: user starts a new PCB; user quits pcb-rnd. Does not affect the on-crash emergency save. + |
draw_grid | boolean | 0 | draw grid points + |
all_direction_lines | boolean | 0 | enable lines to all directions + |
rubber_band_mode | boolean | 0 | move, rotate use rubberband connections + |
swap_start_direction | boolean | 0 | change starting direction after each click + |
show_drc | boolean | 0 | show drc region on crosshair + |
auto_drc | boolean | 0 | when set, PCB doesn't let you place copper that violates DRC. + |
show_number | boolean | 0 | pinout shows number + |
orthogonal_moves | boolean | 0 | move items orthogonally. + |
reset_after_element | boolean | 0 | reset connections after each element while saving all connections + |
auto_place | boolean | 0 | flag which says we should force placement of the windows on startup + |
lock_names | boolean | 0 | lock down text so they can not be moved or selected + |
only_names | boolean | 0 | lock down everything else but text so only text objects can be moved or selected + |
thin_draw | boolean | 0 | if set, objects on the screen are drawn as outlines (lines are drawn as center-lines). This lets you see line endpoints hidden under pins, for example. + |
thin_draw_poly | boolean | 0 | if set, polygons on the screen are drawn as outlines. + |
local_ref | boolean | 0 | use local reference for moves, by setting the mark at the beginning of each move. + |
check_planes | boolean | 0 | when set, only polygons and their clearances are drawn, to see if polygons have isolated regions. + |
show_mask | boolean | 0 | show the solder mask layer + |
hide_names | boolean | 0 | when set, element names are not drawn. + |
description | boolean | 0 | display element description as element name, instead of value + |
name_on_pcb | boolean | 0 | display Reference Designator as element name, instead of value + |
fullscreen | boolean | 0 | hide widgets to make more room for the drawing + |
click_time | integer | 0 | default time for click expiration, in ms + |
enable_stroke | boolean | 0 | Enable libstroke gestures on middle mouse button when non-zero + |
live_routing | boolean | 0 | autorouter shows tracks in progress + |
beep_when_finished | boolean | 0 | flag if a signal should be produced when searching of connections is done + |
undo_warning_size | integer | 0 | warn the user when undo list exceeds this amount of kilobytes in memory + |
node name | type | flags | description + |
---|---|---|---|
flip_x | boolean | 0 | view: flip the board along the X (horizontal) axis + |
flip_y | boolean | 0 | view: flip the board along the Y (vertical) axis + |
node name | type | flags | description + | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
verbose | integer | 0 | quiet | integer | 0 | print only errors on stderr
+ | backup_interval | integer | 0 | time between two backups in seconds
+ | font_command | string | 0 | file name template; if not empty, run this command and read its outout for loading the font; %f is the file name
+ | file_command | string | 0 | file name template; if not empty, run this command and read its outout for loading a pcb file; %f is the file name, %p is the conf setting rc.file_path
+ | file_path | string | 0 | | library_shell | string | 0 | | library_search_paths | list | 0 | | emergency_name | string | 0 | file name template for emergency save anonymous .pcb files (when pcb-rnd crashes); optional field: %ld --> pid; must be shorter than 240 characters. Don't do emergency save if this item is empty.
+ | backup_name | string | 0 | file name template for periodic backup anonymous .pcb files; optional fields: %P --> pid
+ | save_command | string | 0 | command to pipe the pcb, footprint or buffer file into, when saving (makes lihata persist impossible)
+ | keep_save_backups | boolean | 0 | a copy is made before a save operation overwrites an existing file; if this setting is true, keep the copy even after a successful save
+ | default_font_file | list | 0 | name of default font file (list of names to search)
+ | default_pcb_file | list | 0 | | script_filename | string | 0 | PCB Actions script to execute on startup
+ | action_string | string | 0 | PCB Actions string to execute on startup
+ | rat_path | string | 0 | | rat_command | string | 0 | file name template; if not empty, run this command and read its outout for loading a rats; %f is the file name, %p is the rc.rat_path conf setting
+ | preferred_gui | list | 0 | if set, try GUI HIDs in this order when no GUI is explicitly selected
+ | have_regex | boolean | 0 | whether we have regex compiled in
+ | |
node name | type | flags | description + |
---|---|---|---|
prefix | string | 0 | e.g. /usr/local + |
lib | string | 0 | e.g. /usr/lib/pcb-rnd + |
bin | string | 0 | e.g. /usr/bin + |
share | string | 0 | e.g. /usr/share/pcb-rnd + |
home | string | 0 | user's home dir, determined run-time + |
exec_prefix | string | 0 | exec prefix path (extracted from argv[0]) + |
node name | type | flags | description + |
---|---|---|---|
rat_warn | boolean | 0 | rats nest has set warnings + |
+Half of the board structure describes global board properties: +
+Relevant structs, variables and functions are in board.[ch]. + +
+Relevant structs, variables and functions are in data.[ch]. + +
+Relevant structs, variables and functions are in buffer.[ch]. + +
+Limitations: +
+The location of a layer group on of: +
+In pcb-rnd only copper layers and the outline layer are fully explicit. +There are two hardwired silk layers, one for the top and one for the bottom side. +The silk layers are semi-explicit: they are existing layers in all structs +but: +
+The outline layer is a hack: it's really an internal copper layer. If +the code detects the name of the layer is "outline" anywhere, it branches. +
+There are a few virtual layers: +
+Relevant structs, variables and functions are in layer.[ch]. + +
+Arguments: +
+Arguments: +
+Arguments: none. + + +
+Arguments: +
+Arguments: +
+Arguments: none + +
+Arguments: +
+Example: +
+newly(bottomassembly 16777226 ((bottom) (assy) (virtual)) -1) ++Creates the bottom assembly virtual layer with ID 16777226. It is not part of +any layer group and is called "bottomassembly". + +
+Arguments: +
+Arguments: none + + + + +
+Arguments: +
+Arguments: +
+Arguments: +
+Arguments: +
+Arguments: +
+Arguments: +
+Arguments: +
+Arguments: +
+Arguments: +
+Arguments: +
+The protocol is designed with the following goals in mind: +
token | description + |
---|---|
( | start a generic list + |
) | end a generic list + |
{ | start a binary list + |
} | end a binary list + |
space | element separator: space (ASCII dec 32) + |
\n | message separator: newline (ASCII dec 10) + |
text-string | short, alphanumeric string + |
binary-string | long and/or non-alnum string + |
+text-string generic-list \n +or +text-string binary-list \n +or +# comment \n ++
+where text-string is a command and generic-list is a list and holds +the arguments of. The command name can not start with a hash mark ('#') and +can not be empty. The list is the argument tree of the command. +
+As a special exception, a line may start with a hash mark ('#') to indicate +a comment. Characters up to the first newline are ignored. +
+Optional: a tolerant parser also accepts empty lines and whitespace before +a message. +
+The language has two type of lists: generic and binary. +A generic list is wrapped in parenthesis () and its children are: +
+Any list can be empty. There's no whitespace after the opening token and +before the closing token, so the empty generic-list and the empty binary-list +are written as, respectively: +
+() +{} ++Subsequent fields of a list has a single space in between, for +separation (this is an intentional redundancy for a binary-list). +
+Note: a generic-list can host text and binary children, but a +binary list can not host only binary children. This means if a node +of the parse tree is a binary list, the subtree will contain only binary nodes. +
+A text-string contains only English alphanumeric characters (A..Z, a..z, +0..9), underscores (_), plus and minus signs (+, -) periods (.) and +the hash mark ('#') and is at most 16 characters long. +
+A binary string encodes the length of the payload in base64 (A..Z, a..z, +, /), +has a '=' for separator then the payload in binary format. For example +
+F=hello ++means the 5 characters long string "hello". The maximum size of the base64 +encoded length field is 5, thus the longest binary data that can be +packed in a single field is 1 gigabyte. + +
+hello()\n +foo{}\n ++ +
+hello(world)\n +hello{F=world}\n ++ +
+print(hello world !)\n +print{E=hello F=world B=!}\n ++ +Note: using space between list items; don't space +before the first or after the last argument. Always emit one space between +any two list items. + +
+line((14.55 3.1) (44.2 0) 5)\n +line({F=14.55 D=3.1} (44.2 0) 5)\n +line((14.55 3.1) {E=44.2 B=0} 5)\n +line({F=14.55 D=3.1} {E=44.2 B=0} 5)\n +line{{F=14.55 D=3.1} {E=44.2 B=0} B=5}\n ++The subtree assumed in this fictional message is two x;y coordinate pairs +and a line width. In other words the arguments of line is a list (start +point), another list (end point) and a scalar (width). +
+Since all data comply to the text-string token format, +the first, simplest format is recommended. The other 4 lines demonstrate all +other valid variants. +
+It is important to note that there are constraints (derived from +the grammar) on choosing which list items can be encoded in binary: +
+When a list is closed, the parent of the current node becomes the +new current node. +
+When parsing a new message, the current node is NULL until the argument list +is open; the new current node also becomes the argument tree root. +If the argument tree root is closed, a newline shall follow, because that's +how a message is terminated. +
+The binary string part of the state machine has 2 more internal +states: +
+In either case, PCBType's most important field is PCBDataType *data, +which holds lists and vectors to store all objects on the board. When +the target is a buffer (e.g. io plugin's ->parse_element function), it's +a DataType *buf which also have a PCBDataType *data containing +the same data a board could. +
+A PCBDataType struct in turn has three sets of important fields: +
+Any code that needs to create objects should use the functions in create.[ch]. +The functions that operate layer-independently usually get a destination as +PCBDataType, so they can operate both on boards and buffers. A typical +example is PinTypePtr CreateNewVia(DataTypePtr Data, ...) that returns +NULL or the pointer to the new via that is already added to the corresponding list +of Data and in the rtree. +
+Layer object creation is done referencing the layer as LayerType *. A +typical example is LineTypePtr CreateDrawnLineOnLayer(LayerTypePtr Layer, ...) +which returns NULL on error or a pointer to the new line object created (inserted +in the layer's line list, added to the rtree). +
+Code should avoid manipulating the lists and rtree structures directly. +
+ +Figure 1. simplified map of object related data structures + +diamond: variable; rectangle: struct; round: struct field + |
+indent --line-length128 -brs -br -nce --tab-size2 -ut -npsl -npcs -hnl $* ++
+Contributors are kindly asked to follow this style or run the above commandline +on their code before sending a patch or commiting to svn. + + Index: trunk/doc/developer/obj_func_naming.txt =================================================================== --- trunk/doc/developer/obj_func_naming.txt (nonexistent) +++ trunk/doc/developer/obj_func_naming.txt (revision 5594) @@ -0,0 +1,83 @@ +obj_* function naming conventions + + +High level (new/destroy): + + This is the recommended way of creating new objects. + + pcb_*_new(): + Calls pcb_*_alloc(), fills in fields from parameters and calls the post + processing (pcb_add_*_on_layer()) function as needed. Makes sanity checks + on the parameters and may fail upon that. + + pcb_*_new_*(): + Same as pcb_*_new(), but may do clever things so the object created may + not be 1:1 what was reqested or may not even be a new object (e.g. + overlapping line merging) + + pcb_element_*_new(): + same as pcb_*_new(), parent being an element + + pcb_*_destroy() + free all fields of an object and properly remove it from the parent + (including rtree removal) + +Low level (alloc/free): + + Use this in some special cases (like loading a file) when the extra checks + of a _new may interfere. + + pcb_*_alloc(): + allocate a new objects within a parent (as of now: layer). Allocates + the struct of a new objects with all fields clean and links the object + in the parent list. Returns a pointer to the object. NOTE: some post + processing may be needed after filling in the fields + (see also: pcb_add_*_on_layer()) + + pcb_element_*_alloc(): + same, but parent is an element - will be removed once elements are + generalized. + + pcb_*_free(): + free the struct memory (but not the fields!) of an object and remove + it from the parent list. + + pcb_add_*_on_layer(): + Postprocessing: call this after a new object is allocated and fields are + filled in. It mainly updates the rtree. + + pcb_*_copy(): + copy fields of a complex obj to a pre-allocated target obj + + +Accessors: + pcb_*_get_*(): + Return data that are not directly accessible as object struct fields but + require some sort of calculation + + pcb_*_set_*(): + Set object fields that require postprocessing because of side effects. + Use these instead of direct writes to the fields to get side effects + properly executed. + + pcb_*_change_*(): + Similar to pcb_*_set_*(), but instead of setting a field to a value + specified as a parameter, change the field to comply with some global + state, e.g. "change side" would move the object to the currently viewed + side. + +Trasformations: + pcb_*_move(): + move the object within its parent (x;y); it's often implemented as a + macro + + pcb_*_mirror(): + mirror the object within its parent (x;y) + + +Misc: + pcb_*_bbox(): + calculate and update the bounding box of an object + + pcb_*_rotate90() + Rotate the object by n*90 degrees Index: trunk/doc/developer/plugin_core_simple.html =================================================================== --- trunk/doc/developer/plugin_core_simple.html (nonexistent) +++ trunk/doc/developer/plugin_core_simple.html (revision 5594) @@ -0,0 +1,59 @@ + +
++put /local/pcb/mod {plg} +put /local/pcb/mod/OBJS [@ $(PLUGDIR)/plg/foo.o $(PLUGDIR)/plg/bar.o @] +put /local/pcb/mod/CONF {$(PLUGDIR)/plg/foo_conf.h} +put /local/pcb/mod/YACC [@ $(PLUGDIR)/plg/bary @] +put /local/pcb/mod/LEX [@ $(PLUGDIR)/plg/barl @] ++ +
+plugin_def("plg", "short description", default) ++ Default is one of: +
+The only largely visible remaining portion is the GUI. pcb-gpmi supports +building dialog boxes using the current HID (so called attribute dialogs, +originally invented for exporter settings) and calling some simpler predefined +dialogs like a progress bar or alert. +
+What's really missing is a way to create new menus on the fly. The user +loads a script and the script makes up a menu with submenus, all bound to +the proper actions. +
+This introduces a nice dilemma, tho: there is a real cool menu configuration +file that makes the user able to reconfigure the menu system, hot keys, tool +tips and whatnot (I wish more applications had this feature!). What if a script +comes in and trolls the whole thing creating random menus at surprising +places in the menu system? How the user can control what the script could do +with his preciously crafted menu setup tailored to his own preferences? +
+I believe in sharp tools and careful users. I indeed plan to allow scripts to +do whatever they want with the menu system but I invent some conventions too. +As long as scripts stick to these conventions, the user retain control over +the menu layout. + +
+When a new menu "/File/foo" is created, using the hash create_menu() +finds out that /File already exists and doesn't create it but use the +existing widget from the hash. This means if the user creates menus from +the res file that are also created by the script, the res file sort of +overrides the script's later actions as all those menus will already exist +by the time the script tries to create them. +
+And here comes the conventions part: +
+It turned out gtk was way too OOP for my taste1. It took about 6 +hours total, to implement and debug the feature. (As a comparison, it +took about 90 minutes to make the research related to +the resource structs in PCB and implement the HID modifications for +the new hid command). The trickiest part was +to figure the need of calling a show() on the menubar after adding +the new items. +
+When I didn't have that, only plain action menu/submenus showed up +(in already existing menu/ widgets), but +new (main) menus and menu/submenu/submenus didn't. After many hours of gdb +sessions I finally made sure (by printing all the widgets to stderr +recursively) that: +
+Before adding scripting to pcb-rnd, the other direction (pcb_core->user) has +to be implemented: an event infrastructure. Random parts of the core +or the HID code will yield events using a simple vararg event() function. +Other parts of PCB, especially plugins, can bind (sign up to) events with +function pointers. When an event is triggered, all functions signed up to +the event are called (in random order). +
+Passing arguments to events is similar to the arguments of actions, except +argv[] is not a char *[], but an event_arg_t *[]. event_arg_t has an enum +field for argument type and an union for the argument value. This means the +API is binary: integers are passed as integers, not as strings. + + Index: trunk/doc/devlog/20150803a_scriptig.html =================================================================== --- trunk/doc/devlog/20150803a_scriptig.html (nonexistent) +++ trunk/doc/devlog/20150803a_scriptig.html (revision 5594) @@ -0,0 +1,36 @@ + +
++My example scripts are written in awk, lua and tcl +at this point, but gpmi supports 7 other languages +(scheme, stutter (lisp), pascal, perl +php, python, ruby) which are also available in +pcb-rnd. + Index: trunk/doc/devlog/20150816a_scriptig.html =================================================================== --- trunk/doc/devlog/20150816a_scriptig.html (nonexistent) +++ trunk/doc/devlog/20150816a_scriptig.html (revision 5594) @@ -0,0 +1,28 @@ + +
++I have a Rosetta stone +of examples demonstrating how to write simple scripts. +It doesn't explain how the system works, but shows easy-to-understand +practical examples. Useful for those who like learn by doing and look up +the "theoretical" background only after seeing things in practice. +
+Another document, the +scripting intro focuses on explaining how things are built up. This +one is useful for those who first want to understand the design and then +look at how to do things in practice. +
+As a next step I plan to reorganize the package documentation and split +them all into a high level "what's the concept" doc and a low level +reference manual. +
+I also plan to improve the links between the docs and write more rosetta +examples. I plan to have a few more all-language examples on the most +basic things. The more complex examples would be written in awk, lua and +maybe ruby. + Index: trunk/doc/devlog/20150820a_dimensions.html =================================================================== --- trunk/doc/devlog/20150820a_dimensions.html (nonexistent) +++ trunk/doc/devlog/20150820a_dimensions.html (revision 5594) @@ -0,0 +1,24 @@ + +
++The new feature of fp2anim is to optionally display custom dimensions on +the preview. Generator scripts print #dimension comments in the footprint +file (not breaking the file format). The generator passes on a dimension +name along with the value. As a first attempt my conventions are: +
+On the other hand, in practice we need qfn() and tqfp(), which are special +cases of qf(). To nail the common use cases, qfn() and tqfp() narrows down +the number of parameters to 3..4. Even better, these parameters are exactly +those that are in the name of a typical QFN or TQFP footprint or in the first +few lines of the dimensions table. I call these scripts frontends to qf(). +
+This makes the common footprints very easy to produce using frontends while +leaves a (bit more complicated) plan B, qf(), for special cases. Index: trunk/doc/devlog/20150821a_parametric_requirements.html =================================================================== --- trunk/doc/devlog/20150821a_parametric_requirements.html (nonexistent) +++ trunk/doc/devlog/20150821a_parametric_requirements.html (revision 5594) @@ -0,0 +1,32 @@ + +
++My fork is just a fork, just like any of the other forks. My fork happens to +be in an svn repository. I don't think it changes anything important from the +mainline's point of view. + +
+Update (Aug 2016): an active user/contributor community is forming +around pcb-rnd. It is not a one-man-show anymore. + +
+I don't expect any of this to happen. +
+Update (Aug 2016): Instead, I'll launch cschem . + + +
+I commit small things. I make sure I do a big transition using +these small commits in a way that the code stays compilable in between any +two commits. It rarely breaks trunk/ for longer than a few minutes. I +need a real branch once a decade. + +
+Update (Aug 2016): GUI HIDs are plugins now, multiple GUIs can +be compiled and chosen run-time. Default GUI is a runtime configuration too. +All we need to have an opengl GUI HID now is a gl-capable volunteer. + +
+Update (Aug 2016): I can do the build system and plugin administration +part for you. + +
+Update (Aug 2016): the file format is a replacable plugin now; +it's even possible to have multiple alternative formats active in the same +time. It's up to you to implement your format in a plugin. + +
+Update (Aug 2016): ... unless you implement it in a plugin, see point 4.4. + +
+Update (Aug 2016): long term the new primary file format will be +lihata to overcome the above limitations. Later on the internal representation +may change too. + +
+Update (Aug 2016): as a practical example, windows .exe has +been cross-compiled on a Linux box. + +
+Else maybe you don't like using anything else than autotools. It's your +choice; mine is that I do keep on using scconfig in my projects. + Index: trunk/doc/devlog/20150830b_back_ann.html =================================================================== --- trunk/doc/devlog/20150830b_back_ann.html (nonexistent) +++ trunk/doc/devlog/20150830b_back_ann.html (revision 5594) @@ -0,0 +1,304 @@ + +
++Sometimes there are a set of connections which contain pin pairs that could +be swapped. For example the data lines of an external parallel SRAM interface +to an MCU: it doesn't matter if data bit 1 at the MCU is wired to data bit +1 or 5 of the SRAM, as there is an 1:1 mapping and no one else is using the +same bus wires. In this case connections should be swapped during pcb routing +and annotated back to gschem so that the schematics can be updated. Both +paths are illustrated below. +
+ +
+Forward annotation passes on complete netlists along arrows forward1 and +forward2. Back annotation would pass back netlists, changes or modification +requests on the back1, back2 path. Gnetlist takes sch files to extract +and build a netlist in whatever format the receiver needs. There should be a +glue layer, called foo on the drawing, that does the reverse: receives +whatever format the sender has and generates something that gschem will +understand. + +
+An alternative is to keep the netlist as-is, and maintain a separate list of +changes. The form proposed hereby is a table of "operation,pinID,net" or +"operation,args...". Netlist operation is one of "del_conn", "add_conn" and "net_info". The table is called the netlist patch. +
+For example assume two components with pins A1, A2 and B1, B2, with connections +n1=A1-B1 and n2=A2-B2. While routing the designer decides changing them to +n1=A1-B2 and n2=A2-B1 would be easier and is acceptable by the design. The +table of changes would contain this: +
op | pinID | net + |
---|---|---|
del_conn | B1 | n1 + |
del_conn | B2 | n2 + |
add_conn | B2 | n1 + |
add_conn | B1 | n2 + |
+Pcb-rnd would store this table in memory. When some code calls the netlist +code to find out the members of a net, or which net a given pin is connected to, +after running the original netlist code, the result would be adjusted by the table. +
+The table would be normalized after operations. For example: +
op | pinID | net + |
---|---|---|
del_conn | B1 | n1 + |
add_conn | B1 | n2 + |
add_conn | B1 | n3 + |
del_conn | B1 | n2 + |
op | pinID | net + |
---|---|---|
del_conn | B1 | n1 + |
add_conn | B1 | n3 + |
+Pcb-rnd would save the normalized table in the pcb file in a new section. +Upon a netlist change in pcb (import/load netlist or load the pcb), pcb-rnd +would check each row of the table: it is easy to decide whether that row +has been implemented in the netlist or not. Obsolete rows of the table would +be deleted. +
+A corner case is when B1 is removed from n1 and then added to n2 by the table, +while a new forward annotation removes B1 from n1 and adds it to n3. In this +case the first row of the table is deleted, as B1 is already removed from n1, +but pcb-rnd has no chance to decide if netlist adding B1 to n3 should affect +the table adding B1 to n2, so that rule is kept. +
+net_info is used to describe the original members of a net, in +the state they were before any change on the netlist occured. + +
+There should be a separate dialog box or a separate region of the netlist box +showing the netlist patch with edit capabilities. +
+Finally, the most important feature would be new actions resolving shorts. +Using the above example (n1=A1-B1 and n2=A2-B2 changed to n1=A1-B2 and n2=A2-B1), +I believe the user would: +
action | screenshot | patch list after the actions + |
---|---|---|
| (empty) + | |
| (empty) + + | |
| + | (empty) + + |
| + |
++net_info n1 A1 B1 +net_info n2 A2 B2 +del_conn B1 n1 +add_conn B1 n2 ++ + |
| + |
++net_info n1 A1 B1 +net_info n2 A2 B2 +del_conn B1 n1 +add_conn B1 n2 +del_conn B2 n2 ++ + + |
| + | |
| + |
++net_info n1 A1 B1 +net_info n2 A2 B2 +del_conn B1 n1 +add_conn B1 n2 +del_conn B2 n2 +add_conn B2 n1 ++ + |
+An alternative is drag&drop ratline endpoint onto snap points; it may +be tricky to convert that to net/pin relations if a rat line is between two +line segments, tho. +
+These changes would live immediately, leaving the board free of shorts and +rats. There should be, however, some warning in the "congratulation" message +that tells the user a back annotation is still required. + +
+There are multiple ways pins can be connected to a net in gschem. It's +probably not a good idea to have too much automatism in the gschem's side, +trying to actually removing connections and adding new ones using the patch +(or whatever info foo converted the patch into). +
+However, gschem should support four things natively: +
+Displaying unwanted connections happen at: +
+TODO: there are a lot to think over about special cases related to +multipage schematics, hierarchies, slots, split symbols. + +
+There are other parameters that sometimes change during routing. A common case +for my 1 or 2 layer boards is when I originally intend to use 0603 parts but +during routing I figure I need to pass a trace between the pads. I need to +change the part to 0805 or 1206 (for two traces). I'd like to be able to +do this in-place in pcb with an action that replaces the footprint +but keeps the origin in place. This obviously still requires some manual +fiddling afterwards, but would remove the long, tedious chain I have now: +
+The new process would be: +
+The same thing could work for values, which is the other attribute PCB also
+sees. The same mechanism could work from other programs as well, e.g. tuning
+the values of some parts in a simulator and then back annotating the changes
+to the schematics. The patch table format foo handles would be in the
+simplest plain text form.
+
+
+
+ (or it could be a del_attrib and add_attrib pair, like with connections)
+ Amendment 2: examples from gschem's point of view (3rd Sep)
+ netlist change
+
+
+
+
+del_conn netname1 U1-1
+add_conn netname2 U1-1
+
+ attribute change: footprint change
+
+
+
Index: trunk/doc/devlog/20150901a_back_ann.html
===================================================================
--- trunk/doc/devlog/20150901a_back_ann.html (nonexistent)
+++ trunk/doc/devlog/20150901a_back_ann.html (revision 5594)
@@ -0,0 +1,87 @@
+
+
+
+change_attrib U1 footprint=DIP(8) footprint=SO(8)
+
+ pcb-rnd devlog
+
+ back annotation
+
+
+ Conclusions of the first thread
+DJ has another model
+where back annotation is only a subset of a bigger mechanism.
+
+Many other users commented the thread, but no one else presented a +plan that formed a complete system. +
+While there were some useful feedback about some details, no one explicitly +said he'd be contributing the gschem part (... for any of the ideas floating +around). +
+The thread is swamped in a chaotic set of random ideas and opinions - the
+same way as previous related threads usually did.
+
+
+
+First, I seek a contributor for exactly these 3 things. Alternatively if
+there's someone who is really willing to contribute actual code and spend
+time on this, I'm open to change parts of my plan if he has better ideas
+as long as the new approach still solves the actual problems I have.
+
+
+
+The main options currently are:
+
+And then everything broke. A minilib I use for hashing,
+genht, failed to
+link against hid/common/action.c. I first thought it was a bug in genht:
+genht was compiled without --std while the rest of the code compiled with
+--std=gnu99 or --std=c99. Genht heavily depends on static inline
+functions for performance, maybe that's why.
+
+So I tried to reproduce the situation in a hello-world like program and
+tried all combinaton of --std, -DNDEBUG, -rdynamic and all build flags
+used in pcb-rnd for the genht lib and the test program, but all combination
+worked. It looked like it broke only in pcb-rnd.
+
+I gave up on the minimal test case and went back to pcb-rnd. I realized if
+the build is the same, the only way it may break is that some header
+included before genht's headers change some global state. I started to
+shuffle the #includes. Long story short, it turned out if <glib.h> is
+included before genht's headers, it breaks.
+
+Some more tracing showed it was because glib over-#defines the keyword
+inline in a public header that gets included from glib.h. It's all wrapped
+in a complicated tree of #ifdefs, so it behaves differently depending on
+the --std setting.
+
+The morale of the story is... Well, I have multiple conclusions.
+
+In a nuthsell this is why I don't believe in glib-like solve-all megalibs. I
+don't say size alone determines this, but size is a good indication of
+potential problems.
+
+If I need hash and lists and the offer is longer than 5k sloc, I know it
+will bring a lot of unneeded bloat that likely to break things.
+
+
+
\ No newline at end of file
Index: trunk/doc/devlog/20160101_cschem.html
===================================================================
--- trunk/doc/devlog/20160101_cschem.html (nonexistent)
+++ trunk/doc/devlog/20160101_cschem.html (revision 5594)
@@ -0,0 +1,68 @@
+
+
+Some concepts cschem will try to follow (marking with * where there's major
+difference to geda):
+
+There are a lot of open questions:
+
+Raw results are available in html, tsv and
+csv format.
+
+
+The situation for pcb might be different, tho. I worded the first 4 questions
+to find out how strong the need is among the users of mainline pcb and whether
+they are devoted to pcb or choose the tool according to the design requirements.
+There seems to be a correlation between having to use blind/burried vias
+and using other layout tools. Or in other words: those who are happy with pcb
+usually don't need or want blind/burried vias anyway and those who do have
+already switched to another tool.
+
+This suggests mainline pcb could benefit from burried/blind vias. However,
+the demand is much lower than "every new design needs this" or "no new
+user would consider pcb because of this missing feature".
+
+Linux: it seems pcb power users mostly use Linux. I am not sure if it's
+because PCB works well on Linux and is a bit harder to compile on
+anything else - or the other way around (Linux users are more attracted
+to PCB).
+
+
+
+
+
+
Index: trunk/doc/devlog/20160313_unglib.html
===================================================================
--- trunk/doc/devlog/20160313_unglib.html (nonexistent)
+++ trunk/doc/devlog/20160313_unglib.html (revision 5594)
@@ -0,0 +1,49 @@
+
+
+The source of these problems is that glib is a "megalib" that tries to solve
+a host of problems as a package.
+
+
+The minilibs are imported as svn externals in trunk/src_3rd. They are small
+enough so that they can be distributed together with pcb sources.
+
+
+This means pcb-rnd can be compiled with lesstif (or a compatible motif)
+on a UNIX box without depending on glib. Together with the earlier effort
+that removed autotools, it means a UNIX box without any "GNU infection"
+should be able to compile and run pcb-rnd.
Index: trunk/doc/devlog/20160314_valgrind_flex.html
===================================================================
--- trunk/doc/devlog/20160314_valgrind_flex.html (nonexistent)
+++ trunk/doc/devlog/20160314_valgrind_flex.html (revision 5594)
@@ -0,0 +1,79 @@
+
+
+A typical valgrind log for such a leak looks like this:
+
+The leak was also a rare one: happened for one string per file. This suggested
+it was in the header - unless there's an one-instance object somewhere in the
+.pcb or it's a cache where the same pointer is free()'d and overwritten for
+multiple occurrences and simply no one free()'s the last.
+
+Assuming it's a header, a cheap ways to find which header field leaked:
+
+At this point I figured that I'd depend on the reported size of the leak
+with my tests. I didn't want to do multiple runs and didn't want to risk
+the whole parser to run differently so I didn't want to modify the input. Instead
+I figured there's a simple, yet generic way to track these sort of leaks.
+
+I estimated no string in the file is longer than 1000 characters. Right above
+the calloc() in the lexer I introduced a new static integer variable starting
+at 1000, increased before each allocation. This counter is sort of an ID of
+each allocation. Then I modified the calloc() to ignore the originally calculated
+string length and use this ID for allocation size. I also printed the ID-string
+pairs. The original code looked like this (simplified):
+ Second thread
+In the second thread I will focus on actual contribution. For this,
+I'm narrowing down what exactly needs to be contributed:
+
+
+
+
+ Preparing for the third phase (3rd sep)
+Options are being eliminated slowly. I couldn't find out who are currently the
+maintainers of gschem, so I couldn't ask their opinion about my back annotation
+plan directly. Last stable release is about 2 years old, last unstable is more
+than a year old.
+
+
+There are some other options, but those are just variants of the above three.
+Currently I think option 1 is unlikely to work, for I don't touch git,
+and noone wants to touch scheme. Both 2 or 3 could work, but the total lack
+of gschem maintainer feedback doesn't make option 2 look too good.
+
Index: trunk/doc/devlog/20151028_glib.html
===================================================================
--- trunk/doc/devlog/20151028_glib.html (nonexistent)
+++ trunk/doc/devlog/20151028_glib.html (revision 5594)
@@ -0,0 +1,65 @@
+
+
+ pcb-rnd devlog
+
+ why glib is a bad idea
+
+Levente tried to compile pcb-rnd on bsd and used a different c compiler
+than gcc. For this in the first step I fixed the build system so that it
+doesn't have gcc --std=gnu99 but gcc --std=c99.
+
+
+
+ pcb-rnd devlog
+
+ cschem
+
+Cschem is a project I plan to start within the next few years. It's goals
+and some design concepts are similar to gschem's and geda's, while it
+also breaks some traditions to fix shortcomings in the design of geda. It's
+named after gschem, not after geda, to emphasize that the editor needs to
+be connected more to the rest of the system (see details later).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/doc/devlog/20160126.html
===================================================================
--- trunk/doc/devlog/20160126.html (nonexistent)
+++ trunk/doc/devlog/20160126.html (revision 5594)
@@ -0,0 +1,59 @@
+
+
+ pcb-rnd devlog
+
+ Burried/blind via poll
+
+ Results
+
+I received 10 full answers to the poll - thanks everyone who
+answered. This is a small sample, but this is the best I could get
+(I can't reach more pcb users).
+ My interpretation
+
+(User obviously means "those users who answered the poll")
+
+
+
+
+ My conclusions
+Because of 1. and 2., pcb-rnd doesn't seem to need blind/burried vias. The
+purpose of question 7 was to find out whether users value this feature high
+enough to actually consider investing time/effort in return, compared to
+question 6. This pair of questions was designed to avoid noise that comes
+from the fact that we, on the list tend to express our opinions in vast
+crowds while only a few invest more time than talking and do actual work.
+According to the result of line 7, my conclusion is that it's absolutely
+not blind/burried vias that potential pcb-rnd users need. Thus
+my decision is that I won't spend time on this feature in the near future.
+ pcb-rnd devlog
+
+ unglib: glib removal
+
+ glib problems
+
+As mentioned in a previous post, glib is
+sometimes dangerous. Even if it was not, it's still huge and contradicts
+the UNIX philosophy: Do One Thing and Do It Well. Glib tries to do a lot
+of things. I do not doubt it is trying to do each of these things well, but as
+a combination it's pretty much impossible to Keep It Simple, Stupid.
+While glib is modular in design, from the viewpoint of an application it is
+not modular: it's highly unlikely that the application can replace a part
+of glib while keeping the rest.
+ The solution
+
+The solution is to replace the megalib with
+a set of independent minilibs. Each minilib:
+
+
+ Current state
+
+The "unglib" patch is mostly done. All references of glib are removed
+from the core and the lesstif hid. There are a three components that
+still depend on glib, but they each can be disabled:
+
+
+ pcb-rnd devlog
+
+ "valgrinding" flex/bison parsers
+
+In a flex/bison parser it's quiet common that strings are allocated
+in flex, passed on to bison and then either free'd there or saved in
+the output data. Since both free and save happens a lot, it's not an
+easy mechanical review of the .y file to find the reason for leaks. Especially
+if the code has to store some strings in temporary storage until a later
+stage of the parsing.
+
+==20520== 20 bytes in 1 blocks are still reachable in loss record 3 of 6
+==20520== at 0x402B0D5: calloc (vg_replace_malloc.c:623)
+==20520== by 0x80E6EF0: yylex (parse_l.l:177)
+==20520== by 0x80E0D6C: yyparse (parse_y.tab.c:1696)
+==20520== by 0x80E85ED: Parse (parse_l.l:292)
+==20520== by 0x80E876B: ParsePCB (parse_l.l:347)
+==20520== by 0x8078591: real_load_pcb (file.c:390)
+==20520== by 0x80787E9: LoadPCB (file.c:459)
+==20520== by 0x8097719: main (main.c:1781)
+
+
+The code at parse_l.l:177 is just a calloc() and some string
+operation: this is where the string is created. The STRING token is
+referenced about 58 times in the grammar. After reading through the
+whole file 4..5 times, I still didn't see any obvious place for the leak.
+
+
+
+ /* ... predict string size ... */
+ yylval.str = calloc(predicted_size, 1);
+ /* ... build the string here ... */
+ return STRING;
+
+
+The resulting code looked like this (simplified):
+
+ /* ... predict string size ... */
+ static int alloc_id = 1000;
+ alloc_id++;
+ yylval.str = calloc(alloc_id, 1);
+ /* ... build the string here ... */
+ fprintf(stderr, "STRING: %d '%s'\n", alloc_id, yylval.str);
+ return STRING;
+
+I saved the list printed on stderr and checked valgrind's log to find
+the two strings in question were ID 1002 and ID 1007, both looked
+something like this:
+
+1,3,4,c:2,5,6,s:7:8
+
+The only thing that looks like this is the layer group description ("Groups()").
+From this point it was trivial to find the bug in the grammar.
+
Index: trunk/doc/devlog/20160409/header
===================================================================
--- trunk/doc/devlog/20160409/header (nonexistent)
+++ trunk/doc/devlog/20160409/header (revision 5594)
@@ -0,0 +1,7 @@
+1. Do you use the lesstif HID?
+2. If there were different menu resources files distributed with PCB, would you try them?
+3. Do you customize your menu resource file?
+4. If you do not costumize your menu resource file, it's because
+5. Do you miss multi-key sequences from the GTK hid?
+6. If the GTK hid supported multi-key sequences, would that change any of your previous answers?
+7. Vendor (drill) mapping also uses a resource file.
Index: trunk/doc/devlog/20160409/header.csv
===================================================================
--- trunk/doc/devlog/20160409/header.csv (nonexistent)
+++ trunk/doc/devlog/20160409/header.csv (revision 5594)
@@ -0,0 +1 @@
+1. Do you use the lesstif HID?,2. If there were different menu resources files distributed with PCB, would you try them?,3. Do you customize your menu resource file?,4. If you do not costumize your menu resource file, it's because,5. Do you miss multi-key sequences from the GTK hid?,6. If the GTK hid supported multi-key sequences, would that change any of your previous answers?,7. Vendor (drill) mapping also uses a resource file.,
\ No newline at end of file
Index: trunk/doc/devlog/20160409/legend.txt
===================================================================
--- trunk/doc/devlog/20160409/legend.txt (nonexistent)
+++ trunk/doc/devlog/20160409/legend.txt (revision 5594)
@@ -0,0 +1,60 @@
+1. Do you use the lesstif HID? (select one)
+a. yes, exclusively
+b. yes, often
+c. sometimes, rarely
+d. never
+
+
+2. If there were different menu resources files distributed with PCB,
+would you try them? (select one)
+a. yes, I'd give each variant a try before deciding which one to use
+b. no, I'm fine with the default
+c. I don't know what a menu resource file is
+
+
+3. Do you customize your menu resource file? (select one)
+a. yes, always (e.g. I have an own variant I use with all installation of
+PCB)
+b. yes, sometimes, rarely (e.g. I once had to do something repeatedly and
+added a key binding for that)
+c. never, I know where I'd perform the changes if I ever needed
+them but defalts are good enough for now
+d. never, I don't know what a menu resource file is
+
+
+4. If you do not costumize your menu resource file, it's because (select
+zero or more):
+a. I don't need to
+b. the file is too long
+c. too many keys are taken, it's hard to find a free one
+d. I don't like the format of the file
+e. I don't like the idea of editing text config files, I want a GUI for
+this
+f. I don't want to diverge from the default settings (e.g. because of
+potetial hassle at a later upgrade)
+
+
+5. Do you miss multi-key sequences from the GTK hid? (select one)
+a. yes, I'd prefer to use them over modifiers (ctrl, alt, shift)
+b. yes, I'd use them together with the modifiers
+c. maybe I'd use some
+d. no, I prefer modifiers
+e. I hate the idea so much that I'd even disable it compile time if that
+was possible
+f. N/A, don't know
+
+
+6. If the GTK hid supported multi-key sequences, would that change any of
+your previous answers? (fill in zero or more with a letter)
+a. my new choice for 2. would be:
+b. my new choice for 3. would be:
+
+7. slightly off-topic: vendor (drill) mapping also uses a resource file.
+Do you use this feature? (select one)
+a. yes, often, many of my boards rely on vendor mapping and I maintain
+my own resource files per vendor
+b. yes, sometimes, rarely (e.g. I needed it once...)
+c. no, I know how to use it but never needed it
+d. no, I know the feature exists and I know where to look it up but I
+don't really know what exactly it can do or why I should bother
+e. no, I never heard about this feature
Index: trunk/doc/devlog/20160409/pie_col_1.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/devlog/20160409/pie_col_1.png
===================================================================
--- trunk/doc/devlog/20160409/pie_col_1.png (nonexistent)
+++ trunk/doc/devlog/20160409/pie_col_1.png (revision 5594)
Property changes on: trunk/doc/devlog/20160409/pie_col_1.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/doc/devlog/20160409/pie_col_2.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/devlog/20160409/pie_col_2.png
===================================================================
--- trunk/doc/devlog/20160409/pie_col_2.png (nonexistent)
+++ trunk/doc/devlog/20160409/pie_col_2.png (revision 5594)
Property changes on: trunk/doc/devlog/20160409/pie_col_2.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/doc/devlog/20160409/pie_col_3.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/devlog/20160409/pie_col_3.png
===================================================================
--- trunk/doc/devlog/20160409/pie_col_3.png (nonexistent)
+++ trunk/doc/devlog/20160409/pie_col_3.png (revision 5594)
Property changes on: trunk/doc/devlog/20160409/pie_col_3.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/doc/devlog/20160409/pie_col_4.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/devlog/20160409/pie_col_4.png
===================================================================
--- trunk/doc/devlog/20160409/pie_col_4.png (nonexistent)
+++ trunk/doc/devlog/20160409/pie_col_4.png (revision 5594)
Property changes on: trunk/doc/devlog/20160409/pie_col_4.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/doc/devlog/20160409/pie_col_5.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/devlog/20160409/pie_col_5.png
===================================================================
--- trunk/doc/devlog/20160409/pie_col_5.png (nonexistent)
+++ trunk/doc/devlog/20160409/pie_col_5.png (revision 5594)
Property changes on: trunk/doc/devlog/20160409/pie_col_5.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/doc/devlog/20160409/pie_col_7.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/devlog/20160409/pie_col_7.png
===================================================================
--- trunk/doc/devlog/20160409/pie_col_7.png (nonexistent)
+++ trunk/doc/devlog/20160409/pie_col_7.png (revision 5594)
Property changes on: trunk/doc/devlog/20160409/pie_col_7.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/doc/devlog/20160409/poll.csv
===================================================================
--- trunk/doc/devlog/20160409/poll.csv (nonexistent)
+++ trunk/doc/devlog/20160409/poll.csv (revision 5594)
@@ -0,0 +1,9 @@
+a,a,a,-,-,-,c
+d,a,c,f,a,-,d
+b,a,b,-,c,-,c
+d,c,d,a+f,c,-,e
+d,b,c,a+f,b,-,b
+d,a,a,a,d,-,c
+-,a,c,-,a,-,-
+c,a,b,f,a,-,c
+c,a,c,-,a,-,-
Index: trunk/doc/devlog/20160409/poll.html
===================================================================
--- trunk/doc/devlog/20160409/poll.html (nonexistent)
+++ trunk/doc/devlog/20160409/poll.html (revision 5594)
@@ -0,0 +1,98 @@
+
1. Do you use the lesstif HID? + | 2. If there were different menu resources files distributed with PCB, would you try them? + | 3. Do you customize your menu resource file? + | 4. If you do not costumize your menu resource file, it's because + | 5. Do you miss multi-key sequences from the GTK hid? + | 6. If the GTK hid supported multi-key sequences, would that change any of your previous answers? + | 7. Vendor (drill) mapping also uses a resource file. + |
---|---|---|---|---|---|---|
a | a | a | - | - | - | c + |
d | a | c | f | a | - | d + |
b | a | b | - | c | - | c + |
d | c | d | a+f | c | - | e + |
d | b | c | a+f | b | - | b + |
d | a | a | a | d | - | c + |
- | a | c | - | a | - | - + |
c | a | b | f | a | - | c + |
c | a | c | - | a | - | - + |
+ | + | + | + | + | + | + |
+
+1. Do you use the lesstif HID? (select one) +a. yes, exclusively +b. yes, often +c. sometimes, rarely +d. never + + +2. If there were different menu resources files distributed with PCB, +would you try them? (select one) +a. yes, I'd give each variant a try before deciding which one to use +b. no, I'm fine with the default +c. I don't know what a menu resource file is + + +3. Do you customize your menu resource file? (select one) +a. yes, always (e.g. I have an own variant I use with all installation of +PCB) +b. yes, sometimes, rarely (e.g. I once had to do something repeatedly and +added a key binding for that) +c. never, I know where I'd perform the changes if I ever needed +them but defalts are good enough for now +d. never, I don't know what a menu resource file is + + +4. If you do not costumize your menu resource file, it's because (select +zero or more): +a. I don't need to +b. the file is too long +c. too many keys are taken, it's hard to find a free one +d. I don't like the format of the file +e. I don't like the idea of editing text config files, I want a GUI for +this +f. I don't want to diverge from the default settings (e.g. because of +potetial hassle at a later upgrade) + + +5. Do you miss multi-key sequences from the GTK hid? (select one) +a. yes, I'd prefer to use them over modifiers (ctrl, alt, shift) +b. yes, I'd use them together with the modifiers +c. maybe I'd use some +d. no, I prefer modifiers +e. I hate the idea so much that I'd even disable it compile time if that +was possible +f. N/A, don't know + + +6. If the GTK hid supported multi-key sequences, would that change any of +your previous answers? (fill in zero or more with a letter) +a. my new choice for 2. would be: +b. my new choice for 3. would be: + +7. slightly off-topic: vendor (drill) mapping also uses a resource file. +Do you use this feature? (select one) +a. yes, often, many of my boards rely on vendor mapping and I maintain +my own resource files per vendor +b. yes, sometimes, rarely (e.g. I needed it once...) +c. no, I know how to use it but never needed it +d. no, I know the feature exists and I know where to look it up but I +don't really know what exactly it can do or why I should bother +e. no, I never heard about this feature ++
+Raw results are available in html, tsv and +csv format. + +
+Community: although users express their needs, they do not contribute +even in smallish, non-programming tasks like designing the hotkey layout. +This is probably in-line with the answers for 4: they don't really customize +things, they want to use the software as is. +
+Conclusion: it is worth shipping multiple menu/keyboard layouts as long as +they are all maintained in the central repo (questions 2, 3 and 4). It is +pointless to invest in tools that make customization easier or to prepare +for collecting user-customized menu files, as users won't invest any time in +this. + + + + + + + Index: trunk/doc/devlog/20160716_sprint.html =================================================================== --- trunk/doc/devlog/20160716_sprint.html (nonexistent) +++ trunk/doc/devlog/20160716_sprint.html (revision 5594) @@ -0,0 +1,81 @@ + +
++The most important procedures are I. and II., which together are estimated +to take something between 40 and 90 minutes. +
+No installation, no root privileges required. No interference expected with +your pcb mainline installation. What you'll need is about the same you would +need for compiling mainline or a random application: +
+This policy is very unlikely to change in the future - if you believe +the core should be rewritten in your favorite language, please fork the +project or start a new one. + Index: trunk/doc/devlog/20160808_model.html =================================================================== --- trunk/doc/devlog/20160808_model.html (nonexistent) +++ trunk/doc/devlog/20160808_model.html (revision 5594) @@ -0,0 +1,101 @@ + +
++In a proper model there's no element/footprint. There are a few simple +primitives and there are groups, like the ones in svg: groups contain +metadata, primitives and groups. +
+An element is just a group. The whole design may contain groups of groups +of groups. A stereo amplifier may be a group for a PSU and two instances +of a single-channel amp group that match square-unit to square-unit. +
+What makes up an element now is a refdes, its pins/pads we can identify +(for the netlist-related things) and the feature that you can drag the +whole thing as one. A group could do all these as well: refdes is just +metadata, silk lines are just primitives, pins/pads are just small groups +of primitives and metadata. +
+There could be "group types" and type-specific code handling them. In such +a setup you probably don't need to have a text object: just a group that +consists of mostly lines (or polygons) and some metadata (the string +version of the text); the group type would assigns the text-handling code +with to the group. So for the rest of the code, text is not a special +thing, not a bounding box, but just a set of primitives. When you edit it, +you can edit it either line-by-line or as text with the assigned code. +
+This would allow us to have a very small amount of primitives: line, arc, +poly, hole (without a ring - a via is just a group of a few primitives). +Each primitive would have a layer-span field; this would solve the +blind/buried via question for good. (In theory line and arc could be one +thing, spline oslt, but I don't think performance penalty is worth that.) +
+However, this means a total rewrite as almost every non-trivial piece of +the code depends on the object model, from find/search/drc to the whole +polygon code, just to name two huge ones. The file format thing is the +smallest of this all. The only major parts I think we could keep are the +GUI and the new conf system. At the current rate of development this would +take more than a year to have a mostly working version and probably yet +another year to get everything tested out and reach current level of +service again. +
+I am not against such a rewrite, but it would really need a very strong +user/tester backing and maybe more developers than the current amount. +
+Also, Imagine we'd have a pcb program you couldn't trust on +anything: e.g. losing your data, generating broken gerber, etc. for a very +long time... +
+So I generally agree that we should do this, but for practical reasons I +am a bit skeptic whether this would work out in the current situation. +It'd kill any cschem plans for years, and because of the long development +cycle it would most probably kill pcb-rnd too. +
+</daydreaming> + +
+
+This 3.,4. would not be the same as building up everything from generic +atoms, but would be close to it and would be much simpler to implement +(still a big one, tho). I believe in practice, for end users, it would +probably be 99% the same as the proper solution. +
+I believe 3.,4. would be more or less the pcb-rnd equivalent of gschem's +implementation of schematics and symbols with about the same level of +generalism. Not perfect, but maybe good enough. Index: trunk/doc/devlog/20160823_lhtpers.html =================================================================== --- trunk/doc/devlog/20160823_lhtpers.html (nonexistent) +++ trunk/doc/devlog/20160823_lhtpers.html (revision 5594) @@ -0,0 +1,209 @@ + +
++Terminology used in this document: +
+The file is a tree; even an ini file is a tree with 1 or 2 levels (bottom +level is a hash of text nodes, top level, groups, represent another hash). An +xml is a list of lists with text nodes and non-text-node attributes +representing a hash. + +
+This problem is already solved. + +
+This problem is seemingly solved by using a canonical form: even if the +loader may accept alternatives, the save code always generates the same formatted +output, down to the last whitespace indentation. + +
+Even worse, 3rd party scripts need to learn the canonical format too, for the +same reason. + + +
+An alternative is that the CAD program doesn't save canonical format over +an existing file but tries to accommodate to the format the file already features. +This solves problem #0, #1, #2 and #3, allowing the user (or 3rd party scripts) +to use whatever formatting they prefer, with clean round trips. + +
+This may sound more expensive than the first approach, because the parser needs +to run again on save. However, the costs of the previous approach are +high too: +
+If the syntax-sugar overhead of the file format is low, majority of all +bytes will be actual node data (need to be stored) and delimiters/indentation +(need to be stored). Then it might be cheaper to store it all in one bug chunk +and re-parse it (without building a DOM) than storing the same data in small +chunks. + + +
+Empty lists may need special (but trivial) treatment. +
+While copying an existing node, it is possible to "pick up" style +e.g. indentation. When a new item needs to be added, such picked up local +style info can be used to generate output that looks similar to other items +in its local environment. For example the first time a list or hash item +needs to be added is right after at least one item of the given hash or +list is already parsed, which means the style of an item is already know. + +
+Later on I added a few features, and pcb-rnd slowly became much more than +just different defaults. I felt other users may find the new features useful, +so I had put it on offer: advertised the repository. I thought users +would download and try the software. Judging from the feedback, they didn't. I +didn't mind, becuase I was working on features I needed, to get pcb-rnd do what +I wanted: I was my own target audience and anyone else trying pcb-rnd could +only be a side effect. Until when I ran out of features because it already +had everything I needed. +
+The next step was to implement features for other users. Between summer +of 2015 and summer of 2016, I tried to be a bit more proactive: made +public polls to map what users needed and tried to focus implementing +those features. This did not bring too many users either. +
+This was when I realized what was really happening: I was offering +features for virtual users, addressing my communication to the wide +auidence. Noone really felt it was for him. Even if he was complaining about +a missing feature in pcb and a few days later I announced the fix in pcb-rnd, it +was not specifically for him, but for the Greater Good. +
+Virtual users nearly never became real users. My conclusion was that there +was no point in implementing features for virtual users as noone ever would +use those features. + +
+Learning from this experiece, the new strategy of pcb-rnd is as follows: +
+What we don't have: +
+Why we don't have it: +
+What's needed: +
+How we could have it, gtk+gl: +
+How we could have it, long term: +
+What we can't do: +
1. How many of your boards REQUIRE burried or blind vias? [percentage] + | 2. How many of your boards could BENEFIT burried or blind vias? [percentage] + | 3. When your board REQUIRED them, do you more often find a workaround to stick with pcb instead of switching to another design tool? [yes/no] + | 4. When your board could BENEFIT using them, do you more often find a workaround to stick with pcb instead of switching to another design tool? [yes/no] + | 5. Have you ever tried pcb-rnd? [yes/no] + | 6. Would you try pcb-rnd if it offered blind/burried vias? [yes/no] + | 7. Would you consider switching to pcb-rnd if it offered blind/burried vias? [yes/no] + | 8. Approximately how many boards have you done so far with pcb (pcb mainline/branches/forks included, using gschem/gnetlist not required)? "1 board done" means you had one or more physical copies of the board. [rough estimation, positive integer] + | 9. Approximately how many boards have you done with other packages? [rough estimation, positive integer] + | 10. What OS would you prefer to do your pcb layouts on (assuming your favorite layout tool is/would be available on it)? [one of: (GNU/)Linux, *BSD, OSX, windows, other; if you like more, select the one you would spend most time on!] + | + |
---|---|---|---|---|---|---|---|---|---|---|
0 | 50 | yes | yes | no | no | no | 1 | 2 | Linux + | |
10 | 40 | no | n/a | no | yes | n/a | 20 | 2 | Linux + | |
0 | 5 | n/a | no | no | no | no | 20 | 4 | Linux + | |
5 | 20 | no | no | no | yes | no | 5 | 20 | Linux + | |
0 | 0 | n/a | n/a | no | no | no | 10 | 0 | Linux + | |
0 | 80 | yes | yes | no | no | no | 15 | 0 | Linux + | |
50 | 80 | no | no | no | yes | n/a | 30 | 100 | OSX + | |
20 | 75 | no | no | no | yes | yes | 15 | 3 | Linux + | |
0 | 8 | yes | yes | yes | yes | no | 2 | 1 | Linux + | |
0 | 2 | yes | yes | no | no | no | 8 | 4 | Linux + |
@" < header +sed "s@^@ | |
---|---|
@;s@\t@ | @g" < poll.tsv +echo " |
" + else + echo " | " + fi +done + +echo ' |
" + echo "
" + cat legend.txt + echo "" +fi + +echo "
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+The current implementation allows pcb-rnd users to make deliberate pin +swapping and footprint replacement. The changes can be saved in a +"netlist patch" format. A modified gschem can load these and present them +as search results pointing to parts of the schematics that need to be changed. +There is a +demo video about how this happens in practice. +
+The modified gschem can be checked out from svn://repo.hu/geda-gaf-ba/trunk +
+The underlying mechanism is versatile and potentially allows more changes +to be back annotated. These are not yet accessible due to the lack of PCB +actions and GUI. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+The cycdrag patch addresses this issue by defining an action that can cycle +through objects that could be dragged in the given point while the left mouse +button is pressed. This lets the user explicitly select the one object to +work on. +
+This demo video +demonstrates how it works with three lines and a via. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+The rest of the packages are features, importers and exporters, e.g. +pcb-rnd-svg is the SVG exporter, pcb-rnd-query is the object +query language needed for the advanced search. +
+A metapackage called pcb-rnd is provided for convenience: it installs +the packages for the most common, yet small setup, with the GTK HID. +
+How to get the packages: +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
name | internal dependencies | description + + |
---|---|---|
pcb-rnd | pcb-rnd-core, pcb-rnd-gtk, pcb-rnd-gerber, pcb-rnd-lpr, pcb-rnd-png, pcb-rnd-propedit, pcb-rnd-query, pcb-rnd-report, pcb-rnd-svg, pcb-rnd-xy | pcb-rnd is load/save compatible with gEDA/PCB and kicad and offers various auxiliary import/export formats. This metapackage installs the core and the most commonly used set of plugins. + |
pcb-rnd-core | This package contains the core program. Most functionality, including the GUI frontend, is in the corresponding plugin package. + | |
pcb-rnd-gtk | pcb-rnd-core | This package contains the GTK+ user-interface for pcb-rnd. + |
pcb-rnd-lesstif | pcb-rnd-core | This package contains the Lesstif/Motif user-interface for pcb-rnd. + |
pcb-rnd-autocrop | pcb-rnd-core | This package provides the autocrop feature that can resize the board to minimum around all the existing objects. + |
pcb-rnd-autoplace | pcb-rnd-core | This package provides the autoplace feature used to place elements automatically and offers two different algorithms to do so. + |
pcb-rnd-autoroute | pcb-rnd-core | This package provides the classic gEDA/pcb autorouter. + |
pcb-rnd-diag | pcb-rnd-core | This package provides actions for debugging/diagnostic purposes. This feature may be needed for reporting bugs. + |
pcb-rnd-distalign | pcb-rnd-core | This package provides actions for arranging elements in an array. + |
pcb-rnd-distaligntext | pcb-rnd-core | This package provides actions for arranging text objects in an array. + |
pcb-rnd-djopt | pcb-rnd-core | This package provides actions to clean up (optimize) tracks. It is especially useful after autorouting. + |
pcb-rnd-gcode | pcb-rnd-core | This package allows exporting the design to gcode, useful for CNC milling. + |
pcb-rnd-gerber | pcb-rnd-core | This package allows exporting the design to gerber, accepted by most PCB fab houses. + |
pcb-rnd-lpr | pcb-rnd-core | This package allows printing directly from the GUI, using lpr. + |
pcb-rnd-nelma | pcb-rnd-core | This package allows exporting the design to nelma, for numerical capacitance calculation (via external tool) + |
pcb-rnd-png | pcb-rnd-core | This package allows exporting the design in various bitmap formats, including png and jpeg. + |
pcb-rnd-svg | pcb-rnd-core | This package allows exporting the design in SVG, the Scalable Vector Graphics format. It is useful for publishing the design on the web. + |
pcb-rnd-xy | pcb-rnd-core | This package allows exporting the design in XY, suitable for pick&place machines. + |
pcb-rnd-fontmode | pcb-rnd-core | This package lets the user to turn the GUI into a PCB font editor. + |
pcb-rnd-fp-wget | pcb-rnd-core | This package provides a wget based footprint accessor, which allows integrating web directories of footprints in the library. The only currently supported site is gedasymbols.org. + |
pcb-rnd-edif | pcb-rnd-core | This package allows pcb-rnd to import netlists in the EDIF format. + |
pcb-rnd-mincut | pcb-rnd-core | This package upgrades the indication of short circuits: instead of highlighting two random pins/pads, it tries to determine the minimal-cut that would resolve the short. In practice this means it makes a suggestion where to cut the networks to remove the short circuit. + |
pcb-rnd-oldactions | pcb-rnd-core | This package provides some old user actions. These are not used daily anymore, but some old actions scripts may still depend on them. + |
pcb-rnd-polycombine | pcb-rnd-core | This package provides actions to combine (merge) multiple polygons into a single, more complex polygon. + |
pcb-rnd-propedit | pcb-rnd-core | This package provides the property editor function for the GUI. The property editor collects all properties and attributes of all selected objects in a table and allows the user to change them. + |
pcb-rnd-puller | pcb-rnd-core | This package provides actions to "pull" tracks, minimizing their length. + |
pcb-rnd-query | pcb-rnd-core | This package provides the query language used in the advanced search on the GUI. + |
pcb-rnd-renumber | pcb-rnd-core | This package provides various actions to automatically renumber elements on the design. These actions change the refdes of some (or all) elements. + |
pcb-rnd-report | pcb-rnd-core | This package used to provide the report action that displays basic information about design objects. Unlike propedit, report does not allow the user to manipulate any of the data reported. At the moment report is compiled into the core, this package is kept for compatibility and placeholder. + |
pcb-rnd-shand-cmd | pcb-rnd-core | This package provides 1..2 character long shorthands for the most commonly used core commands. + |
pcb-rnd-smartdisperse | pcb-rnd-core | This package implements a smart algorithm to disperse elements. It is useful after importing a new design from the schematics. It is an alternative to autplace. + |
pcb-rnd-stroke | pcb-rnd-core, pcb-rnd-gtk | This package implements mouse gestures using libstroke. + |
pcb-rnd-teardrops | pcb-rnd-core | This package embeds each pin in a teardrop drawn from multiple arcs. May be useful for toner-transfer boards. + |
pcb-rnd-vendordrill | pcb-rnd-core | This package provides vendor drill mapping and vendor specific design rule application. + |
pcb-rnd-kicad | pcb-rnd-core | This package allows pcb-rnd to load and save in kicad's s-expression based (new) file format. + |
pcb-rnd-gsch2pcb | This package provides the external tool gsch2pcb-rnd that can convert a gschem schematics to files that can be imported in pcb-rnd. + + |
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+There's no theoretical maximum explicitly set either. An implicit maximum +exists and is sizeof(int) - should be at least 2^31 on most systems. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+This patch adds a linked list of string flags, filled in with the unknown +flags while loading a PCB. On save, these flags are appended to the normal +flag list. This preserves all unknown flags (but not order of flags) in +a load/save cycle. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+This is all transparent, the user experience is that the remote library is +like a read-only local library reachable from the library window. +
+A web site used as a library should be able to: +
+The plugin uses external program wget to communicate on the web. + + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+This feature has three options: +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+If the grid is very dense, on a large screen the software render may slow down. +This is noticeable in pan and zoom mostly. The bottleneck is the gtk call +that draws the grid points: if there are too many of them, it's slow. + + +
+There's a new "Grid properties" submenu in the view menu in the default +gtk hid menu file. Screenshots were taken with this menu teared-down to +demonstrate the settings. + +
+ +
+Next, the compile-time configurable "minimum distance between grid points +before it is too dense" setting is user configurable now. The default value +can be changed in any of the usual +configuration sources. However, +when the configured density is reached while zooming out, there are two options. +
+The first, default option is to do the same that the original code did: just +hide the grid: +
+ +
+An alternative is to use sparse global grid which means only +every 2nd, 3rd, 4th, ... Nth grid point is drawn. The cursor still snaps +to every real grid point, so the grid got sparse only on the display. Note +how the line is drawn on invisible grid points: +
+ + +
+ +
+The user can configure or interactively set the radius in which the grid +points are drawn: +
+ +
+The radius is given in "number of grid points", thus the local grid yields +a constant number of points that is independent of the actual grid size. When +a local grid gets too dense, it is hidden - there's no sparse option, since +local grids usually have too few points to make reasonable skips. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
commit message tag and doc | description + |
---|---|
[gpmi] | scripting PCB (including GUI dialogs, actions, menus, changing the layout) + |
[intconn] | component internal connections + |
[nonetlist] | components that are not part of the netlist and should not cause shorts + |
[tostyle] | actions, menu and hotkey to change ring dia, line width, drill dia and clearance sizes to match the values defined for the current routing style + |
[mincut] | minimal cut based warnings on shorts + |
[square] | change square pad to a generic shaped-pin based on the octagon pin code - this is an alternative to teardrops + |
[flagcomp] | unknown flag compatibility + |
[scconfig] | use scconfig instead of autotools + |
[pcb-fp] | generic parametric footprints; on-the-fly footprint generation by external tools written in any language (remove m4 hardwirings) + |
[pcblib], [fp_fs], + [pcblib-param] | clean up the footprint library shipped + |
[library_t] | footprint library is an arbitrary tree instead of a special, 2 level tree + |
[fp_wget] | web based footprint libraries, integration of gedasymbols.org + |
[res] | replace resource files with lihata and enable multi-key hotkeys in both gtk and lesstif hids + |
[debian] | Debian packaging the binaries configured to my own taste + |
[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 - for comparison, previous stats: 1.0.8, 1.0.9 + |
[unglib] | remove glib dependency from core + |
[io_*] | .pcb and .fp file format plugins + |
[dynstyle] | dynamic routuing style: sypport more than 4 of them - with no limit + |
[conf] | new, unified, config file system + |
[propedit] | property/attribute editor (gtk) + |
[oldplugins] | import old PCB plugins + |
[query] | query language + |
routing styles | routing style fixes + |
(gtk grid) | gtk grid improvements: sparse global grids, local grids + |
(full screen) | gtk full screen edit mode + |
(settings) | minor changes in default settings + + + + |
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+The patch introduces a new pin flag intconn(g) which marks the pin +to have internal connections in group g. If there +are multiple pins using the same g value within a single element, they +are internally connected. In other words, g is a group (or net name) +within the element and pins can join to one of the numbered groups (or internal +nets). The value of g shall be between 1 and 255, 0 means no internal +connection (equivalent to the case when intconn(0) is omitted). +
+When pin numbers are displayed (key 'd'), internal connection groups are +written in square brackets, e.g. "2 [9]" means "pin 2, internally connected +to group 9". +
+Combined with the [nonetlist] patch, this +solves the "0-ohm 1206 jumper" problem: the element should be marked +as nonetlist, with both pins set intconn(1) - this will result in a 2 +pad element, pads internally connected, that can be part of any one network +without causing short. +
+The second image shows the layout routing the nonconflicting rats and a open +unrouted point where the rat would require one trace to cross another. +
+In the third image a 1206 SMD footprint for a 0 Ohm 1206 resistor called J1 is +placed with an intconn between the two pads which resolves the final rat line. +
+ +
+ +
+ +
+ + + +
+Pin[40000 60000 6000 3000 6600 2800 "2" "2" "square,intconn(9)"] +Pin[40000 50000 6000 3000 6600 2800 "3" "3" "square"] +Pin[40000 40000 6000 3000 6600 2800 "4" "4" "square,intconn(9)"] ++Mainline PCB will load the design ignoring internal connections - +this may introduce new rats. +
+Mainline PCB doesn't save intconn() and elements are embedded in the file - +once the design is loaded and saved with mainline PCB, internal connection +info is lost. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+TODO + +
+Using other io_* implementations will obviously result in files that are +incompatible with mainline pcb (unless mainline pcb learns how to load those +formats). + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+In pcb-rnd this has been replaced with a new struct type called library_t +that can represent an arbitrary tree: directories and files within directories +down to many levels. +
+Both the gtk and the lesstif had has been modified accordingly and can
+properly display the tree. This in turn enables alternative footprint backend
+implementations such as fp_wget to import
+more complex libraries, e.g. the one on gedasymbols.org.
+
+ save/load and compatibility
+Not affected.
+
+ plans
+Finished, no plans.
+
+
+
Index: trunk/doc/features/mincut.html
===================================================================
--- trunk/doc/features/mincut.html (nonexistent)
+++ trunk/doc/features/mincut.html (revision 5594)
@@ -0,0 +1,65 @@
+
+
+
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+I choose minimal cut for my patch because it doesn't require tracing the +full history or any manual administration of nets vs. objects (which I +would find inevitable even with manual tagging - directly or indirectly +the user needs to be able to change net tags). +
+The minimal cut is the least amount of object whose removal would resolve +the short. It is best demonstrated on an example: +
+ +
+Removing all the marked lines/polys/vias would surely resolve the short +(sometimes leaving rat lines behind). Minimal cut is better than randomly +removing objects, tho: it guarantees that the minimal amount of objects +are to be removed. On a complex board, this place is likely to be close +to the place where the problem really is - much closer than the pins/pads. +
+Since mincut can be expensive on large boards, the feature can be enabled +per board (a new PCB flag) and can be disbaled globally (--enable-mincut 0 +when starting PCB). + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+It's possible to limit the feature so that only hirozintal-negative is +considered negative size (i.e. only right-to-left dragging), using the +editor/selection/symmetric_negative conf setting. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+Uses of the nonetlist feature: +
+Preservation: gsch2pcb-rnd leaves nonetlist elements in the PCB. +
+Element["nonetlist" "1206 jumper, 0 ohm" "" "1206" 0 0 -3150 -3150 0 100 ""] +( + Pad[-5905 -1181 -5905 1181 5118 2000 5718 "1" "1" "square,intconn(1)"] + Pad[5905 -1181 5905 1181 5118 2000 5718 "2" "2" "square,intconn(1)"] + ElementLine[-2362 -3740 2362 -3740 800] + ElementLine[-2362 3740 2362 3740 800] +) ++Mainline PCB will load the design ignoring internal connections and nonetlist +flag - this will cause shorts on all connected pins/pads and will break +the connection. +
+Mainline PCB doesn't save nonetlist and elements are embedded in the file - +once the design is loaded and saved with mainline PCB, the flag is lost. +After reloading the file in pcb-rnd, the element causes the same shorts +as in mainline PCB. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+The import/export plugins improted over the default set of the last official +mainline release: +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+When (e.g.) routing 5mm power traces on a small grid, it's not always easy to hit the +point where the trace ended (which is the center of the semicircle at the end of the +line) to start the next line. If you have selected the line tool, finding the end of +the line can become guesswork as the cursor doesn't change shape like it does with the +select tool. +I want my traces to consist of lines and arcs that are perfectly connected and I want +to work as fast as possible. + +Attached is a small patch that + + - makes it possible to deactivate snapping to "some sensible point along a line". + (that's what a comment in the code says). This snapping algorithm gets in the way + sometimes so you have to slowly go over a line to find out where it really ends, + bouncing back and forth between the points of the small grid, the end of the line + and these "sensible points", which is wasting time. The command is + "Display(ToggleSnapOffGridLine)". It is still activated by default to avoid + violating POLA. + + - more importantly, introduces a new command called "Display(ToggleHighlightOnPoint)" + that highlights all lines and arcs which have (end)points exactly on the position + where the cross hair is currently snapped to. It therefore helps finding the end + points of lines and arcs, but sometimes also shows redundant traces, traces that + aren't perfectly connected to each other, traces that don't end directly on the + center of a via but should, etc. It works with thin draw too and I tested it with + gtk and lesstif. + +I use the second option mostly in conjunction with deactivating the first. Both commands +have been added to the menu by means of (g)pcb-menu.res.in and are available as command +line options as well. +Caveats: + - The HID API expects all HIDs to make a copy of the color string when setting a color. + - The function that lightens up a color could be improved. + - I used it for a while, but after porting it from my local fork, it probably needs + more testing. ++ +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+ +
+An online footprint generator web1.0 version is also available. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+The footprint library shipped with mainline pcb is cluttered with
+special puprose parts. I believe PCB encourages the user from
+an early stage to build his own library. Thus the purpose of
+the library shipped with PCB should be
+to provide a minimal collection of real essential footprints ...
+
+[pcblib] is a replacement of newlib/ and lib/ and the m4 macros with +such an essential core library of static footprints ("file elements") +and easier-to-use parametric footprints. + +There is an online map of +the library and +an online interface to the parametric footprint generators. + + Design decisions+Parts are sorted only in a few directories: smd, tru-hole, connector and +parametric. I believe there are so many orthogonal properties of footpritns +that there's no obvious hierarchy. Also, pcblib contains much fewer footpritns +than newlib so it should be still easy to navigate. ++Parametric footprints are in a separate directory for now, even tho they +would fit under smd, tru-hole or connector. The reason is purely historical +and the layout may change in the future. + + Example+To the right: Footprint selection dialog on pcblib, with the smd directory +open. Note how few smd parts are there. Still, smd/ is the most crowded +subdirectory! + +[fp_fs]+As of vesion 1.0.10, the footprint list/search/load of footprints is a plugin. +The original code that handles local file system footprint libraries (e.g. +pcblib or newlib) is now a plugin. Altnerative plugins can be provided that work +from databases or from the web. In extreme +situations the file system based footprint plugin can even be disabled. + +save/load and compatibility+Not affected: elements are embedded in the PCB. + +plans+None, the feature is complete. + | + | + + |
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+No (feature) plans - this feature is fully implemented. + + Index: trunk/doc/features/propedit.html =================================================================== --- trunk/doc/features/propedit.html (nonexistent) +++ trunk/doc/features/propedit.html (revision 5594) @@ -0,0 +1,65 @@ + +
+Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+Propedit introduces a property editor window in gtk that is able to +edit attributes and core properties of all selected objects. Core properties +include all hardwired properties of objects, such as geometry (e.g. +trace width, hole diameter, clearance) or textual data (e.g. string of +a text). +
+ +
+Properties and attributes of the selected objects are collected in a +sorted list - each row of the list is a property (starting with p/) or +an attribute (starting with a/). For each row all values seen in the selection +are also collected so that the following values can be presented on the list, +per row: +
+When the user clicks on a row, an edit box is activated and the value can +be changed. A combo box lists all existing values for the given row, so +it is easy to unify the value of a property or attribute among all selected +objects to one of the existing values, but the user is also free to enter +a new value. +
+It is also possible to remove existing attributes or to add new attributes. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+The query language is the engine behind the advanced search & select +functionality. It is also the foundation of the programmable DRC. +
+The query language is implemented as a core plugin. +
+TODO: more details will come later, when the specification and implementation +stabilizes. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+The code that dealt with the in-memory representation of the resource tree +was wierd and big chunks duplicated in the HIDs and vendor drill module. It +was also hard to parse a resource file with external tools. +
+Since version 1.0.10, pcb-rnd replaces resource files with +lihata. Lihata is a small, generic +purpose container format that can describe arbitrary trees. Just like resource +file syntax, lihata is optimized for hand-editing: no need to use excess +quoting or long boilerplate blocks. +
+Liblihata also provides a lot of helper functions that made the code +dealing with the menus and vendor drill resources much simpler and less +redundant. Since the parser is small and external, and since there are +external converter tools available, it is also easier to deal with the +files outside of the pcb executable. + +
+ha:{ + li:mouse { ... } + li:main_menu { ... } + li:popups { ... } +} ++ +
+Buttons supported are: left, right, middle, up, down - the last two +are for the scroll wheel. Modifier name should start with "press" or "release" +optionally followed by modifier key suffixes separated with dashes, e.g. +"press-alt-shift" means the given button is pressed while alt and shift +were also pressed. +
+Example structure: +
+ li:mouse { + li:left { + li:press = { Mode(Notify) } + li:press-ctrl = { Mode(Save); Mode(None); } + } + } ++ +
+A key description is a text in the form of: +
+ha:example menu item { + li:submenu { + ha:menu item { + action=Save(ElementConnections) + tip=example menu + } + - + ha:another menu item { + a={Shift-Alt<key>r} + action={Action1(); Action2();} + } + } +} ++ +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+Pcb-rnd uses a dynamic vector for storing styles and allows any number +of styles from 0 up to a very large value (2^31-1). There is no compile-time +configurable limit. The number of default styles (and the actual style +configuration) is coming from the template pcb file. +
+Creating a new style in the Route Styles dialog is not "for this session only" +anymore - styles are saved with the design. + +
+In mainline PCB the implicit (or pen) style is hidden. As long as it always +matches one of the existing styles, the user doesn't even know about it. +However, if there are objects that do not comform to any of the existing +styles, it is possible to bump into this. For example: +
+In contrast, pcb-rnd offers an explicit routing style called <custom>. +If SetSame() is invoked on an object that doesn't match any of the existing styles, +the <custom> style is selected: +
+In other words, it is now possible to use the implicit pen style as temporal +style, to explicitly set a line width, via diameter before placing a few +unusual lines or vias, without having to create a new style. It is also +possible to pick up the style of such an unusual object later, without the +GUI confusing it with any of the existing styles. + +
+The same mixup happens for picking up arc parameters, and a similar mixup +for via parameters (a via doesn't have a line width). +
+Pcb-rnd fixes this by searching for the matching style using only the parameters +that the given object really had. This results in valid style selection +the way the user may expect. + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
name + | description + | where to change + + |
---|---|---|
layers + | the default layer stack is optimized for two sided boards with 3 layers on both sides + | edit or replace /usr/share/pcb-rnd/default.pcb + + |
styles & DRC + | default styles and DRC settings are optimized for toner transfer + | edit or replace /usr/share/pcb-rnd/default.pcb + + |
grid + | on startup "enable visible grid" is on and grid is set to 25 mil + | change editor/draw_grid in pcb-conf.lht (in system install dir, in user dir) or in project.lht + + |
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+The patch takes an octagon pin and stretches points in various directions. +There are 4 bits (for left, right, up and down) to indicate in which directions +the stretch applies. Pressing 'q' on a pin cycles thru round pin, square pin, +16 stretched octagons and the original octagon. +
+The code is also patched to handle clearances, shorts and connections (find.c). +
+Thermals are not fully working for funny shaped pins, but it has low priority: +they still work fine for rounded and square pins and if there is a poly around +the pin, I wouldn't use shaped pins anyway. + +
+Pin[40000 60000 6000 3000 6600 2800 "8" "8" "square,shape(3)"] ++Mainline PCB will load the design ignoring the custom shape and will use a +square pin. As long a traces end in the center point of the pin, this +should not break connections. +
+Mainline PCB doesn't save shape() - once the design is loaded and saved with +mainline PCB pin shape info is lost. + +
+The [square] feature is a good base for cleaning up the code a bit and for +moving toward a generic pin shape patch: +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
+PCB has actions (and menus and hotkeys) to change sizes manually. In my practice, +I try to stick to the sizes defined in my routing styles and try to avoid +manually changing clearances or ring sizes. Still, the random values coming +from various footprints should be changed. +
+After many years of struggling with this, I realized the feature I need is +a way to change object sizes to not a relative or absolute number but +to the current routing style. The [tostyle] patch does exactly this. +It implements the following new features: +
+The new route style set works on: +
+CLI: select objects, execute action ChangeSizes(selected, style) +
+CLI: to adjust drill sizes only: select objects, execute action ChangeDrillSize(selected, style) + + +
Main + | News + | People + | Events & timeline + | pcb-rnd + |
---|
pcb-rnd 1 + | 2016-10-29 + | pcb-rnd manual + |
---|
+pcb-rnd - Printed Circuit Board editor ++ +
++ ++pcb-rnd [options] [inputfile] + + + +
+pcb-rnd is a modular PCB editor. The main use is interactive editing. If no -x is specified on the command line, the graphical editor mode is initiated. Automated, headless processing is also possible with -x or --gui batch. ++ + +
+ +++ +
++ + -x exporter [exportflags] inputfile + Instead of interactive editing, export the design (loaded from inputfile) to a file using the specified exporter plugin. A list of exporter-specific parameters may follow to control the details of the process. + + + --gui hid + Use the hid plugin for the "gui" frontend. Common choices are "gtk" or "lesstif" for graphical user intrfaces and "batch" for a headless command-line interface (or automated batch processing). + + + -c path=val + Set a config node in role CFR_CLI. The path of the node is path (e.g. editor/grid) and the new value is val (e.g. 5mm). +
+
pcb-rnd 1 + | 2016-10-29 + | pcb-rnd manual + |
---|
+Click on the images to download the example .pcb design. + +
argument name | description | example in | example out after 1st iteration
Index: trunk/doc/user/06_feature/djopt/debumpify.out.pcb
===================================================================
--- trunk/doc/user/06_feature/djopt/debumpify.out.pcb (nonexistent)
+++ trunk/doc/user/06_feature/djopt/debumpify.out.pcb (revision 5594)
@@ -0,0 +1,88 @@
+# release: pcb-rnd 1.0.7
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["" 140000 67500]
+
+Grid[2500.0 0 0 1]
+Cursor[0 5000 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[1200 900 1000 700 1500 1000]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,4,c:2,5,6,s:7:8")
+Styles["Signal,1000,7874,3150,2000:Power,2000,8661,3937,2000:Fat,8000,13780,4724,2500:Sig-tight,1000,6400,3150,1200"]
+
+
+Element["" "Standard SMT resistor, capacitor etc" "R101" "1206" 17500 32500 -5650 4350 0 100 ""]
+(
+ Pad[5905 -1181 5905 1181 5118 2000 5718 "1" "1" "square"]
+ Pad[-5905 -1181 -5905 1181 5118 2000 5718 "2" "2" "square"]
+ ElementLine [-2362 3740 2362 3740 800]
+ ElementLine [-2362 -3740 2362 -3740 800]
+
+ )
+
+Element["" "Standard SMT resistor, capacitor etc" "R102" "1206" 117500 32500 -5650 4350 0 100 ""]
+(
+ Pad[5905 -1181 5905 1181 5118 2000 5718 "1" "1" "square"]
+ Pad[-5905 -1181 -5905 1181 5118 2000 5718 "2" "2" "square"]
+ ElementLine [-2362 3740 2362 3740 800]
+ ElementLine [-2362 -3740 2362 -3740 800]
+
+ )
+Layer(1 "component")
+(
+ Line[23405 32500 30000 32500 1000 4000 "clearline"]
+ Line[92500 32500 111595 32500 1000 4000 "clearline"]
+ Line[30000 32500 30000 32500 1000 4000 "clearline"]
+ Line[30000 32500 37500 32500 1000 4000 "clearline"]
+ Line[37500 32500 37500 32500 1000 4000 "clearline"]
+ Line[37500 32500 47500 32500 1000 4000 "clearline"]
+ Line[47500 32500 57500 22500 1000 4000 "clearline"]
+ Line[57500 22500 67500 22500 1000 4000 "clearline"]
+ Line[67500 22500 77500 32500 1000 4000 "clearline"]
+ Line[77500 32500 82500 32500 1000 4000 "clearline"]
+ Line[82500 32500 85000 22500 1000 4000 "clearline"]
+ Line[90000 22500 92500 32500 1000 4000 "clearline"]
+ Line[85000 22500 90000 22500 1000 4000 "clearline"]
+)
+Layer(2 "solder")
+(
+)
+Layer(3 "comp-GND")
+(
+)
+Layer(4 "comp-power")
+(
+)
+Layer(5 "sold-GND")
+(
+)
+Layer(6 "sold-power")
+(
+)
+Layer(7 "signal3")
+(
+)
+Layer(8 "outline")
+(
+)
+Layer(9 "silk")
+(
+)
+Layer(10 "silk")
+(
+ Text[30000 5000 0 105 "90" "clearline"]
+ Text[60000 5000 0 105 "45" "clearline"]
+ Text[82500 5000 0 105 "rand" "clearline"]
+)
+NetList()
+(
+ Net("GND" "(unknown)")
+ (
+ Connect("R101-1")
+ Connect("R102-2")
+ )
+)
Index: trunk/doc/user/06_feature/djopt/debumpify.out.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/user/06_feature/djopt/debumpify.out.png
===================================================================
--- trunk/doc/user/06_feature/djopt/debumpify.out.png (nonexistent)
+++ trunk/doc/user/06_feature/djopt/debumpify.out.png (revision 5594)
Property changes on: trunk/doc/user/06_feature/djopt/debumpify.out.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/doc/user/06_feature/djopt/debumpify.pcb
===================================================================
--- trunk/doc/user/06_feature/djopt/debumpify.pcb (nonexistent)
+++ trunk/doc/user/06_feature/djopt/debumpify.pcb (revision 5594)
@@ -0,0 +1,89 @@
+# release: pcb-rnd 1.0.7
+
+# To read pcb files, the pcb version (or the git source date) must be >= the file version
+FileVersion[20070407]
+
+PCB["" 140000 67500]
+
+Grid[2500.0 0 0 1]
+Cursor[0 5000 0.000000]
+PolyArea[3100.006200]
+Thermal[0.500000]
+DRC[1200 900 1000 700 1500 1000]
+Flags("nameonpcb,clearnew,snappin")
+Groups("1,3,4,c:2,5,6,s:7:8")
+Styles["Signal,1000,7874,3150,2000:Power,2000,8661,3937,2000:Fat,8000,13780,4724,2500:Sig-tight,1000,6400,3150,1200"]
+
+Attribute("PCB::grid::unit" "mm")
+
+Element["" "Standard SMT resistor, capacitor etc" "R101" "1206" 17500 32500 -5650 4350 0 100 ""]
+(
+ Pad[5905 -1181 5905 1181 5118 2000 5718 "1" "1" "square"]
+ Pad[-5905 -1181 -5905 1181 5118 2000 5718 "2" "2" "square"]
+ ElementLine [-2362 3740 2362 3740 800]
+ ElementLine [-2362 -3740 2362 -3740 800]
+
+ )
+
+Element["" "Standard SMT resistor, capacitor etc" "R102" "1206" 117500 32500 -5650 4350 0 100 ""]
+(
+ Pad[5905 -1181 5905 1181 5118 2000 5718 "1" "1" "square"]
+ Pad[-5905 -1181 -5905 1181 5118 2000 5718 "2" "2" "square"]
+ ElementLine [-2362 3740 2362 3740 800]
+ ElementLine [-2362 -3740 2362 -3740 800]
+
+ )
+Layer(1 "component")
+(
+ Line[23405 32500 30000 32500 1000 4000 "clearline"]
+ Line[92500 32500 111595 32500 1000 4000 "clearline"]
+ Line[30000 32500 30000 22500 1000 4000 "clearline"]
+ Line[30000 22500 37500 22500 1000 4000 "clearline"]
+ Line[37500 22500 37500 32500 1000 4000 "clearline"]
+ Line[37500 32500 47500 32500 1000 4000 "clearline"]
+ Line[47500 32500 57500 22500 1000 4000 "clearline"]
+ Line[57500 22500 67500 22500 1000 4000 "clearline"]
+ Line[67500 22500 77500 32500 1000 4000 "clearline"]
+ Line[77500 32500 82500 32500 1000 4000 "clearline"]
+ Line[82500 32500 85000 22500 1000 4000 "clearline"]
+ Line[90000 22500 92500 32500 1000 4000 "clearline"]
+ Line[85000 22500 90000 22500 1000 4000 "clearline"]
+)
+Layer(2 "solder")
+(
+)
+Layer(3 "comp-GND")
+(
+)
+Layer(4 "comp-power")
+(
+)
+Layer(5 "sold-GND")
+(
+)
+Layer(6 "sold-power")
+(
+)
+Layer(7 "signal3")
+(
+)
+Layer(8 "outline")
+(
+)
+Layer(9 "silk")
+(
+)
+Layer(10 "silk")
+(
+ Text[30000 5000 0 105 "90" "clearline"]
+ Text[60000 5000 0 105 "45" "clearline"]
+ Text[82500 5000 0 105 "rand" "clearline"]
+)
+NetList()
+(
+ Net("GND" "(unknown)")
+ (
+ Connect("R101-1")
+ Connect("R102-2")
+ )
+)
Index: trunk/doc/user/06_feature/djopt/debumpify.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/user/06_feature/djopt/debumpify.png
===================================================================
--- trunk/doc/user/06_feature/djopt/debumpify.png (nonexistent)
+++ trunk/doc/user/06_feature/djopt/debumpify.png (revision 5594)
Property changes on: trunk/doc/user/06_feature/djopt/debumpify.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/doc/user/06_feature/djopt/debumpify.txt
===================================================================
--- trunk/doc/user/06_feature/djopt/debumpify.txt (nonexistent)
+++ trunk/doc/user/06_feature/djopt/debumpify.txt (revision 5594)
@@ -0,0 +1,2 @@
+Looks for U-shaped traces (with 90 degree corners) that can be shortened
+or eliminated.
Index: trunk/doc/user/06_feature/djopt/index.html
===================================================================
--- trunk/doc/user/06_feature/djopt/index.html (nonexistent)
+++ trunk/doc/user/06_feature/djopt/index.html (revision 5594)
@@ -0,0 +1,45 @@
+
+
+Action djopt()+ +The different types of optimizations change your board in order to +reduce the total trace length and via count. Each optimization is accessible +using an argument, e.g. djopt(miter). The basic actions have to be run multiple +times as each iteration will change the design making new changes possible for +subsequent iterations with the same or other actions. ++Click on the images to download the example .pcb design. + + pcb-rnd GPMI scripting - TOC+ +Installation, configuration+
High level docs+ + +Glue layer documentation+
Authors, credits, misc+ + + + Index: trunk/doc/user/06_feature/gpmi/packages/Makefile =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/Makefile (nonexistent) +++ trunk/doc/user/06_feature/gpmi/packages/Makefile (revision 5594) @@ -0,0 +1,15 @@ +ROOT=../../.. +GPMIDIR=$(ROOT)/src_plugins/gpmi/pcb-gpmi +ALL= actions dialogs hid layout + +all: XREF $(ALL:%=%_ref.html) + +include $(GPMIDIR)/Makefile.config + +%_ref.html REF.% : $(GPMIDIR)/gpmi_plugin/gpmi_pkg/%.h + $(ROOT)/util/genref.sh "$^" "$(ROOT)" "../packages/$*_ref.html" $(PCB_CFLAGS) >$*_ref.html + +XREF: $(ALL:%=REF.%) + cat $^ > $@ + + Index: trunk/doc/user/06_feature/gpmi/packages/XREF =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/XREF (nonexistent) +++ trunk/doc/user/06_feature/gpmi/packages/XREF (revision 5594) @@ -0,0 +1,85 @@ +event ACTE_action ../packages/actions_ref.html#ACTE_action +event ACTE_gui_init ../packages/actions_ref.html#ACTE_gui_init +event ACTE_unload ../packages/actions_ref.html#ACTE_unload +function action_register ../packages/actions_ref.html#action_register +function action_arg ../packages/actions_ref.html#action_arg +function action ../packages/actions_ref.html#action +function create_menu ../packages/actions_ref.html#create_menu +enum dialog_fileselect_e ../packages/dialogs_ref.html#dialog_fileselect_e +function dialog_log ../packages/dialogs_ref.html#dialog_log +function dialog_confirm ../packages/dialogs_ref.html#dialog_confirm +function dialog_report ../packages/dialogs_ref.html#dialog_report +function dialog_prompt ../packages/dialogs_ref.html#dialog_prompt +function dialog_fileselect ../packages/dialogs_ref.html#dialog_fileselect +function dialog_beep ../packages/dialogs_ref.html#dialog_beep +function dialog_progress ../packages/dialogs_ref.html#dialog_progress +function dialog_attribute ../packages/dialogs_ref.html#dialog_attribute +enum hid_attr_type_e ../packages/hid_ref.html#hid_attr_type_e +enum EndCapStyle_e ../packages/hid_ref.html#EndCapStyle_e +event HIDE_get_export_options ../packages/hid_ref.html#HIDE_get_export_options +event HIDE_do_export_start ../packages/hid_ref.html#HIDE_do_export_start +event HIDE_do_export_finish ../packages/hid_ref.html#HIDE_do_export_finish +event HIDE_set_layer ../packages/hid_ref.html#HIDE_set_layer +event HIDE_set_color ../packages/hid_ref.html#HIDE_set_color +event HIDE_set_line_cap ../packages/hid_ref.html#HIDE_set_line_cap +event HIDE_set_line_width ../packages/hid_ref.html#HIDE_set_line_width +event HIDE_set_draw_xor ../packages/hid_ref.html#HIDE_set_draw_xor +event HIDE_set_draw_faded ../packages/hid_ref.html#HIDE_set_draw_faded +event HIDE_draw_line ../packages/hid_ref.html#HIDE_draw_line +event HIDE_draw_arc ../packages/hid_ref.html#HIDE_draw_arc +event HIDE_draw_rect ../packages/hid_ref.html#HIDE_draw_rect +event HIDE_fill_circle ../packages/hid_ref.html#HIDE_fill_circle +event HIDE_fill_polygon ../packages/hid_ref.html#HIDE_fill_polygon +event HIDE_fill_rect ../packages/hid_ref.html#HIDE_fill_rect +event HIDE_use_mask ../packages/hid_ref.html#HIDE_use_mask +event HIDE_make_gc ../packages/hid_ref.html#HIDE_make_gc +event HIDE_destroy_gc ../packages/hid_ref.html#HIDE_destroy_gc +event HIDE_fill_pcb_pv ../packages/hid_ref.html#HIDE_fill_pcb_pv +event HIDE_fill_pcb_pad ../packages/hid_ref.html#HIDE_fill_pcb_pad +function hid_create ../packages/hid_ref.html#hid_create +function hid_add_attribute ../packages/hid_ref.html#hid_add_attribute +function hid_get_attribute ../packages/hid_ref.html#hid_get_attribute +function hid_register ../packages/hid_ref.html#hid_register +function hid_gpmi_data_set ../packages/hid_ref.html#hid_gpmi_data_set +function hid_gpmi_data_get ../packages/hid_ref.html#hid_gpmi_data_get +function hid_string2val ../packages/hid_ref.html#hid_string2val +enum layout_object_mask_e ../packages/layout_ref.html#layout_object_mask_e +enum layout_object_coord_e ../packages/layout_ref.html#layout_object_coord_e +enum layout_flag_e ../packages/layout_ref.html#layout_flag_e +enum layer_field_e ../packages/layout_ref.html#layer_field_e +function layout_search_box ../packages/layout_ref.html#layout_search_box +function layout_search_selected ../packages/layout_ref.html#layout_search_selected +function layout_search_found ../packages/layout_ref.html#layout_search_found +function layout_search_get ../packages/layout_ref.html#layout_search_get +function layout_search_free ../packages/layout_ref.html#layout_search_free +function layout_obj_coord ../packages/layout_ref.html#layout_obj_coord +function layout_obj_type ../packages/layout_ref.html#layout_obj_type +function layout_obj_move ../packages/layout_ref.html#layout_obj_move +function layout_arc_angles ../packages/layout_ref.html#layout_arc_angles +function layout_create_line ../packages/layout_ref.html#layout_create_line +function layout_create_via ../packages/layout_ref.html#layout_create_via +function layout_create_arc ../packages/layout_ref.html#layout_create_arc +function layout_switch_to_layer ../packages/layout_ref.html#layout_switch_to_layer +function layout_get_current_layer ../packages/layout_ref.html#layout_get_current_layer +function layout_resolve_layer ../packages/layout_ref.html#layout_resolve_layer +function layout_get_max_possible_layer ../packages/layout_ref.html#layout_get_max_possible_layer +function layout_get_max_copper_layer ../packages/layout_ref.html#layout_get_max_copper_layer +function layout_get_max_layer ../packages/layout_ref.html#layout_get_max_layer +function layout_layer_name ../packages/layout_ref.html#layout_layer_name +function layout_layer_color ../packages/layout_ref.html#layout_layer_color +function layout_layer_field ../packages/layout_ref.html#layout_layer_field +function layout_get_page_width ../packages/layout_ref.html#layout_get_page_width +function layout_get_page_height ../packages/layout_ref.html#layout_get_page_height +function layout_set_page_size ../packages/layout_ref.html#layout_set_page_size +function mil2pcb_multiplier ../packages/layout_ref.html#mil2pcb_multiplier +function mm2pcb_multiplier ../packages/layout_ref.html#mm2pcb_multiplier +function current_grid_unit ../packages/layout_ref.html#current_grid_unit +function debug_draw_request ../packages/layout_ref.html#debug_draw_request +function debug_draw_flush ../packages/layout_ref.html#debug_draw_flush +function debug_draw_finish ../packages/layout_ref.html#debug_draw_finish +function debug_draw_dctx ../packages/layout_ref.html#debug_draw_dctx +function draw_set_color ../packages/layout_ref.html#draw_set_color +function draw_set_line_width ../packages/layout_ref.html#draw_set_line_width +function draw_set_draw_xor ../packages/layout_ref.html#draw_set_draw_xor +function draw_set_draw_faded ../packages/layout_ref.html#draw_set_draw_faded +function draw_line ../packages/layout_ref.html#draw_line Index: trunk/doc/user/06_feature/gpmi/packages/actions.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/actions.html (nonexistent) +++ trunk/doc/user/06_feature/gpmi/packages/actions.html (revision 5594) @@ -0,0 +1,123 @@ + + +The actions package+ +The action package is used to register actions and menus in PCB and +to execute existing actions. In PCB actions +are generated when the user selects a menu, presses a key or issues a +command on the PCB command line. + +Registration of new actions+The script may register new actions +using arbitrary action names. If any of the registered actions is +detected, an ACTE_action event is sent to the script. If multiple +actions are used in a script, argument name of the event handler +can be used to identify the triggering action. (This may be time consuming +in scripting languages (a series of string comparison) - those scripts +binding to frequent actions should not bind to too many different actions.) +pcb-gpmi guarantees that the event handler of a script is triggered only +when an action is caught that previously was registered by the same script. ++The process of binding an action: +
+-- load the package +PkgLoad("pcb-gpmi/actions", 0); + +-- action callback +function ev_action(id, name, argc, x, y) + if name == "cake" then + size = action_arg(1); + -- put cake drawing code here + else + -- must be candy + amount = action_arg(1); + -- put candy drawing code here + end +end + +-- register and bind action +action_register("cake", "cake center xy?", "cake service", "cake(size)", ""); +action_register("candy", "candy cloud center xy?", "cake service", "candy(amount)", ""); +Bind("ACTE_action", "ev_action"); ++ +When the script is unloaded all actions the script registered +are removed from pcb-rnd automatically. + + Executing actions+An existing action can be executed using the action() call. The only one +argument is a command line string. The syntyax is the same as in pcb +command line. + +Example (written in lua): ++PkgLoad("pcb-rnd-gpmi/actions", 0); + +function ev_action1(id, name, argc, x, y) + action("undo()") + action("undo()") +end + +-- register and bind action +action_register("untwo", "", "undo twice", "untwo()", "CONTEXT!"); ++ +The above script registers a new action called untwo(). When untwo() is executed, +it exectues action undo() twice. + + + Creating menus+It is possible to insert menus and submenus runtime, using the call +create_menu(). The script should do this only after the gui has been initialized. +The most common way is to create all menus from the ACTE_gui_init event, +which is called after the gui finished setting up. ++The first argument of create_menu() is the menu path. The path is a list +of visible menu names separated by slashes (e.g. "/main_menu/File/Save as..." means +"File" menu, "Save as..." submenu). + +Paths are interpreted as menu paths, which are a slightly simplified version +of lihata paths found in menu.lht. Basically there's a main directory directly +under root that determines the type of the menu: + +
+The simplification compared to lihata paths is that only menu and submenu +names are on the path, so lihata nodes like "li:submenu" should be ignored. +In other words, the path represents how the menus can be reached from the user +interface, plus a "main menu type prefix" as discussed above. + +By convention, scripts should +create new menu items under the "/main_menu/Plugins/" menu. + +The following example lua script registers a new menu item + +PkgLoad("pcb-rnd-gpmi/actions", 0); + +function ev_gui_init(argc, argv) + create_menu("/main_menu/Plugins/foo", "undo()", "o", "Ctrl<Key>o", "tooltip for foo"); +end + +-- register and bind action +Bind("ACTE_gui_init", "ev_gui_init"); ++ +When the user clicks on the menu, the action script specified in the second argument +of create_menu() is executed. Thus the script usually registers a new action +first then registers one or more menu items executing those actions. + + + Index: trunk/doc/user/06_feature/gpmi/packages/actions_ref.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/actions_ref.html (nonexistent) +++ trunk/doc/user/06_feature/gpmi/packages/actions_ref.html (revision 5594) @@ -0,0 +1,82 @@ + + +PCB GPMI+Reference manual for package actions+Automatically generated from actions.h + +Events+
Events do not have return value. The first argument is always the even id. Event handlers defined in scripts get all event arguments converted to string (types below are informational).
+
+ Functions+
The following functions are registered in script context.
+
+ dialogs package+ The purpose of this package is to expose the dialog box handling interface + of the active GUI hid. Using this package scripts can pop up dialog boxes + to inform or ask the user. If there is no active GUI, call logs are dumped + on stderr. Note: message arguments usually may contain newline (\n) characters + to split the message. + +Common conventions+ Dialog boxes are blocking calls to the GUI HID: when the script + calls a dialog box, the script is suspended until the dialog box + is closed by the user. In other words, dialog boxes behave + as regular function calls from the scripts: when they return, + the dialog is over and the result is known. ++ The only exception is dialog_progress(), which opens or + updates or closes the already open progress dialog box, and + returns immediately (even when the box is left open). + + Simple dialogs vs. custom dialogs+ Most of the calls will pop up a static dialog box. Static means + that widgets are predefined by the GUI HID. The script + is free to fill in data, but can not change the basic structure of + the dialog box. For example dialog_confirm(), dialog_prompt(), + dialog_fileselect() are static. ++ When the script needs a custom, dynamic dialog box, it needs to + create an attribute dialog. The script sets up a HID + structure using the hid package, builds up all the input fields + then calls dialog_attribute() with the hid. + + Progress dialogs+ + The script should call dialog_progress() periodicly from a process that + runs time consuming calculations and check the return value and break + the loop on cancel. The process should have an idea of how long it + will take. This is passed on in argument total. As long as + argument so_far is less than total, the dialog is + open. ++ After the process has finished, a call with so_far=total+1 should be + made to make sure the window is closed. If the call returns non-zero, + the process should be cancelled. + + + Index: trunk/doc/user/06_feature/gpmi/packages/dialogs_ref.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/dialogs_ref.html (nonexistent) +++ trunk/doc/user/06_feature/gpmi/packages/dialogs_ref.html (revision 5594) @@ -0,0 +1,105 @@ + + +PCB GPMI+Reference manual for package dialogs+Automatically generated from dialogs.h + +Enums+
Enum values should be passed on as strings.
+
+
Functions+
The following functions are registered in script context.
+
+ event_id+ +The first argument passed to an event handler is always the event ID. +It is useful if there are several GPMI events with the same arguments and +the script wants to bind them all to the same event handler. In that case +using event_id the event handler can determine which event triggered the +call. This design is similar to the signal handler documented in +signal(2). + ++ +The case described above (dispatcher in the event handler) is rare. +Most users will bind one event to one function and can safely ignore this +argument. Nevertheless it must present as the first argument +on the event handler's argument list. + + + Index: trunk/doc/user/06_feature/gpmi/packages/hid.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/hid.html (nonexistent) +++ trunk/doc/user/06_feature/gpmi/packages/hid.html (revision 5594) @@ -0,0 +1,76 @@ + + +hid package+ +The hid package has two purposes: +
Building a custom dialog box+First hid_create() needs to be called. It returns a new hid_t, which is +an opaq structure for the package that is used to describe attributes of +an attribute dialog or an exporter hid. Attributes are added using +hid_add_attribute(), which returns an unique ID of the attribute. The +attribute ID can be used later for querying attribute value set by the +user using hid_get_attribute(). ++The process of building a dialog box is closed by a call to +
Registering an exporter+ Function hid_register() registers the hid as an exporter. Should be + called after all attributes have been added using hid_add_atrtibute(). + The export is coordinated by pcb core; when the user request an export + using the exporter, a series of events are delivered to the script: +
Envelope: events generated before or after exporting+
Drawing: events generated during exporting+ Note: there may be multiple gcs (graphic contexts), each having its own color, line + properties, xor drawing and faded state. Graphic contexts are created + and destroyed by the following events: +
PCB GPMI+Reference manual for package hid+Automatically generated from hid.h + +Enums+
Enum values should be passed on as strings.
+
+
EndCapStyle_e++ Line or arc ending style ++
Events+
Events do not have return value. The first argument is always the even id. Event handlers defined in scripts get all event arguments converted to string (types below are informational).
+
+ Functions+
The following functions are registered in script context.
+
+ layout package+ +Layout package searches and manipulates the current layout. Dimension units +are in nanometer unless otherwise mentioned. + +Page: board dimensions+ Functions used to query or set width and height of the drawing: +
Layer manipulation+Most functions perform operations similar to user commands affecting +the current layer. +The following few calls can change the current layer. Warning: this is the +same current layer as the user's; the script most probably wants to save +the current layer before changing it and then restore it after the operation. +
+ + Object searches+ Search results are collected on lists identified by their name (search_ID). + If a new search is done with the same name, old search results for that + name are discarded. + Search functions return the number of objects found (size of the list) that can + be then used while querying the results using layout_search_get(). + Results should be freed using layout_search_free() when they are no + longer needed. ++ TODO: validity of a list in time + +Once the search list is ready, the script can iterate over it and resolve +the object handle of each object found, using layout_search_get(). Having +an object handle, The layout_obj_*() functions may be used by the script +to access fields of an object structure. + + Create new objects+ The layour_create_*() calls are used to create new objects on the current + layer (set by layout_switch_to_layer()). + + +API reference - page, untis and coordinates+(angles are in radian) +TODO + +API reference - debug draw+TODO + + + Index: trunk/doc/user/06_feature/gpmi/packages/layout_ref.html =================================================================== --- trunk/doc/user/06_feature/gpmi/packages/layout_ref.html (nonexistent) +++ trunk/doc/user/06_feature/gpmi/packages/layout_ref.html (revision 5594) @@ -0,0 +1,305 @@ + + +PCB GPMI+Reference manual for package layout+Automatically generated from layout.h + +Enums+
Enum values should be passed on as strings.
+
+
layout_object_coord_e++ Which coordinate of the object is referenced ++
layout_flag_e++ of layout_object_coord_t ++
layer_field_e++ Field name of the layer structure ++
Functions+
The following functions are registered in script context.
+
+ +Create a function ev_action that will be called when any of +the actions registered by the script is executed. The script registers +only one action, so it does not need to check which action caused +the function to be called. + +When the action event is called, use dialog_log to append +a log message. + +In the "main" section of the script, bind event ACTE_action to +our local function ev_action - this gets ev_action to +be called when any of the actions registered by this script is executed. + +Finally use action_register to register the action: +
hello world (text, log)+Create a new action hello() that prints "Hello world!" in the message log. +Example implementations+awk + | +bash + | +lua + | +pl + | +py + | +rb + | +scm + | +stt + | +tcl +Explanation, step by step+Load packages the script depends on: +
Create a function +ev_action + that will be called when any of the actions registered by the script is executed. The script registers only one action, so it does not need to check which action caused the function to be called. + When the action event is called, use +dialog_log + to append a log message. + In the "main" section of the script, bind event +ACTE_action + to our local function +ev_action + - this gets +ev_action + to be called when any of the actions registered by this script is executed. + Finally use +action_register + to register the action: +
+Create a function ev_action that will be called when any of +the actions registered by the script is executed. The script registers +only one action, so it does not need to check which action caused +the function to be called. + +When the action event is called, use dialog_report to pop +up a report dialog. First argument donates the name (title) of the window, +the second is the text printed in the window. + +In the "main" section of the script, bind event ACTE_action to +our local function ev_action - this gets ev_action to +be called when any of the actions registered by this script is executed. + +Finally use action_register to register the action: +
hello world (popup window)+Create a new action hello() that prints "Hello world!" in a popup window. +Example implementations+awk + | +bash + | +lua + | +pl + | +py + | +rb + | +scm + | +stt + | +tcl +Explanation, step by step+Load packages the script depends on: +
Create a function +ev_action + that will be called when any of the actions registered by the script is executed. The script registers only one action, so it does not need to check which action caused the function to be called. + When the action event is called, use +dialog_report + to pop up a report dialog. First argument donates the name (title) of the window, the second is the text printed in the window. + In the "main" section of the script, bind event +ACTE_action + to our local function +ev_action + - this gets +ev_action + to be called when any of the actions registered by this script is executed. + Finally use +action_register + to register the action: +
+Create a function ev_action that will be called when any of +the actions registered by the script is executed. The script registers +only one action, so it does not need to check which action caused +the function to be called. + +When the action event is called, use dialog_report to pop +up a report dialog. First argument donates the name (title) of the window, +the second is the text printed in the window. + +Create a function ev_gui_init that will be called when the +gui has been initialized - this is the right moment to register +new menus in the GUI. Put the new menu item in the +"Plugins/GPMI scripting/" menu by convention, and set hot key to ctrl+w. +The menu should execute action hello(). + +In the "main" section of the script, bind event ACTE_action to +our local function ev_action - this gets ev_action to +be called when any of the actions registered by this script is executed. +Also bind ev_gui_init so that the new menu can be safely created. + +Finally use action_register to register the action: +
hello world (popup window + submenu)+Create a new action hello() that prints "Hello world!" in a popup window, create a menu (under "Plugins/GPMI scripting/") that executes the action. +Example implementations+awk + | +bash + | +lua + | +pl + | +py + | +rb + | +scm + | +stt + | +tcl +Explanation, step by step+Load packages the script depends on: +
Create a function +ev_action + that will be called when any of the actions registered by the script is executed. The script registers only one action, so it does not need to check which action caused the function to be called. + When the action event is called, use +dialog_report + to pop up a report dialog. First argument donates the name (title) of the window, the second is the text printed in the window. + Create a function +ev_gui_init + that will be called when the gui has been initialized - this is the right moment to register new menus in the GUI. Put the new menu item in the "Plugins/GPMI scripting/" menu by convention, and set hot key to ctrl+w. The menu should execute action hello(). + In the "main" section of the script, bind event +ACTE_action + to our local function +ev_action + - this gets +ev_action + to be called when any of the actions registered by this script is executed. Also bind ev_gui_init so that the new menu can be safely created. + Finally use +action_register + to register the action: +
+Create a function ev_action that will be called when any of +the actions registered by the script is executed. The script registers +only one action, so it does not need to check which action caused +the function to be called. + +When the action event is called, first set up: +
+ +In the "main" section of the script, bind event ACTE_action to +our local function ev_action - this gets ev_action to +be called when any of the actions registered by this script is executed. + +Finally use action_register to register the action: +
action: move selected objects+Create a new action mv(dx,dy) that moves selected objects relative by dx and dy mm. +Example implementations+awk + | +bash + | +lua + | +pl + | +py + | +rb + | +scm + | +stt + | +tcl +Explanation, step by step+Load packages the script depends on: +
Create a function +ev_action + that will be called when any of the actions registered by the script is executed. The script registers only one action, so it does not need to check which action caused the function to be called. + When the action event is called, first set up: +
In the "main" section of the script, bind event +ACTE_action + to our local function +ev_action + - this gets +ev_action + to be called when any of the actions registered by this script is executed. + Finally use +action_register + to register the action: +
+An exporter is sort of a drawing backend: pcb-rnd sets up graphic contexts +(gc for short) and draws on them. The first gc set up should open the +output file, the last gc closed should flush/close the file. + + + + Theory of operation+Assume only filled circles on the +top assembly layer are holes. Emit a line for each of these +and ignore everything else. + +Implementation+Load packages the script depends on: +
+Set up an exporter hid, storing the handle of each object created in +a global variable: +
+Set up global state variables: +
+Define a make_gc callback. It is called when a new graphic +context is created (e.g. for layers). An exporter is sort of a drawing +backend: pcb-rnd sets up gc's and draws on them. The first gc set up +should open the output file, the last gc closed should flush/close the file. +Define a destroy_gc callback for the latter. GCs are +destroyed at the end of the export process. Use global variable channel +to make sure the file is open/close only once (see TODO script context). + +Define a set_layer callback that sets green_light to true if +layer name is "topasssembly", false otherwise. + +Callback fill_circle is the workhorse: check if we have the green +light to emit lines, then convert coordinates and diameter to mm and +decide what format to use for printing a line for each filled circle. + +Finally, bind all four callbacks to exporter events. + + Index: trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.lua =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.lua (nonexistent) +++ trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.lua (revision 5594) @@ -0,0 +1,65 @@ +PkgLoad("pcb-rnd-gpmi/hid", 0) +PkgLoad("pcb-rnd-gpmi/layout", 0) +PkgLoad("pcb-rnd-gpmi/dialogs", 0) + +hid = hid_create("drill", "drill list export") +attr_path = hid_add_attribute(hid, "filename", "name of the output file", "HIDA_Path", 0, 0, "drill.txt") +attr_format = hid_add_attribute(hid, "format", "file format", "HIDA_Enum", 0, 0, "CSV|TSV|text") +hid_register(hid) + +fmt = 0 +conv = mm2pcb_multiplier() +channel = nil +green_light = 0 + +function make_gc(event_id, hid, gc) + if channel == nil + then + channel = io.open(hid_get_attribute(hid, attr_path), "w") + if channel == nil + then + dialog_report("Error exporting drill", "Could not open file [hid_get_attribute $hid $attr_path] for\nwriting, exporting drill failed.") + return + end + fmt = hid_get_attribute(hid, attr_format) + end +end + +function destroy_gc(event_id, hid, gc) + if channel ~= nil + then + channel:close() + channel = nil + end +end + +function set_layer_group(event_id, hid, group, layer, flags, empty) + if (layer_flag_is_set(flags, "LYT_ASSY") == "1") and (layer_flag_is_set(flags, "LYT_TOP") == "1") + then + green_light = 1 + else + green_light = 0 + end +end + +function fill_circle(event_id, hid, gc, cx, cy, r) + if green_light == 1 + then + cx = cx / conv + cy = cy / conv + local dia = r / conv * 2 + + if fmt == "CSV" then + channel:write(cx .. "," .. cy .. "," .. dia .. "\n") + elseif (fmt == "TSV") then + channel:write(cx .. "\t" .. cy .. "\t" .. dia .. "\n") + elseif (fmt == "text") then + channel:write(cx .. " " .. cy .. " " .. dia .. "\n") + end + end +end + +Bind("HIDE_make_gc", "make_gc") +Bind("HIDE_destroy_gc", "destroy_gc") +Bind("HIDE_set_layer_group", "set_layer_group") +Bind("HIDE_fill_circle", "fill_circle") Index: trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.tcl =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.tcl (nonexistent) +++ trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/ex.tcl (revision 5594) @@ -0,0 +1,65 @@ +PkgLoad pcb-rnd-gpmi/hid 0 +PkgLoad pcb-rnd-gpmi/layout 0 +PkgLoad pcb-rnd-gpmi/dialogs 0 + +set hid [hid_create "drill" "drill list export"] +set attr_path [hid_add_attribute $hid "filename" "name of the output file" "HIDA_Path" 0 0 "drill.txt"] +set attr_format [hid_add_attribute $hid "format" "file format" "HIDA_Enum" 0 0 "CSV|TSV|text"] +hid_register $hid + +set fmt 0 +set conv [mm2pcb_multiplier] +set channel -1 +set green_light 0 + +proc make_gc {event_id hid gc} { + global channel attr_path attr_format fmt + + if {$channel == -1} { + if {[catch {open [hid_get_attribute $hid $attr_path] "w"} channel]} { + dialog_report "Error exporting drill" "Could not open file [hid_get_attribute $hid $attr_path] for\nwriting, exporting drill failed." + return + } + set fmt [hid_get_attribute $hid $attr_format] + } +} + +proc destroy_gc {event_id hid gc} { + global channel + + if {$channel > -1} { + close $channel + set channel -1 + } +} + +proc set_layer_group {event_id hid group layer flags empty} { + global green_light + + if { [layer_flag_is_set $flags "LYT_ASSY"] && [layer_flag_is_set $flags "LYT_TOP"] } { set green_light 1; puts "!!!!!!!!!!!!!!!"} { set green_light 0 } +} + +proc fill_circle {event_id hid gc cx cy r} { + global channel conv fmt green_light + + if {$green_light} { + set cx [expr $cx / $conv] + set cy [expr $cy / $conv] + set dia [expr $r / $conv * 2] + + if {$fmt eq "CSV"} { + puts $channel "$cx,$cy,$dia" + } elseif {$fmt eq "TSV"} { + puts $channel "$cx $cy $dia" + } elseif {$fmt eq "text"} { + puts $channel "$cx $cy $dia" + } + } +} + +Bind HIDE_make_gc make_gc +Bind HIDE_destroy_gc destroy_gc +Bind HIDE_set_layer_group set_layer_group +Bind HIDE_fill_circle fill_circle + +puts "NA?" Index: trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/index.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/index.html (nonexistent) +++ trunk/doc/user/06_feature/gpmi/rosetta/35_export_drill/index.html (revision 5594) @@ -0,0 +1,71 @@ + + +<-- back to the index of Rosetta examples +drill list exporter+Create a new exporter that prints a list of drills in x,y,dia table in CSV, TSV or text format +Example implementations+awk + | +lua + | +tcl +Explanation, step by step+ + An exporter is a hid registered. During the export process, pcb-rnd calls the exporter to draw objects on layers. The GPMI layer converts these calls to bindable events. An exporter script catches the drawing events relevant to the output format and draws everything from event handlers. +An exporter is sort of a drawing backend: pcb-rnd sets up graphic contexts (gc for short) and draws on them. The first gc set up should open the output file, the last gc closed should flush/close the file. + + + Theory of operation+ Assume only +filled circles + on the +top assembly layer + are holes. Emit a line for each of these and ignore everything else. +Implementation+ Load packages the script depends on: +
Set up an exporter hid, storing the handle of each object created in a global variable: +
Set up global state variables: +
Define a +make_gc + callback. It is called when a new graphic context is created (e.g. for layers). An exporter is sort of a drawing backend: pcb-rnd sets up gc's and draws on them. The first gc set up should open the output file, the last gc closed should flush/close the file. Define a +destroy_gc + callback for the latter. GCs are destroyed at the end of the export process. Use global variable +channel + to make sure the file is open/close only once (see TODO +script context +). + Define a +set_layer + callback that sets green_light to true if layer name is "topasssembly", false otherwise. + Callback +fill_circle + is the workhorse: check if we have the green light to emit lines, then convert coordinates and diameter to mm and decide what format to use for printing a line for each filled circle. + Finally, bind all four callbacks to exporter events. Index: trunk/doc/user/06_feature/gpmi/rosetta/index.html =================================================================== --- trunk/doc/user/06_feature/gpmi/rosetta/index.html (nonexistent) +++ trunk/doc/user/06_feature/gpmi/rosetta/index.html (revision 5594) @@ -0,0 +1,58 @@ + + + +pcb-rnd scripting - Rosetta+The Rosetta Stone +of pcb-rnd scripting is a collection of example scripts implemented in +various scripting languages. Rosetta has multiple purposes: +
+Each example comes with an explanation, written in plain English about what the +scripts do, step by step. Instead of trying to exploit powerful features +of the language, example implementations try to be simple. + +The list below is ordered from the least complex to the most complex examples. +Column lvl is the complexity score. The less the score is, the simpler +the example is. + + + Index of examples+ + +
pcb-rnd scripting - Rosetta+The Rosetta Stone +of pcb-rnd scripting is a collection of example scripts implemented in +various scripting languages. Rosetta has multiple purposes: +
+Each example comes with an explanation, written in plain English about what the +scripts do, step by step. Instead of trying to exploit powerful features +of the language, example implementations try to be simple. + +The list below is ordered from the least complex to the most complex examples. +Column lvl is the complexity score. The less the score is, the simpler +the example is. + + + Index of examples+ +Scripting intro+This document is an introduction to GPMI for pcb-rnd users. It focuses on +scripting pcb-rnd and doesn't discusses GPMI deeper than the minimum necessary. +GPMI is more generic than shown here. ++The scope of the document is to describe the relations between pcb-rnd, +hids, GPMI, glue packages and scripts. Details on how specific glue +packages access pcb-rnd internals (or how those internals work) are +described in other documents. + + 1. pcb-rnd internals+ +Since scripts are glued to pcb-rnd internals, scripters need to know +the basic concepts of how pcb-rnd is structured. + + 1.1 pcb-rnd, HIDs, plugins and GPMI
+pcb-rnd consists of:
+ |
---|
+GPMI is a plugin/buildin HID. Instead of doing actual work, it loads scripts
+and provides a glue layer between pcb-rnd and the scripts. The actual work
+is performed by the scripts.
+The glue layer comes in two kinds:
+
|
+Each time a script needs to be loaded, first a module is loaded and the name
+of the script is passed to the module. During module initialization, the module
+sets up a script interpreter and script context and loads the script into the
+context.
+ +If there are 3 separate lua scripts running in pcb-rnd, there are 3 separate +lua modules loaded, each dealing with one of the scripts. The process of +loading a script is illustrated by highlighting the relevant paths with red +for step 1 and green for step 2. + +Step 0: the GPMI HID finds a script has to be loaded. The idea comes +from the config file (pcb-rnd-gpmi.conf) or from the GUI (manage scripts) +or as a request from a script already loaded. + +Step 1: the GPMI HID loads the corresponding module which in turns +loads the script. The script has a "main" part that is run on load. For +most languages this is the global code sections; in some languages it is +a specific function, usually called main. A few basic glue packages +are already loaded before the script. + +Step 2: the script can load glue packages. This usually happens +from the on-load main part from the script. The actual mechanism is to +call PkgLoad() from a glue package that was automatically loaded in +Step 1. The green arrows represent this path: the script executes PkgLoad() +which in turns loads other package(s) into the GPMI hid. + +Packages are loaded only once and are globally accessible for multiple modules. + |
+Binding an event in a script is done by calling the Bind() function
+(this is implemented in a package automatically loaded). The first
+argument is the name of the event, the second argument is the name of
+the script function that should be called when the event is triggered. Both
+arguments are strings. The event binding mechanism is shown in red in the
+map to the right.
+ +The script can create new actions using the action_register() function +(the actions package needs to be loaded first). A script may register multiple +actions. This call is marked with green in the above map. +If any of the actions registered by the script is called, the event "ACTE_action" +is generated. This has two implications: +
|
+Menus are created using the create_menu() call. Menus can be
+created only when the GUI is already set up - this may happen only
+after some of the scripts are already loaded. Thus scripts shall
+create menus from an event handler bound to the ACTE_gui_init event.
+This event is triggered right after the GUI has been set up.
+On the map to the right the red arrows represent the path of ACTE_gui_init;
+the green arrows represent the reaction of the script, creating the new
+menu.
+ + |
+Exporter scripts first have to set up an exporter hid. This typically
+happens from their on-load main part. Related calls are in the hid
+package. The following map shows this process with red arrows:
+ +When the user chooses to use the exporter, among the green arrows, +a series of events are triggered and the script can generate output +directly to a file from event handlers bound to these exporting events. + |
+If gpmi is a plugin, gpmi_plugin.so (or gpmi_plugin.dll) needs to be +copied in one of the plugin directories pcb-rnd is looking into on startup: +
path | purpose + |
---|---|
+ | |
$prefix/lib/pcb-rnd/plugins/$arch/ | system plugins, multihost + |
$prefix/lib/pcb-rnd/plugins/ | system plugins + |
~/.pcb/plugins/$arch/ | user plugins, multihost + |
~/.pcb/plugins/ | user plugins + |
./plugins/$arch/ | project plugins, multihost + |
./plugins/ | project plugins + |
+Script load lines contain two words separated by a space: a module name +and a script name. Relative paths in the the script name are relative to +the directory the config file is found in. +
+Example config: +
+# load the carc script (written in lua) from next to the config file: +lua carc.lua + +# load foo.awk, whcih is a mawk script, from its installation path +mawk /usr/lib/foo/foo.awk +Index: trunk/doc/user/06_feature/gpmi/util/Makefile =================================================================== --- trunk/doc/user/06_feature/gpmi/util/Makefile (nonexistent) +++ trunk/doc/user/06_feature/gpmi/util/Makefile (revision 5594) @@ -0,0 +1 @@ +all: Index: trunk/doc/user/06_feature/gpmi/util/rosetta_genpages.sh =================================================================== --- trunk/doc/user/06_feature/gpmi/util/rosetta_genpages.sh (nonexistent) +++ trunk/doc/user/06_feature/gpmi/util/rosetta_genpages.sh (revision 5594) @@ -0,0 +1,171 @@ +#!/bin/sh + +clean_id() +{ + tr "\r\n" "~" | sed ' +s/~*$//; +s/|/\&pipe;/g; +s/&/\&/g; +s/\</g; +s/>/\>/g; +s/"/\"/g; +s/'\''/\'/g; +s/~\+/
lvl | example | languages | description" + v = split(names, N, "[|]") + for(n = 1; n <= v; n++) { + name = N[n] + level = name + sub("_.*", "", level) + if (level ~ "[^0-9]") + level = "n/a" + print " |
---|---|---|---|
" level + print " | " DATA[name, "name"] "" + print " | " DATA[name, "scripts"] + print " | " DATA[name, "desc"] + } + print " |