Index: 1.1.4/configure
===================================================================
--- 1.1.4/configure (revision 10776)
+++ 1.1.4/configure (nonexistent)
@@ -1,4 +0,0 @@
-#!/bin/sh
-cd scconfig
-make
-./configure "$@"
Property changes on: 1.1.4/configure
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: 1.1.4/AUTHORS
===================================================================
--- 1.1.4/AUTHORS (revision 10776)
+++ 1.1.4/AUTHORS (nonexistent)
@@ -1,13 +0,0 @@
-pcb-rnd maintainer: Tibor 'Igor2' Palinkas
-email: pcb-rnd (at) igor2.repo.hu
-Chat, IRC: http://repo.hu/projects/pcb-rnd/irc.html
-
-An always up-to-date list of developers and contributors can be found at
-http://repo.hu/cgi-bin/pcb-rnd-people.cgi
-
-PCB was originally written by Thomas Nau
-Development was later taken over by harry eaton
-The port to GTK was done by Bill Wilson
-Dan McMahill converted the build system from imake to autoconf/automake.
-DJ Delorie wrote the trace optimizer, added symbolic flag support and
-many other improvements.
Index: 1.1.4/doc-rnd/news.html
===================================================================
--- 1.1.4/doc-rnd/news.html (revision 10776)
+++ 1.1.4/doc-rnd/news.html (nonexistent)
@@ -1,53 +0,0 @@
-
-
- We have a new main page reflecting the transition how we regard pcb-rnd:
- it is not much of just a fork of geda/pcb by now, but a separate PCB
- editor with its own team and own course. File save/load compatibility is
- maintained.
-
-
-
- 2016-08-24
-
- Release 1.1.1
-
- Available at the download page .
-
- The next development cycle will focus on editable/searchable attributes
- and a new native file format.
-
-
I'm normally online as Igor2 between 5:00 CET and 19:00 CET; on Sunday there's an AFK-window between 11:00 CET and 16:00 CET. If I don't answer in a few minutes I'm probably away doing something, please be patient; say hi before you type your long question so you see if I'm available.
-
-
-Below is an iframe of
-kiwiirc irc client configured with the above settings. If it doesn't
-work, please visit their page and
-try to manually configure it, it's just 4 fields.
-
-Using the web client: you may change your nickname; there's no password
-or registration or channel key or ssl of any form. Your real IP won't be
-shown on the IRC network (check kiwiirc's page about thier privacy
-policy).
-
-Connecting with the web client may take some time, give it a minute.
-
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.
-
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.
-
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.
-
-
-Non-scalar settings are arrays or lists. Arrays can be explicitly indexed
-
-The default policy is always overwrite.
-
-There are three active policies: overwrite, prepend and append.
-When dealing with lists:
-
-
step 1: the output list is reset to empty
-
step 2: all sources that describe the list are sorted by priority
-
step 3: sources are applied in order
-
-Step 3 is straight-forward: if policy is overwrite, reset the output
-list and copy the source's list into the output list. If policy is
-prepend (or append), keep the current output list and prepend
-(or append) the list provided by the source.
-
-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.
-
-
examples
-
-
simple overwrite
-Config sources (ordered by priority):
-
-
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.
-
-
empty overwrite
-Config sources (ordered by priority):
-
-
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
-
-
-
prepend
-Config sources (ordered by priority):
-
-
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.
-
-
append
-Config sources (ordered by priority):
-
-
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.
-
-
-
-The original settings and HID attribute system in pcb were both flat:
-basically a list of type:key=val triplets. All settings in a few big bags;
-which bag sometimes doesn't depend on some logical categorizing, but
-historical reasons (e.g. which part of the code needs the given setting).
-
-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.
-
-
pcb-rnd config tree
-The config tree, the full tree is, something that exists in memory. Actual
-config files often contain only a subset of the tree. Multiple config files
-(e.g. system level, user level, settings from the .pcb file) are loaded and
-merged to form the final config tree. The hierarchy of the tree is represented
-by setting groups, which are like directories on a file system. Actual settings
-are always leaves of the tree, placed in a specific group at any level (just
-like in file systems). A full path to a setting is written like a
-path on a file system: group1/group2/item, where group1 and group2 are
-names of setting groups and item is the name of the setting. Note: unlike
-with real file systems, the leading slash (representing the root) is omitted.
-
-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.
-
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
-
-
-
-
dynamic subtrees
-
-The plugins/ and utils/ subtree are dynamic, which means their contents
-are not defined by core pcb.
-
-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.
-
-
what happens to all these settings
-
-After loading all config files they are merged: if the same setting is
-described in multiple files, the higher priority wins or if the setting is
-a list (e.g. library search paths) the items are merged in a final list.
-At this point the full logical config tree is built. Next the textual values
-from the logical tree are converted into binary (native C values like
-"long int" or "double") and are saved in C variables for the code to
-access them directly.
-
Index: 1.1.4/doc-rnd/conf/sources.html
===================================================================
--- 1.1.4/doc-rnd/conf/sources.html (revision 10776)
+++ 1.1.4/doc-rnd/conf/sources.html (nonexistent)
@@ -1,72 +0,0 @@
-
-
-
The new config system in pcb-rnd
-
Sources
-There are different sources of configuration settings. These are
-different configuration files, sometimes located on the file system.
-The full list of config sources is:
-
-
-
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: 1.1.4/doc-rnd/conf/plugin_chk.html
===================================================================
--- 1.1.4/doc-rnd/conf/plugin_chk.html (revision 10776)
+++ 1.1.4/doc-rnd/conf/plugin_chk.html (nonexistent)
@@ -1,7 +0,0 @@
-
-
-
-This document describes the old situation, focusing on drawbacks for
-a purpose: to give a hint on why some of the design decisions are made
-the way they are, in the new conf system.
-
-
Settings, preferences, colors, and...
-The core implemented a so called Settings. It was a flat list of items,
-each bound to a C variable. There was a bunch of metadata attached to
-the items: name, type, description. Generic code could query or change
-the value of any setting, the C code could read and write them directly
-too. The content is saved to ~/.pcb/settings.
-
-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:
-
-
HID attributes: another way to describe name-type-metadata lists; this
- was used to pass on some rc-like parameters to the GUI HIDs. It's also the
- main API to describe export parameters for the export HIDs. However,
- HID attributes is not well suited for saving plugin (or HID) user
- preferences, it is more about a per action configuration.
-
-
The gtk HID also saved its own settings to a separate file called
- ~/.pcb/preferences.
-
-
Some gtk HID settings didn't quiet fit in the preferences - the color
- scheme can be saved in another file, usually under ~/.pcb/colors
-
-
A random plugin could either use the HID attributes to get a limited
- service or like the gtk HID did, had to implement its own save-restore of
- persistent settings.
-
-
-
Meta-drawbacks
-This also introduced a more subtle drawback: the configuration was now
-scattered into different files, randomly (looking from the
-user's point of view). In other words, the actual structure did not reflect
-some logical grouping, but mostly historical or source code organizational
-reasons.
-
-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: 1.1.4/doc-rnd/conf/index_user.html
===================================================================
--- 1.1.4/doc-rnd/conf/index_user.html (revision 10776)
+++ 1.1.4/doc-rnd/conf/index_user.html (nonexistent)
@@ -1,92 +0,0 @@
-
-
-
The new config system in pcb-rnd
-
User documentation
-As of 1.1.0, pcb-rnd switched to a lihata based configuration system.
-The purpose of this document is to describes the basic system design going into
-enough details to provide the user with full control over the configuration.
-The other side, how the system is implemented is described in the
- programmer's manual and there is also a
-checklist to assist plugin programmers.
-
-
Architecture: data flows, merging, dispatching
-The final configuration is a collection of values for
- all known settings, arranged in a tree. The config
-tree is a theoretical concept; different representations of the tree are
-actually built runtime, in-memory. Pcb-rnd code, plugins and utilities
-are constantly reading these in-memory representations to decide how to
-carry out their tasks.
-
-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:
-
-
first merge all the role treesinto a flat list; this determines the value of each setting;
-
then dispatch the values to the right component of the code.
-
-Some components may change some of the settings run-time. The trivial example
-is the GUI (hid_gtk on this diagram) that provides menus and dialog boxes for
-the user to change settings. Such a change is always fed back (blue arrow)
-to the design role tree directly, from where the new value is again merged
-and dispatched along the red arrows. Changes in the design role are saved
-with the .pcb file (thus the bidirectional black arrow between the source and
-the in-memory tree for the design role). Occassionally the user wants to
-save parts of the setting as a project setting or
-as an user setting - in this case, along the dashed blue lines, the
-corresponding project or user roles are modified. This again results in updating
-the hash and the binary representation; these roles also have
-bidirectional black arrows and their changes are also saved in the original
-source.
-
-
Merge details
-In the new system it is up to the user to decide what settings are
-system-level and what settings are user- or project-level. This is possible
-because any source can define any setting. In the merging step (red arrows
-between roles and the hash) it may turn out that there are overlaps (multiple
-sources defining value for the same setting) or blind spots (no source
-sets a given item).
-
-
overlaps
-Each setting in each source has a prioirty. The
-priority can be defined in the source, or if it is not defined, each source
-inherits a fallback default priority. The fallback is designed to provide
-the intuitive order: cli > design > project > user > system.
-
-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.
-
-
blind spots
-At the end the code does need a value for each setting, so in the final
-render (after the hash) every setting must have a value. To avoid blind spots,
-values not initialized, there is a built-in configuration file, compiled into
-the executable. This file is loaded into role CFR_INTERNAL, and has
-the lowest priority. This configuration file contains the default value for
-all settings.
-
Index: 1.1.4/doc-rnd/conf/syntax.html
===================================================================
--- 1.1.4/doc-rnd/conf/syntax.html (revision 10776)
+++ 1.1.4/doc-rnd/conf/syntax.html (nonexistent)
@@ -1,45 +0,0 @@
-
-
-
The new config system in pcb-rnd
-
Config file syntax
-
-The config file sytnax is lihata.
-Most users don't need to understand most of the syntax, just follow the
-patterns seen in the examples. A few thumb of rules:
-
-
srtuctural nodes usually start with a ha: or li: prefix; which one needs to be used is pretty much tied to the node name; thus casual users don't need to care about what they are for, just remember them as part of the name
-
non-structural nodes are usually given in the form of name = value; use braces around the value if it contains any non-alphanumeric, non-whitespace character
-
list and array members should better be braced
-
list and array separator should be semicolon (not comma)
-
-
-
config root syntax
-
-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.
-
-The old config system had several limitations that would have been
-hard to fix keeping the original design:
-
-
config settings were specified in a flat list - no grouping
-
the core had a rather static system - HIDs or plugins couldn't extend it, thus they had to invent their own config files
-
... this led to a variety of configuration formats; using one format not always because it was better suited for the task, but for historical reasons
-
... this also led to a collection of config files - again not always split by boundaries of settings, but often by arbitrary boundaries of code
-
the old system didn't support lists or arrays well
-
it didn't have a coherent concept of how settings from different sources would override eachother
-
... this resulted in the rigid structure that most of the settings could come from only one place (e.g. if it's an user setting, the design won't be able to override it)
-
... a config file can overwrite a list or prepend/append to it (e.g. design-level config prepending an extra library path keeping system set paths as well)
-
there are different sources of configuration, e.g. system-wise, user-wise, project-wise, etc.
-
the user has the power to change default config priorty per setting; e.g. normally design config overrides user config, but it's possible to mark a setting from user config so strong that it overrides even the setting read from the .pcb file
-
the way settings are stored is flexible and extensible so that a plugin can define their subtree of settings
-
... since the API even makes it easier to access such settings (vs. parsing your own config file), plugins will tend to use the unified config format/system instead of inventing teir own
-
... the GUI (gtk's preferences dialog) thus can automatically handle the new settings
-
... plugins don't have to implement actions to set/toggle/query their settings for the menu system, there are generic config set/toggle/query actions the menu config can use
-
-Hopefully not much. There are a few extra features, like
-multiple sources with levels that did not
-exist in pcb and lists with prepend/append. Some of these
-features present in other software so users should be comfortable with the ideas.
-The learning curve is probably compensated by the more orthogonal system.
-The syntax is also geared for simplicity and easy use with text editors.
-Finally, the new preferences dialog in the GTK HID and config actions help
-the user to explore how settings got used from all the config sources. There's
-an intended layering in complexity: simple things can be done easily without
-having to understand the whole system.
-
-All in all, the extra features the user needs to learn is comparable with
-the old customs that he/she can forget.
-
-
And did it make the code more complicated?
-The size of the code did not change much after the initial config rewrite.
-The new system has new features, some of which brought in a few hundred lines of
-code, but a similar amount of old code could be removed. What came in is
-infrastructure, what had to go was a bunch of repetitive config parsing,
-boolean-setting-accessor-action code. This means on the long run, the more
-settings are added, the more the new system pays back.
-
-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.
-
-
-
Compatibility with mainline
-
-None. The new configuration system uses a new logical structure, new file
-format, new locations on the file system. Most setting names are the same
-or very similar to the old ones. Some settings are renamed for clarity:
-clearance is always called clearance, on the UI, in the code and in
-config files as well (mainline pcb sometimes call it keepaway).The new,
-tree-based logics adds a twist too: full names of settings are paths.
-
-
-
-Since configuration is stored in new files, pcb-rnd settings do not interfere
-with pcb settings on any level.
-
-
-
Index: 1.1.4/doc-rnd/conf/merging.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/conf/merging.png
===================================================================
--- 1.1.4/doc-rnd/conf/merging.png (revision 10776)
+++ 1.1.4/doc-rnd/conf/merging.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/conf/merging.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/conf/scalars.html
===================================================================
--- 1.1.4/doc-rnd/conf/scalars.html (revision 10776)
+++ 1.1.4/doc-rnd/conf/scalars.html (nonexistent)
@@ -1,56 +0,0 @@
-
-
-
The new config system in pcb-rnd
-
Scalars
-
-Scalar settings have only one value after the merge. The only policy
-available is overwrite - this policy is applied regardless of the
-current policy setting.
-
-
examples
-
-
simple overwrite
-Config sources:
-
-
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.
-
-
user-forced value
-Config sources append:
-
-
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: 1.1.4/doc-rnd/conf/prio.html
===================================================================
--- 1.1.4/doc-rnd/conf/prio.html (revision 10776)
+++ 1.1.4/doc-rnd/conf/prio.html (nonexistent)
@@ -1,22 +0,0 @@
-
-
-
The new config system in pcb-rnd
-
Priorities
-
-Priority is an integer property of each config root.
-Syntax-wise it is part of the name of the config
-root. In the lihata config file it is either specified or omitted. When
-omitted, a role dependent default value is
-used. The default values are chosen in an intuitive way, thus most
-commonly the priority value is omitted.
-
-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: 1.1.4/doc-rnd/logo32.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/logo32.png
===================================================================
--- 1.1.4/doc-rnd/logo32.png (revision 10776)
+++ 1.1.4/doc-rnd/logo32.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/logo32.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/logo16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/logo16.png
===================================================================
--- 1.1.4/doc-rnd/logo16.png (revision 10776)
+++ 1.1.4/doc-rnd/logo16.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/logo16.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/help.html
===================================================================
--- 1.1.4/doc-rnd/help.html (revision 10776)
+++ 1.1.4/doc-rnd/help.html (nonexistent)
@@ -1,62 +0,0 @@
-
-
-The project is looking for volunteers for the features listed below. If
-you want to contribute, you will need to have an svn client and an email
-client. Furthermore an IRC client is strongly recommended.
-
-You will become part of the team and get svn commit right immediately
-when you start working.
-
-Don't have much free time? Don't worry: the tasks below are split up in
-very small (1..2 hours) chunks. Coordination is granted, the administrative
-overhead is almost zero - you can focus on the task, and finish it whenever
-you have a free hour.
-
-Worrying about your contribution to go in /dev/null? Don't: pcb-rnd
-has very short loops; you start contributing and get immediate feedback. Your
-work is part of the official thing immediately and revised and accepted (or
-rarely refused) within hours or at most days.
-There are no bitrotting branches.
-
-You are not confident enough with your skills? pcb-rnd is an optimal
-project for learning. If you start contributing, you get support. There
-are small and simple entry level tasks. Most of the tasks don't require
-any programming skills.
-
-Sign up: mail to pcb-rnd (at) igor2.repo.hu .
-If you want to work on a feature not listed below, feel free to drop me
-a mail.
-
-
-
ID
skill required
description
-
tutorial
geda user
tutorial projects
-
windows
geda user
generic testing on windows
-
mtest
geda user
systematic manual testing
-
doc
geda user, html
write sections of user documentation
-
logo
designer
the official pcb-rnd logo
-
banner
designer
pcb-rnd banner for the homepage
-
icons
designer
icons, other graphical elements for the GTK HID
-
css
designer
CSS for the homepage (only design/style, no content).
-
-I use PCB a lot on various computers. I used to try to join the mainstream
-development with small contribution (minor patches) and was active on
-IRC and the mailing lists for a while. However, it didn't work out well,
-and:
-
-
PCB already knew 95% of everything I'd ever need years ago
-
the remaining 5% was not on the TODO list of developers and generally no one shown much interest in getting patches for those
-
meanwhile a lot of new features have been added, from which most I find totally useless:
-
-
dbus
-
gl - transparency makes even simple 2 sided boards unusable; slower than the classic version sw render on all my computers
-
preparation for a C++ transition
-
3d support in core (I believe communication to 3d cad programs should be via exporter plugins)
-
-
the official Debian package enables (requires, depends on) both dbus and gl
-
DVCS - it almost always results in chaos, and has no benefit for such a small group of developers; there are posts from time to time on the mailing list about how to handle the chaos; my choice is to stick with a simple, centralized version control system
-
DVCS always results in increased administration, which I hate to spend my time on - I'd rather invest the time in bugfixing, documentation or implementing new features
-
it's nearly impossible to get small patches applied^1:
-
-
often no one has the time to revise and commit them
-
communication requires web2.0 (lp)
-
there are too many cycles of "please fix this and change that first"
-
with the chaos VCS, it's too likely that new feature patches would require ongoing maintenance while sitting in a "feature branch", to avoid that a large scale merge (or rebase, whatever) breaks it when it finally hits the official branch
-
there are too much pondering and too less prototyping; there are features that are being considered for years (for example back annotation, internal connections) with multiple concurrent ideas, but no code. Instead, I'd like to implement some code from the early phase of the idea, test it, and deprecate it if it didn't work out well.
-
I wouldn't even dream about getting larger patches in the official release
-
-
no stable release for years; maintaining a set of patches (like pcb-gpmi) and porting them to new releases is too much hassle
-
-I was pondering a fork for years. The trigger was that one day I've upgraded
-Debian on my lab computer and the new version of PCB came with gl enabled; this
-made PCB absolutely unusable (had to wait like 10 seconds for a scroll) while
-all the transparent polys over traces made the whole screen a mess. I should
-have recompiled everything and built a new Debian package with gl disabled or
-install from source (but I have too many computers for that). My decision
-was to set up my own .deb but then build it from a fork (it's not much of
-an extra effort), so I can add some of the features I miss in daily use.
-My plans with this fork:
-
-
I stick with my fork and will use it on all my computers for all my designs
-
Because of that, there's no emphasis on keeping the file formats compatible - breaking compatibility is not a goal either; as long as mainline doesn't change the format, pcb-rnd is about 98% compatible (the 2% is where pcb-rnd features are not supported by mainline)
-
I won't actively seek ways to get my changes into the mainstream; I will keep on using my svn repo in a manner that (as a side effect) makes such merges easier, tho. If PCB developers decide to pick them up from svn and merge them in the official repo, it's fine (but I personally will keep using my fork anyway).
-
Most probably I won't merge anything back from the mainstream to my fork - the past few years showed that it's unlikely there would be new features I'd need
-
1206 jumpers without having to add them on the schematics/netlist (done: [intconn] and [nonetlist] are the PCB-side features for this)
-
merge pcb-gpmi; GPMI would be an optional addon, it'd probably stay a plugin, but there should not be a separate repo ( done )
-
-
-
-Footnotes:
-
-
^1: this may have changed lately and pcb developers are more open to newcomers; there seems to be a shortage of developers tho, which still makes it slow to get bigger patches through
-
-
-
Phase 2: major cleanups (2015..2016)
-In the first phase I was mostly implementing a set of small features and fixes.
-As I got more familiar with the code base, I decided to bite the bullet and
-do some refactoring:
-
-
replaced the footprint mapping/loading code; instead of a hardwired m4 dependency, parametric (generated-on-the-fly) footprints can be written in any language
-
replaced the default footprint library shipped with the software; the new library ships a small, well organized collection of essentials, omitting special/rarely used footprints
-
threw out the resource parser and file format (manu.res and friends) in favor of lihata; this removed a lot of code duplication and a strangely designed resource tree data structure I really hated; as a side effect the gtk hid has multi-stroke hotkeys
-
replaced glib with a set of mini libs in core and most of the plugins; at the end only the gtk hid should depend on glib; this made the code easier to maintain and debug; a lot of checks are now compile-time (through the C type system) instead of runtime (glib lists)
-
replaced the settings/rc/preferences system with a central, lihata based configuration system - long term hid attributes will be converted too
-
-
-Plans for the future includes:
-
-
turning most of the core code into a library for external tools to reuse
-
extending the core to provide an infrastructure for composite objects handled by plugins
-
support for saving and loading pcb and footprint files in the lihata format
-
plans for a set of smallish features that can be implemented in a weekend or two each.
-
-
-
Phase 3: community requested features (from 2016 onward)
-Overlapping phase 2 there is an ongoing
- feature poll . If there
-are enough active users/testers for a feature, it gets implemented in
-phase 3.
-
-There is a small, active, constructive community forming around pcb-rnd. Future
-directions will be mainly set by their need.
-
-
-
Index: 1.1.4/doc-rnd/Autostyle.html
===================================================================
--- 1.1.4/doc-rnd/Autostyle.html (revision 10776)
+++ 1.1.4/doc-rnd/Autostyle.html (nonexistent)
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
Index: 1.1.4/doc-rnd/UNIX.txt
===================================================================
--- 1.1.4/doc-rnd/UNIX.txt (revision 10776)
+++ 1.1.4/doc-rnd/UNIX.txt (nonexistent)
@@ -1,31 +0,0 @@
-State on UNIX systems
-~~~~~~~~~~~~~~~~~~~~~
-
-Source releases starting from 1.1.2 should compile and run out-of-the-box
-on old UNIX systems, such as IRIX. Does NOT require any GNU installed.
-
-Requirements:
- - x11 and motif (for the GUI)
- - an awk implementation that supports gsub(), e.g. nawk
-
-1. If your C compiler does not support #warning, run a script to patch
- the source:
-
- # cwd is the root of the distribution
- util/workarounds/unwarn_all.sh
-
- This will take a while and will modify a lot of .c files.
-
-2. ./configure
-
-3. make
-
-Considerations listed in ../INSTALL apply.
-
-The above procedure has been tested on IRIX 5.3 on IP22.
-
-Expected compilation times [minute:second]:
-
-./configure compile, -O0 compile -O3 system
--------------------------------------------------------------------------------
-1:55 7:40 14:27 IRIX 5.3, IP22 @ 100 MHz
Index: 1.1.4/doc-rnd/packaging.txt
===================================================================
--- 1.1.4/doc-rnd/packaging.txt (revision 10776)
+++ 1.1.4/doc-rnd/packaging.txt (nonexistent)
@@ -1,90 +0,0 @@
-Packaging pcb-rnd for a distribution
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-1. program, libs, desktop integration
-
-Pcb-rnd is an interactive printed circuit board editor program. A typical
-user is an electric engineer. This sort of programs are often called EDA,
-Electronics Design Automation.
-
-Pcb-rnd has different frontends: graphical and stdio/text based batch
-processing. There are different graphical frontends - pcb-rnd does not
-depend on gtk or motif, the specific frontend modules may depend on them.
-
-Pcb-rnd is scriptable if libgpmi is available. Since libgpmi is not
-a mainstream library for the scripting feature it should also be packaged.
-
-Pcb-rnd is intended for UNIX-fans. It is heavily keyboard-oriented and it
-doesn't assume its users don't want to understand or learn how it works.
-Many typical user workflows include Makefiles and it's a common thing to
-start pcb-rnd from a shell. Thus desktop integration is not in focus
-at the moment. If you fixed things for this while packaging, please let
-us know, we may merge your patches (see below).
-
-2. options, plugins, dependencies
-
-Pcb-rnd is a modular software with a lot of options. Majority of these options
-are selected by the state of a module. A module has three states:
- - disable: (not compiled at all)
- - buildin: enabled and static linked
- - plugin: enabled and dynamic loaded (from a .so)
-
-The configure script takes --disable-*, --building-* and --plugin-*
-arguments with * substituted with the name of the module. The configure
-script also determines the dependencies according to the selection. Special
-arguments --all=plugin and --all=buildin are provided in configure to select
-all working modules to be plugins or buildins.
-
-For binary distributions it's strongly recommended to have most of the
-modules compiled as plugins and have them in separate packages. This
-would let the user to install a core pcb-rnd package and then the GTK
-or the lesstif plugin (or both) from separate packages. This also reduces
-package dependencies.
-
-This is less relevant for source distributions, if the user has full control
-over the configuration.
-
-If non-critical dependencies are not met, modules are automatically disabled
-by ./configure.
-
-3. typical ./configure options - scconfig vs. auto*
-
-./configurfe --prefix works as expected. DESTDIR is called install_root.
-
-Typical commands for configuring pcb-rnd for packaging would be:
-
- ./configure --all=plugin --prefix=/usr
- make all
- install_root=/tmp/pkg_tmp make install
-
-We are happy with scconfig. Please don't write about how much better
-autoconf or cmake would be, we won't switch.
-
-4. release cycles, tarballs, svn trunk - what to package
-
-Development happens in svn trunk/, there are usually no branches. While
-we try to keep trunk/ compilable any time, it's not guaranteed that it
-would work out-of-the-box between releases. It is not recommended to
-package trunk/ - please package stable releases instead.
-
-We follow the "release early, release often" rule. Source release tarballs
-are always considered stable. Beside the project web page, releases are
-also accessible as svn tags: svn://repo.hu/pcb-rnd/tags .
-
-Sometimes we have minor releases with 1..2 month period, sometimes a
-longer period passes between releases.
-
-There's no automated release notification at the moment; if you want to
-get notified about new releases, please contact me (email
-pcb-rnd (at) igor2.repo.hu)
-
-5. bug reporting and fixes for packaging
-
-There's no special method for reporting packaging related bugs and
-feature requests, please follow the normal bug report instructions or just
-drop me a mail. Please mention that the issue is related to packaging, this
-usually gives it a higher priority.
-
-We are willing to make minor changes to make packaging easier - if you bump
-into something you'd need to work around while packaging, please let us know,
-we may just fix it "upstream".
-
Index: 1.1.4/doc-rnd/mods/gen.sh
===================================================================
--- 1.1.4/doc-rnd/mods/gen.sh (revision 10776)
+++ 1.1.4/doc-rnd/mods/gen.sh (nonexistent)
@@ -1,128 +0,0 @@
-#!/bin/sh
-
-path=../../src_plugins
-
-sloc()
-{
- (cd "$1" && sloccount .) | awk '/^Total Phys/ { size=$9; sub(",", "", size); print size }'
-}
-
-gen_pie()
-{
- local bn=$1 code_size=$2 color=$3
- echo ""
- echo "@slice"
- echo "$code_size"
- echo "@label"
- echo "$bn ($code_size)"
- if test ! -z "$color"
- then
- echo "@color"
- echo "$color"
- fi
-}
-
-echo "#autogenerated by gen.sh" > mods.pie
-echo "#autogenerated by gen.sh" > after.pie
-
-echo HIDs >&2
-code_size=`sloc ../../src/hid`
-gen_pie "HIDs" $code_size "orangered" >> after.pie
-
-echo Core >&2
-tmp=/tmp/pcb-mods-stat
-mkdir $tmp
-cp -r ../../src/*.c ../../src/*.h ../../src/Makefile* $tmp
-code_size=`sloc $tmp`
-gen_pie "core" $code_size "#00ff88" >> after.pie
-
-#echo 3rd >&2
-#code_size=`sloc ../../src_3rd`
-#gen_pie "3rd" $code_size >> after.pie
-
-
-(
-cat pre.html
-for n in $path/*
-do
- if test -d "$n"
- then
- echo $n >&2
- bn=`basename $n`
- code_size=`sloc $n`
- total=$(($total + $code_size))
- gen_pie $bn $code_size >> mods.pie
-# case $bn in
-# gpmi) echo "@pull" >> mods.pie; echo "0.1" >> mods.pie;;
-# esac
-
- echo "
" desc
- }
- ' < $n/README
- fi
-done
-cat post.html
-gen_pie "plugins" "$total" "#0088ff" >> after.pie
-) > index.html
-
-for n in mods after
-do
- animpie < $n.pie | animator -H -d $n
- pngtopnm ${n}0000.png | pnmcrop | pnmtopng > $n.png
- rm ${n}0000.png
-done
-
Property changes on: 1.1.4/doc-rnd/mods/gen.sh
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: 1.1.4/doc-rnd/mods/after.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/mods/after.png
===================================================================
--- 1.1.4/doc-rnd/mods/after.png (revision 10776)
+++ 1.1.4/doc-rnd/mods/after.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/mods/after.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/mods/before.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/mods/before.png
===================================================================
--- 1.1.4/doc-rnd/mods/before.png (revision 10776)
+++ 1.1.4/doc-rnd/mods/before.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/mods/before.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/mods/mods.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/mods/mods.png
===================================================================
--- 1.1.4/doc-rnd/mods/mods.png (revision 10776)
+++ 1.1.4/doc-rnd/mods/mods.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/mods/mods.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/mods/post.html
===================================================================
--- 1.1.4/doc-rnd/mods/post.html (revision 10776)
+++ 1.1.4/doc-rnd/mods/post.html (nonexistent)
@@ -1,3 +0,0 @@
-
-
-
Index: 1.1.4/doc-rnd/mods/pre.html
===================================================================
--- 1.1.4/doc-rnd/mods/pre.html (revision 10776)
+++ 1.1.4/doc-rnd/mods/pre.html (nonexistent)
@@ -1,60 +0,0 @@
-
-
-
pcb-rnd modularization
-
Why bother...
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-
-As of version 1.0.8 a cosiderable chunk of core code has been moved into
-core plugins. A core plugin is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-
-
to compile it as a buildin (static-link it into the pcb executable)
-
to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
-
to disable the plugin, so it is not compiled at all
-
-
-I believe such modularization has benefits on multiple levels:
-
-
it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
-
in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
-
such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-
-
-
Progress in charts
-
Before-after
-All numbers are in SLOC
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-
-
-
-
Before modularization: pcb-rnd version 1.0.7
- Note: gpmi was already a plugin
-
-
After modularization: pcb-rnd version 1.0.8
- Note: gpmi is part of the "plugins" slice
-
-
-
Zooming on to the plugins
-
-
-
-(Red means the plugin doesn't really work).
-
-
Progress in numbers
-Below is a table with the summary of core plugins.
-
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-
-As of version 1.0.8 a cosiderable chunk of core code has been moved into
-core plugins. A core plugin is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-
-
to compile it as a buildin (static-link it into the pcb executable)
-
to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
-
to disable the plugin, so it is not compiled at all
-
-
-I believe such modularization has benefits on multiple levels:
-
-
it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
-
in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
-
such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-
-
-
Progress in charts
-
Before-after
-All numbers are in SLOC
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-
-
-
-
Before modularization: pcb-rnd version 1.0.7
- Note: gpmi was already a plugin
-
-
After modularization: pcb-rnd version 1.0.8
- Note: gpmi is part of the "plugins" slice
-
-
-
Zooming on to the plugins
-
-
-
-(Red means the plugin doesn't really work).
-
-
Progress in numbers
-Below is a table with the summary of core plugins.
-
-
module
size [sloc]
status
configure default
description
-
-
-
autoplace
608
-
works
-
buildin
-
Automatically place elements.
-
autoroute
4177
-
works
-
buildin
-
Automatically route selected or all rats. This is the original autorouter.
-
dbus
438
-
disabled
- (TODO: needs scconfig support)
-
disabled
-
Remote control PCB using DBUS.
-
djopt
2315
-
works
-
buildin
-
Various board optimization algorithms.
-
export_gcode
2450
-
works
-
buildin
-
Export to gcode
-
export_lpr
96
-
works
-
buildin
-
Export to lpr (using export_ps to generate postscript)
-
export_nelma
683
-
export_ps
1608
-
works
-
buildin
-
Export postscript or embedded postscript.
-
gpmi
2992
-
works
-
buildin
- (if gpmi is installed)
-
Scriptable plugin system with about 10 scripting languages supported and dynamic load/unload of scripts that can manipulate the GUI, the board, can implement exporters, etc.
-
import_edif
3578
-
works
-
buildin
-
Import code for netlists in the EDIF format.
-
import_sch
255
-
works
-
buildin
-
Imports element and netlist data from the schematics (or some other source).
-
mincut
886
-
works
-
buildin
-
Use the minimal cut algorithm to indicate shorts: instead of highlighting two random pins/pads, try to highlight the least number of objects that connect the two networks.
-
oldactions
53
-
works
-
disabled
-
Random collection of old/obsolete actions. Bell(): audible feedback; DumpLibrary(): print footprint library on stdout
-
puller
1878
-
works
-
buildin
-
Pull traces to minimize their length.
-
renumber
218
-
works
-
buildin
-
Renumber elements (renaming them) and generate a text file for back annotation.
-
stroke
124
-
partially works (doesn't work with lesstif; works with the gtk hid, but there's no zoom bindings)
-
disabled
- (requires libstroke installed)
-
Gesture recognition with libstroke.
-
toporouter
6161
-
fails
- (infinite loop in gts)
-
disabled
-
Automatically route selected or all rats using a topological algorithm. This is the new autorouter from 2009.
-
-
-If you are interested to help out, please contact me using
- the live chat (CET daytime) or mail to:
-pcb-rnd (at) igor2.repo.hu.
-
-
Contributing as a user
-Using pcb-rnd in production and just reporting bugs is already a huge contribution.
-
-More dedicated users can join in scheduled, systematic testing. Such testing
-is split up into independent chunks that each can be done in an hour.
-
-Even more dedicated users can join developing the documentation.
-
-None of the above requires or assumes any programming skill.
-
-
Contributing as a developer
-
-The project is lead in an autocratic way by Igor2.
-
-Developer freedom taken away:
-
-
the basic concept of pcb-rnd is set and won't change
-
the toolchain is chosen, and won't change; the usual hot topics: svn, scconfig, C.
-
don't add code that restricts usability for others; add code that increases usability for some; thus prefer to add code in plugins!
-
-
-Developer freedom promptly granted:
-
-
svn commit access from day 0
-
work together in trunk/, not alone in a branch
-
pcb-rnd has a strong plugin support; want to implement a strange/controversial feature? In a plugin, almost anything goes
-
especially in plugins, work on whatever you want, even if noone else needs that feature
-
-
-Coding style/indentation: there's an unified style
-in core and core plugins. If you work on those parts, try to stick to it. If you
-are working on a new plugin, it's still the preferred style but you can use
-a different style. However, the rule is that if someone else starts hacking
-that part too, he is allowed to convert the code to the unified format; but
-unified format can not be converted to anything else. So it's a one way
-process which long term grants unified style while not demotivates a plugin
-developer by forcing a style on him in the early, "when the bulk of the code
-is written" phase.
-
-
Index: 1.1.4/doc-rnd/myfeature.html
===================================================================
--- 1.1.4/doc-rnd/myfeature.html (revision 10776)
+++ 1.1.4/doc-rnd/myfeature.html (nonexistent)
@@ -1,69 +0,0 @@
-
-
pcb-rnd - how to get my favorite feature implemented
-
-The list below is sorted: top items have higher priority, but you
-are free to choose any.
-
-
1. If you are a programmer with free time to spend
-Read the contribution howto and join the project.
-You are welcome to work only on the feature you are interested in. You get
-all the support (e.g. for understending the API, to get a blank plugin
-set up so you need to fill in only the feature-specific parts, etc.). Success
-rate shoudl be near to 100%.
-
-
2. If you are not a programmer and have free time
-You can join and work on things you don't need that much, but others do.
-This will build your reputation in the community which in turns encourages
-others to implement your favorite feature even if they wouldn't do it for
-themselves. The success rate is somewhat more random, obviously.
-
-
3. If you don't have free time
-Consider donation: buy someone else's time. To do so, contact me
-(see the contribution howto page). Since
-you don't need to cover all costs and the hourly rates are much lower
-on a pet project, and your feature may be simpler than it looks, and
-someone who already knows the code also saves the learning cureve, it may
-all be cheaper than you think. The success rate should be close to 100%.
-
-However, this is a last resort solution, the above ones are clearly preferred.
-
-
-
4. If you don't have anything to contribute with
-[DEL:Vote for it in the
-feature poll. If your feature is not there, ask on the mailing list.
-Chance for success: if it's a popular demand on the feature poll, chances
-are somewhat good. Else chances are very low, but not zero.:DEL]
-
-Because of 100% passivity of the geda community, I decided not to spend more
-time on community-related tasks. The poll is there, you can use it,
-but you will have to orgnaize at least 5 active, capable users who are
-commited enough to spend significant time on testing/supporting development.
-I will consider implementing your feature only if you can bring and keep
-those people motivated and active.
-
-
5. If you tried everything, even point 4. and all failed...
-Complain loudly on the mailing list, advertise your opinion, try pushing
-the thing - a.k.a. go trolling. Success rate is exactly 0%,
-you make a lot of good friends enemies that will make it harder
-to ask or contribute later for another feature, but it may make you feel
-better. </irony>.
-
Index: 1.1.4/doc-rnd/hacking/plugin_core_simple.html
===================================================================
--- 1.1.4/doc-rnd/hacking/plugin_core_simple.html (revision 10776)
+++ 1.1.4/doc-rnd/hacking/plugin_core_simple.html (nonexistent)
@@ -1,59 +0,0 @@
-
-
-
pcb-rnd hacking - simple core plugins
-
-
Introduction
-
-
Setting up a new core plugin
-
-
1. make up a name for the plugin. There are a few conventions. This document will refer to the name as plg, always replace it with your chosen name.
-
2. cd src_plugins; svn mkdir plg
-
3. copy Makefile, Plug.tmpasm and README from another, small plugin, for example from the report plugin (the next points will assume you picked this plugin as the source of the copy)
-
4. edit Makefile: replace report to plg
-
5. edit README; there should be short summary about the purpose of the plugin then "#key: value" pairs for statistics:
-
-
#state: either works or disabled
-
#lstate: if state is disabled, add a new line #lstate: with a few words on why the plugin is disabled
-
#default:disabled or builtin or plugin (this field might be removed later because of redundancy)
-
#implements: the same as the plugin name prefix (see conventions. ) or (feature) for feature plugins; it's redundant but is kept for supporting external plugins
-
sbuildin - unless the user requests otherwise, your plugin is linked into the executable
-
sdisable - unless the user requests otherwise, your plugin is not compiled (recommended until the plugin gets some user testing)
-
splugin - unless the user requests otherwise, your plugin is dynamically linked; not recommended: the policy is to let users explicitly request dynamic linking
-
- The order of entries in the file is the same as the order in the summary table
- at the end of ./configure; insert your plugin in the right group!
-
9. add your plugin to the build list in one of the src_plugins/plugins_*.tmpasm files; choose the file that lists plugins similar to yours.
-
10. run ./configure --buildin-plg
-
11. run make to see if it compiles and test
-
(12. while developing, you can run make from src_plugins/plg - if
- your plugin is a builtin, it will recompile pcb-rnd. For some of us it's convenient
- to run make in the same directory where all the source files are.)
-
-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: 1.1.4/doc-rnd/hacking/c89.html
===================================================================
--- 1.1.4/doc-rnd/hacking/c89.html (revision 10776)
+++ 1.1.4/doc-rnd/hacking/c89.html (nonexistent)
@@ -1,14 +0,0 @@
-
-
-
pcb-rnd - C89
-
-The code is written in C, namely C89 for most parts with a few exceptions
-written in C99. It's not yet decided whether the code will be C89 or C99
-long term. If it'll be C89, the C99 parts will be rewritten. If it'll be
-C99, new code can use C99 features freely. Until the decision, keep
-new code C89. Especlially watch out for these:
-
-
commengt: always use /* */, never //
-
don't mix variable declaration with code - open a new {} block, which will also scope your new variables, or better yet, split up the function into smaller, static functions, the compiler will inline them anyway
-
try to avoid vararg macros, use vararg functions instead
-
Index: 1.1.4/doc-rnd/hacking/releasing.txt
===================================================================
--- 1.1.4/doc-rnd/hacking/releasing.txt (revision 10776)
+++ 1.1.4/doc-rnd/hacking/releasing.txt (nonexistent)
@@ -1,11 +0,0 @@
-release check list
-
-0. test compile and test run a clean checkout on a clean system
- configure with --debug --all=buildin, then without
-1. check next version number and previous revision in tags/
-2. update the changelog
-3. rewrite the release notes
-4. modify version number in scconfig
-5. update changelog in debian/
-6. commit trunk
-7. svn tag using URLs
Index: 1.1.4/doc-rnd/hacking/src/data1.dot
===================================================================
--- 1.1.4/doc-rnd/hacking/src/data1.dot (revision 10776)
+++ 1.1.4/doc-rnd/hacking/src/data1.dot (nonexistent)
@@ -1,47 +0,0 @@
-digraph pcb_data {
- PCBType_misc [label="misc fields:\nID\nName\nFileName\ncolors\ndrc settings\ncursor coords\ngrid\nlayergroups\nroute styles\n..."]
- PCBType_flags [label="flags:\nChanged\nViaOn (vias drawn?)\n..."]
- PCBType -> PCBType_misc
- PCBType -> PCBType_flags
- PCBType -> DataType
- PCBType [shape=box]
-
- PCB [label="extern PCBType PCB\nglobal variable\nholding the current\nboard" shape=diamond]
- PCB -> PCBType
-
- Buffers [label="extern BufferType Buffers[]\nglobal variable holding\nall paste buffers" shape=diamond]
- Buffers -> BufferType
-
- BufferType_misc [label="misc fields:\nbounding box\noffset"]
- BufferType -> BufferType_misc
- BufferType -> DataType
- BufferType [shape=box]
-
- DataType_lists [label="layer-independent lists:\nrats\nvias\nelements"]
- DataType_rtrees [label="layer-independent rtrees"]
- DataType_LayerN [label="LayerN: number of\nlayers in use"]
- DataType_layers [label="an array of layers"]
-
- DataType -> DataType_misc
- DataType -> DataType_LayerN
- DataType -> DataType_layers
- DataType -> DataType_lists
- DataType -> DataType_rtrees
- DataType [shape=box]
-
- DataType_layers -> LayerType
-
-
- LayerType_lines [label="list and rtree of lines"]
- LayerType_arcs [label="list and rtree of arcs"]
- LayerType_texts [label="list and rtree of text objects"]
- LayerType_polygons [label="list and rtree of polygons"]
- LayerType_misc [label="misc fields:\nflags\ncolors"]
-
- LayerType -> LayerType_misc
- LayerType -> LayerType_lines
- LayerType -> LayerType_arcs
- LayerType -> LayerType_texts
- LayerType -> LayerType_polygons
- LayerType [shape=box]
-}
Index: 1.1.4/doc-rnd/hacking/src/Makefile
===================================================================
--- 1.1.4/doc-rnd/hacking/src/Makefile (revision 10776)
+++ 1.1.4/doc-rnd/hacking/src/Makefile (nonexistent)
@@ -1,2 +0,0 @@
-../data1.png: data1.dot
- dot -Tpng $^ > $@
Index: 1.1.4/doc-rnd/hacking/plugin_naming.html
===================================================================
--- 1.1.4/doc-rnd/hacking/plugin_naming.html (revision 10776)
+++ 1.1.4/doc-rnd/hacking/plugin_naming.html (nonexistent)
@@ -1,12 +0,0 @@
-
-
-
pcb-rnd hacking - plugin naming conventions
-
-
export plugins start with export_; these render to a non-native format that can not be then loaded
-
native formats are prefixed with io_; even if your plugin can now only load or save, if it's possible to do a load-save-load round-trip without data loss, it's an io_
-
interactive, often GUI, frontends are prefixed with hid_
-
footprint access plugins start with fp_
-
anything else is considered a feature plugin and has no specific prefix.
-
-This document describes the common aspects of import code, be it an
-import_ plugin or the load part of an io_plugin, importing a footprint,
-loading a board or a netlist.
-
-
Data structures
-
-The board is stored in PCBType *. Some import code, like the one
-that loads a design (an io plugin's ->parse_pcb function), gets the
-target in an argument. (Other, non-import code usually operate on
-the global variable that represents the current board:
-PCBType *PCB.).
-
-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:
-
-
lists for layer-independent objects (e.g. rat lines, vias, elements)
-
number of layers in use (LayerN) and an array of layers (see later)
-
rtree structures - these are used for looking up objects for locations
-
-Each layer is a LayerType structure. A layer has the following fields:
-
-
lists for lines, texts, arcs, polygons
-
some generic layer attributes (colors, flags, key-value pairs)
-
an rtree struct for each object type.
-
-
-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
-
-
-
-
Extra steps around creating a new board
-TODO: postproc, post*, other setup
-
-
-
-
Index: 1.1.4/doc-rnd/hacking/data1.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/hacking/data1.png
===================================================================
--- 1.1.4/doc-rnd/hacking/data1.png (revision 10776)
+++ 1.1.4/doc-rnd/hacking/data1.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/hacking/data1.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/distros.txt
===================================================================
--- 1.1.4/doc-rnd/distros.txt (revision 10776)
+++ 1.1.4/doc-rnd/distros.txt (nonexistent)
@@ -1,47 +0,0 @@
-How to request packaging (distros sorted by popularity, 2016):
-
-Ubuntu:
- easiest is to get in Debian, Ubuntu picks up packages from sid
- alternative: ubuntu-devel-discuss@lists.ubuntu.com (pending)
- alternative: https://bugs.launchpad.net/ubuntu/+filebug?no-redirect&field.tag=needs-packaging
-
-linux mint
- https://blueprints.launchpad.net/linuxmint
- (same maintainer as debian?)
-
-slackware:
- Promised (AFK, ask again in 3rd week of sept)
- geda/pcb maintainer: pfeifer[dot]felix[at]googlemail[dot]com (sent mail)
- https://slackbuilds.org/guidelines/
- needs an existing package
- since the slackbuild needs slackware's pkgtools usually at the end of a ./configure --prefix=/usr --extrastuff..make.. make install DESTDIR=/tmp/NAMEOFPACKAGE..cd /tmp/NAMEOFPACKAGE..makepkg -l y -c n ../NAMEOFPACKAGE-123.txz
- installwatch can build a package
- check out #slackbuilds
-
-Debian:
- Bdale?
- (alternative: pkg-electronics-devel@lists.alioth.debian.org - pending)
- (alternative: RFP through reportbug)
-
-fedora:
- https://fedoraproject.org/wiki/Package_maintainers_wishlist?rd=PackageMaintainers/WishList
- (wrote mail to cicku)
-
-OpenSuse:
- adrian [at] suse.de (mail sent)
-
-Arch:
- DONE! needs to be modularized
- Kyle Keen (mail sent)
-
-Manjaro:
- Same as arch
-
-----
-FreeBSD:
- hrs [at] freebsd.org (Hiroki Sato - mail sent)
-
-OpenBSD:
- andreas.bihlmaier [at] gmx.de -> ENOTIME, he suggests ports@openbsd.org
-
-
Index: 1.1.4/doc-rnd/query/tutor_cli.html
===================================================================
--- 1.1.4/doc-rnd/query/tutor_cli.html (revision 10776)
+++ 1.1.4/doc-rnd/query/tutor_cli.html (nonexistent)
@@ -1,168 +0,0 @@
-
-
-
-
advanced searc, command line tutorial: query language
-
-
scope
-
-pcb-rnd from version 1.1.3 features a flexible advnced search that helps
-the user selecting/unselecting objects that match a given logical expression.
-The core of the feature is the pcb-rnd query language. The same language
-is used in the programmable DRC (see also:
-a more formal description of the language).
-
-The current document is a walk through of the practical aspects of the
-language. It starts with the simplest examples while working towards more
-complex cases.
-
-A limited version of the functionality is accessible through a GUI
-wizard when using the GTK HID. A separate
-tutorial is dealing with that feature.
-
-
Actions
-The query(act, expr) action creates the list called "@", which contains all
-objects of the design. Then it iterates over this list (if needed) and
-evaluates the query expression on each object. For each evaluation "act"
-is performed; "act" is one of:
-
-
select - add the matching object to the selections if expr evaluated to true
-
unselect - remove the matching object from the selections if expr evaluated to true
-
eval - print the result of the expression to stdout
-
dump - this inhibits evaluating; it compiles the expression and dumps the parse tree (useful for debugging)
-
-
-The symbol @ in the query represents the iterator, or in other words,
-the current object we are checking. The engine iterates over all
-copper objects, silk objects, pins, holes, layers and nets. A simple query
-that selects all objects looks like this:
-
-query(select, '@')
-
-The actual query experssion was a single @ in this case. This made
-the iteration happen, got the expression evaluated one each object. The
-result of each evaluation was the given object. Since these objects
-were all existing, valid objects, they were taken as logical value TRUE,
-thus for each the add-to-selection was performed.
-
-Note: it's usually a good idea to write the expression in single quotes, because
-it may contain commas, double quotes and parenthesis that pcb-rnd's action parser may
-take as action syntax.
-
-The same expression can ran with eval would print the result of each
-evaluation:
-
-query(eval, '@')
-
-This is visible on the terminal pcb-rnd was started from - on X, it's a good
-idea to start a terminal and run pcb-rnd from that instead from a menu or
-icon. The rest of this tutorial will use the eval query because it's easier
-to include the result of an eval than of a selection. Most examples will
-specify the query expression only, without quotes - the reader should
-add the query(eval, ' ') part.
-
-
iteration vs. evaluate once
-If an expression does not reference the @ object, no iteration is performed
-and the expression is ran only once:
-
-query(eval, '1')
-
-This will calculate the value of 1 and prints it to the standard output. Since
-theres no iteration, this can not result in changes in selection. However,
-it makes it easy to demonstrate some basic concepts of the query language.
-
-Note: if @ is present multiple times in the expression, it's still only
-one loop over all objects. When evaluating the expression for a given object,
-all instances of @ are substituted with the same object in that iteration.
-
-
-
grammar: arithmetics and logics
-For example the integer and floating point numbers and the usual
-arithmetic and logical operators work as expected:
-
-
-
expression
result
explanation
-
42
42
the integer value 42
-
3.14
3.14
the floating point value 3.14
-
10 mil
254000
a number with a unit suffix is converted to pcb-rnd's internal coordinate unit (nanometers)
-
1+2
3
sum of 1 and 2
-
2*4
8
multiplication
-
47/4
11
integer division (because both operands were integers)
-
47/4.0
11.75
floating point division (because at least one of the operands was a float)
-
(1+2)*5
15
parenthesis works as usual
-
1 && 0
0
logical AND - the result is 1 if both operands were TRUE, 0 else
-
1 || 0
1
logical OR - the result is 1 if either operand was TRUE, 0 else
-
!2
0
logical NOT - 2 is non-zero, so it is TRUE, negate this to get the result (FALSE, which is 0)
-
4 > 2
1
because four is greater than two; all the usual relational operats work: == is equal, != is not-equal, <, <=, > and >=.
-
-
-
grammar: object properties
-Object have named properties, e.g. the thickness of a line (or arc, or
-trace in general) is called ".thickness", so the thickness of
-the current object is:
-
- @.thickness
-
-
-Next, we can already select all traces thicker than 10 mil:
-
- query(select, '@.thickness > 10 mil')
-
-
-Because logical expressions are available, it's easy to select all medium-thick
-lines:
-
-But how comes an expression like '@.thickness > 10 mil' works while
-@ iterates over non-trace objects, like layers, nets or elements that
-clearly have no thickness?
-
-The answer is the invalid value, which is neither true nor false. If
-a property does not exist in a given object, the result is the invalid value
-or invalid for short. The invalid is treated specially:
-
-
in arithmetic operations it propagates: if either operand is invalid, the result is invalid, e.g. 1+invalid = invalid; this affects +, -, *, / and all the relational operators
-
in binary logic operations (&& and ||), it is ignored: it is assumed to be true in a && and false in a || so the outcome depends on the other operand
-
in logical NOT (!), TODO
-
-When @ refers to a non-trace object, @.thickness is invalid and
-'@.thickness > 10 mil' is evaluated t invalid. If the result is not TRUE,
-the requested action is not performed.
-
-The invalid value is generated only when the expression is valid but the
-actual object doesn't have the feature needed. If the expression is wrong,
-an error is generated and the expression stops evaluating immediately.
-
-
grammar: more properties
-Some properties are a single numeric value, like thickness, or the
-.name of a layer (which is a string) but others are objects. For
-example the .layer property of a line or arc refers to the layer
-object the given line or arc is drawn on. These in turn can be combined,
-and the "name of the layer the current object is on":
-
- @.layer.name
-
-
-Referencing non-existing properties yields an error, e.g. @.thickness.layer
-is an error - in contrast with @.layer, which may evaluate to the
-invalid value (e.g. for vias or nets, because they don't have layers).
-The difference is that tickness can not have a layer ever (thus is an error)
-while @.layer is either applicable or not, but potentially could work, this
-when it doesn't, it's only an invalid value.
-
-Further useful property combinatons:
-TODO
-
-There is a full list of all properties.
Index: 1.1.4/doc-rnd/windows.txt
===================================================================
--- 1.1.4/doc-rnd/windows.txt (revision 10776)
+++ 1.1.4/doc-rnd/windows.txt (nonexistent)
@@ -1,38 +0,0 @@
-State on windows
-~~~~~~~~~~~~~~~~
-
-Does not work yet. This file documents how far we got. The situation
-is constantly improving.
-
-1. Cross compilation from Linux to win32
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-(developers may need this, if you are an user, skip to 2.)
-
-TODO: deps with mpk
-
-Use mingw and wine:
-
- ./configure --emu="wine cmd /c" --target=i586-mingw32msvc "$@"
-
-(Replace i586- with whatever toolchain prefix you have)
-
-2. download the binary pack
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Temporary URL: http://igor2.repo.hu/tmp/pcb-rnd-pack.zip
-
-Download, unpack, run setup.bat then pcb-rnd.bat
-
-All binaries in the pack are cross-compiled from source, using mingw and
-mpk. All binaries are 32-bit. The pack is self-contained, no gtk or other
-external dependencies.
-
-Known bugs:
- - inserting elements fail (even static ones)
- - no shell and awk in the pack -> parametric footprints fail
- - text (including menu text) doesn't appear on XP
- - no exporters that depend on libgd (png, jpeg, gif, nelma)
-
-Worked on systems:
- - Windows 8.1 pro, Hungarian, 32 bit
- - Windows 7 pro, Hungarian, 64 bit
- - Windows 7 pro, English, 64 bit
Index: 1.1.4/doc-rnd/man/pcb-rnd.1
===================================================================
--- 1.1.4/doc-rnd/man/pcb-rnd.1 (revision 10776)
+++ 1.1.4/doc-rnd/man/pcb-rnd.1 (nonexistent)
@@ -1,47 +0,0 @@
-.\" pcb-rnd - manual
-.\" Copyright (C) 2016 Tibor 'Igor2' Palinkas
-.\"
-.\" This program is free software; you can redistribute it and/or modify
-.\" it under the terms of the GNU General Public License as published by
-.\" the Free Software Foundation; either version 2 of the License, or
-.\" (at your option) any later version.
-.\"
-.\" This program is distributed in the hope that it will be useful,
-.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
-.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-.\" GNU General Public License for more details.
-.\"
-.\" You should have received a copy of the GNU General Public License along
-.\" with this program; if not, write to the Free Software Foundation, Inc.,
-.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
-.\" Contact: pcb-rnd[removethis]@igor2.repo.hu
-.TH pcb-rnd 1 2016-10-29 "" "pcb-rnd manual"
-.SH NAME
-pcb-rnd - Printed Circuit Board editor
-.SH SYNPOSIS
-.nf
-.sp
-\fBpcb-rnd [\fIoptions\fB] [\fIinputfile\fB]
-.fi
-.SH DECSRIPTION
-
-.BR pcb-rnd
-is a modular PCB editor. The main use is interactive editing. If no \fI-x\fR is specified on the command line, the graphical editor mode is initiated. Automated, headless processing is also possible with \fI-x\fR or \fI--gui batch\fR.
-.SH OPTIONS
-
-
-.TP
-
-.B -x \fIexporter\fR [\fIexportflags] \fIinputfile\fR\fR
-Instead of interactive editing, export the design (loaded from \fIinputfile\fR) to a file using the specified \fIexporter\fR plugin. A list of exporter-specific parameters may follow to control the details of the process.
-.TP
-
-.B --gui \fIhid\fR
-Use the \fIhid\fR 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).
-.TP
-
-.B -c \fIpath=val\fR
-Set a config node in role CFR_CLI. The path of the node is \fIpath\fR (e.g. editor/grid) and the new value is \fIval\fR (e.g. 5mm).
-.PP
-
Index: 1.1.4/doc-rnd/man/pcb-rnd.1.html
===================================================================
--- 1.1.4/doc-rnd/man/pcb-rnd.1.html (revision 10776)
+++ 1.1.4/doc-rnd/man/pcb-rnd.1.html (nonexistent)
@@ -1,79 +0,0 @@
-
-
-
-
-
pcb-rnd 1
-
2016-10-29
-
pcb-rnd manual
-
-
-
-
-
NAME
-
-pcb-rnd - Printed Circuit Board editor
-
-
-
SYNPOSIS
-
-
-pcb-rnd [options] [inputfile]
-
-
-
-
-
-
DESCRIPTION
-
-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.
-
-
-
-
OPTIONS
-
-
-
-
-
-
-
-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
-
-
-
-
Index: 1.1.4/doc-rnd/man/pcb-rnd.1.mml
===================================================================
--- 1.1.4/doc-rnd/man/pcb-rnd.1.mml (revision 10776)
+++ 1.1.4/doc-rnd/man/pcb-rnd.1.mml (nonexistent)
@@ -1,38 +0,0 @@
-pcb-rnd
-1
-2016-10-29
-
- 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).
-
-
-
Index: 1.1.4/doc-rnd/man/index.html
===================================================================
--- 1.1.4/doc-rnd/man/index.html (revision 10776)
+++ 1.1.4/doc-rnd/man/index.html (nonexistent)
@@ -1,3 +0,0 @@
-
-
pcb-rnd(1) -- pcb-rnd - Printed Circuit Board editor
-
Index: 1.1.4/doc-rnd/man/gsch2pcb-rnd.1
===================================================================
--- 1.1.4/doc-rnd/man/gsch2pcb-rnd.1 (revision 10776)
+++ 1.1.4/doc-rnd/man/gsch2pcb-rnd.1 (nonexistent)
@@ -1,134 +0,0 @@
-.TH gsch2pcb-rnd 1 "September 25th, 2013" "gEDA Project" 1.8.2.20130925
-.SH NAME
-gsch2pcb-rnd - Update pcb-rnd layouts from gEDA/gaf schematics
-.SH SYNOPSIS
-\fBgsch2pcb-rnd\fR [\fIOPTION\fR ...] {\fIPROJECT\fR | \fIFILE\fR ...}
-.SH DESCRIPTION
-.PP
-\fBgsch2pcb-rnd\fR is a frontend to \fBgnetlist\fR(1) which aids in
-creating and updating \fBpcb-rnd\fR(1) printed circuit board layouts based
-on a set of electronic schematics created with \fBgschem\fR(1).
-
-.PP
-Instead of specifying all options and input gEDA schematic \fIFILE\fRs
-on the command line, \fBgsch2pcb-rnd\fR can use a \fIPROJECT\fR file
-instead.
-
-.PP
-\fBgsch2pcb-rnd\fR first runs \fBgnetlist\fR(1) with the `PCB' backend to
-create a `.net' file containing a \fBpcb-rnd\fR(1) formatted netlist for
-the design.
-
-.PP
-The second step is to run \fBgnetlist\fR(1) again with the `gsch2pcb-rnd'
-backend to find any \fBM4\fR(1) elements required by the schematics.
-Any missing elements are found by searching a set of file element
-directories. If no `.pcb' file exists for the design yet, it is
-created with the required elements; otherwise, any new elements
-are output to a `.new.pcb' file.
-
-.PP
-If a `.pcb' file exists, it is searched for elements with a
-non-empty element name with no matching schematic symbol. These
-elements are removed from the `.pcb' file, with a backup in a
-`.pcb.bak' file.
-
-.PP
-Finally, \fBgnetlist\fR(1) is run a third time with the `pcbpins'
-backend to create a `.cmd' file. This can be loaded into
-\fBpcb-rnd\fR(1) to rename all pin names in the PCB layout to match the
-schematic.
-
-.SH OPTIONS
-.TP 8
-\fB-o\fR, \fB--output-name\fR=\fIBASENAME\fR
-Use output filenames `\fIBASENAME\fR.net', `\fIBASENAME\fR.pcb', and
-`\fIBASENAME\fR.new.pcb'. By default, the basename of the first
-schematic file in the list of input files is used.
-.TP 8
-\fB-d\fR, \fB--elements-dir\fR=\fIDIRECTORY\fR
-Add \fIDIRECTORY\fR to the list of directories to search for PCB file
-elements.
-.TP 8
-\fB-r\fR, \fB--remove-unfound\fR
-Don't include references to unfound elements in the generated `.pcb'
-files. Use if you want \fBpcb-rnd\fR(1) to be able to load the
-(incomplete) `.pcb' file. This is enabled by default.
-.TP 8
-\fB-k\fR, \fB--keep-unfound\fR
-Keep include references to unfound elements in the generated `.pcb'
-files. Use if you want to hand edit or otherwise preprocess the
-generated `.pcb' file before running \fBpcb\fR(1).
-.TP 8
-\fB-p\fR, \fB--preserve\fR
-Preserve elements in PCB files which are not found in the schematics.
-Since elements with an empty element name (schematic "refdes") are
-never deleted, this option is rarely useful.
-.TP 8
-\fB--gnetlist\fR \fIBACKEND\fR
-In addition to the default backends, run \fBgnetlist\fR(1) with `\-g
-\fIBACKEND\fR', with output to `.\fIBACKEND\fR'.
-.TP 8
-\fB--gnetlist-arg\fR \fIARG\fR
-Pass \fIARG\fR as an additional argument to \fBgnetlist\fR(1).
-.TP 8
-\fB--empty-footprint\fR \fINAME\fR
-If \fINAME\fR is not `none', \fBgsch2pcb-rnd\fR will not add elements for
-components with that name to the PCB file. Note that if the omitted
-components have net connections, they will still appear in the netlist
-and \fBpcb-rnd\fR(1) will warn that they are missing.
-.TP 8
-\fB--fix-elements\fR
-If a schematic component's `footprint' attribute is not equal to the
-`Description' of the corresponding PCB element, update the
-`Description' instead of replacing the element.
-.TP 8
-\fB-q\fR, \fB--quiet\fR
-Don't output information on steps to take after running \fBgsch2pcb-rnd\fR.
-.TP 8
-\fB-v\fR, \fB--verbose\fR
-Output extra debugging information. This option can be specified
-twice (`\-v \-v') to obtain additional debugging for file elements.
-.TP 8
-\fB-h\fR, \fB--help\fR
-Print a help message.
-.TP 8
-\fB-V\fR, \fB--version\fR
-Print \fBgsch2pcb-rnd\fR version information.
-
-.SH PROJECT FILES
-.PP
-A \fBgsch2pcb-rnd\fR project file is a file (not ending in `.sch')
-containing a list of schematics to process and some options. Any
-long-form command line option can appear in the project file with the
-leading `\-\-' removed, with the exception of `\-\-gnetlist-arg',
-`\-\-fix-elements', `\-\-verbose', and `\-\-version'. Schematics should be
-listed on a line beginning with `schematics'.
-.PP
-An example project file might look like:
-
-.nf
- schematics partA.sch partB.sch
- output-name design
-.ad b
-
-.SH ENVIRONMENT
-.TP 8
-.B GNETLIST
-specifies the \fBgnetlist\fR(1) program to run. The default is
-`gnetlist'.
-
-.SH AUTHORS
-See the `AUTHORS' file included with this program.
-
-.SH COPYRIGHT
-.nf
-Copyright \(co 1999-2011 gEDA Contributors. License GPLv2+: GNU GPL
-version 2 or later. Please see the `COPYING' file included with this
-program for full details.
-.PP
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law.
-
-.SH SEE ALSO
-\fBgschem\fR(1), \fBgnetlist\fR(1), \fBpcb-rnd\fR(1)
Index: 1.1.4/doc-rnd/man/copyright.mml
===================================================================
--- 1.1.4/doc-rnd/man/copyright.mml (revision 10776)
+++ 1.1.4/doc-rnd/man/copyright.mml (nonexistent)
@@ -1,21 +0,0 @@
-
-pcb-rnd - manual\n
-Copyright (C) 2016 Tibor 'Igor2' Palinkas\n
-\n
-This program is free software; you can redistribute it and/or modify\n
-it under the terms of the GNU General Public License as published by\n
-the Free Software Foundation; either version 2 of the License, or\n
-(at your option) any later version.\n
-\n
-This program is distributed in the hope that it will be useful,\n
-but WITHOUT ANY WARRANTY; without even the implied warranty of\n
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
-GNU General Public License for more details.\n
-\n
-You should have received a copy of the GNU General Public License along\n
-with this program; if not, write to the Free Software Foundation, Inc.,\n
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n
-\n
-Contact: pcb-rnd[removethis]@igor2.repo.hu
-
-pcb-rnd manual
Index: 1.1.4/doc-rnd/man/README
===================================================================
--- 1.1.4/doc-rnd/man/README (revision 10776)
+++ 1.1.4/doc-rnd/man/README (nonexistent)
@@ -1,10 +0,0 @@
-Manual pages are written in the manual markup format and are compiled into
-manual and html using mml. Do not edit the generated manual or html pages.
-
-The generated files are commited in the repository so dependencies are not
-required for casual users to build the project.
-
-The required tools and dependencies are:
- svn://repo.hu/libmawk/trunk
- svn://repo.hu/web3.0/trunk
- svn://repo.hu/shscripts/trunk/manmarkup
Index: 1.1.4/doc-rnd/man/Makefile
===================================================================
--- 1.1.4/doc-rnd/man/Makefile (revision 10776)
+++ 1.1.4/doc-rnd/man/Makefile (nonexistent)
@@ -1,58 +0,0 @@
-# This Makefile is a plain old hand written one; all configuration settings
-# are included from ../../Makefile.conf which is scconfig generated
-
-IN=pcb-rnd.1.mml
-OUT_HTML = pcb-rnd.1.html
-OUT_MAN1 = pcb-rnd.1
-OUT_LINT = pcb-rnd.1.lint
-
-OUTPUT = $(OUT_HTML) $(OUT_MAN1) index.html
-MML = /usr/bin/mml
-
-all: $(OUTPUT)
-
-lint: pcb-rnd.1.lint
-
-.SUFFIXES: .html .mml .lint
-
-.mml.html: .mml_linkmap
- $(MML) -i copyright.mml -f html $< > $@
-
-.mml:
- $(MML) -i copyright.mml -f man $< > $@
-
-.mml_linkmap:
- $(MML) -i copyright.mml -f linkmap $(IN) > $@
-
-index.html:
- @echo "" > $@
- $(MML) -i copyright.mml -f indexhtml $(IN) >> $@
- @echo "" >> $@
-
-clean:
-
-distclean:
-
-genclean:
- rm $(OUTPUT) 2>/dev/null ; true
-
-.mml.lint:
- $(MML) -i copyright.mml -f lint $<
-
-install_:
- $(MKDIR) "$(MAN1DIR)"
- $(CPC) "`pwd`/pcb-rnd.1" "$(MAN1DIR)/pcb-rnd.1"
- $(CPC) "`pwd`/gsch2pcb-rnd.1" "$(MAN1DIR)/gsch2pcb-rnd.1"
-
-uninstall:
- $(RM) "$(MAN1DIR)/pcb-rnd.1"
- $(RM) "$(MAN1DIR)/gsch2pcb-rnd.1"
-
-install:
- make install_ CPC="$(CP)"
-
-linstall:
- make install_ CPC="$(LN)"
-
-include ../../Makefile.conf
-
Index: 1.1.4/doc-rnd/ddrc/requirements.txt
===================================================================
--- 1.1.4/doc-rnd/ddrc/requirements.txt (revision 10776)
+++ 1.1.4/doc-rnd/ddrc/requirements.txt (nonexistent)
@@ -1,23 +0,0 @@
-The Dynamic DRC should be able to solve at least these tasks:
- - check start grounding
- - require element placement on same layer
- - specify element proximity to each other on same layer
- - specify element proximity to the edge
- - specify element proximity to network or other copper feature
- on the same layer
- - perform copper vs. copper checks
- - minimal gap between an object or network and anything else
- - minimal gap between high voltage and low voltage networks
- - perform copper geometry checks
- - detect minimal width (high current)
- - detect poly hairpin
- - number and length of stubs (hight freq)
- - "via cage": a given network needs to be sorrounded by a set of gnd vias
- - network related copper checks
- - matched length lines (e.g. fast dram bus)
- - balanced transmission line (distance between the tracks)
- - match and/or limit number of vias
- - limit layer usage
- - require layer stackup properties, e.g. microstrip, stripline
- - e.g. require ground poly on the next layer
- - e.g. number of gaps in the ground poly the line jumps
Index: 1.1.4/doc-rnd/ddrc/examples1.txt
===================================================================
--- 1.1.4/doc-rnd/ddrc/examples1.txt (revision 10776)
+++ 1.1.4/doc-rnd/ddrc/examples1.txt (nonexistent)
@@ -1,54 +0,0 @@
-# Example 1: Sensitive RF elements should be close
-#
-# e1 is the list of elements that have the user tag RF
-# e2 is a copy of e1; it's needed to get two loops (e1 vs. e2 objects form pairs)
-# Assert that any two components are closer than 25 mm to each other
-
-rule sensitive RF elements
- let e1 (type(@, element)) && (@.a.group == "RF")
- let e2 e1
- assert (distance(e1, e2) < 25 mm)
-
-# Example 2: matched trace lengths on dram data 0
-#
-# e1 is the list of dram traces
-# e2 is a copy of e1 (see Example 1)
-# Assert that any two net lengths are matched within 2 mm
-
-rule matched length dram traces
- let e1 (type(@, net)) && (@.a.group == "dram_data_0")
- let e2 e1
- assert abs(netlen(e1) - netlen(e2)) < 2 mm
-
-# Example 3: check if isolation gap is maintained between any HV and LV nets
-# (Lazy: assume any copper is part of a network, compare net-to-net only)
-#
-# hv is the list of high voltage nets
-# lv is a list of non-hv networks
-#
-
-rule isolation gap 1
- let hv (type(@, net)) && (@.a.high_voltage)
- let lv (type(@, net)) && !(@.a.high_voltage)
- assert !is_closer(lv, hv, 4 mm)
-
-# Example 4: check if isolation gap is maintained between any HV and LV nets
-# (Proper way: do not forget about copper not part of any network!)
-#
-# hv is the list of high voltage nets
-# hvo is a list of all objects found in hv
-# cp is a list of all copper object
-# There are two iterators in the assert: cp (all copper objects) and hv.
-# For each hv and cp pair:
-# - lcomplement returns a cp object if the cp object is not in hv (i.e.
-# the object is low voltage); else the return value is empty and is_closer
-# returns invalid which is not a violation
-# - hvo is required because cp is an object while hv is a list of nets
-# (so cp is never on the hv list)
-# - if there was a valid (low voltage) cp object found,
-
-rule isolation gap 2
- let hv (type(@, net)) && (@.a.high_voltage)
- let hvo lobjs(hv)
- let cp (type(@, copper))
- assert !is_closer(lcomplement(cp, hvo), hv, 4 mm)
Index: 1.1.4/doc-rnd/ddrc/proposal1.txt
===================================================================
--- 1.1.4/doc-rnd/ddrc/proposal1.txt (revision 10776)
+++ 1.1.4/doc-rnd/ddrc/proposal1.txt (nonexistent)
@@ -1,242 +0,0 @@
-Dynamic DRC proposal 1: a Declarative DRC language.
-
-P0 A DRC program is an unordered list of rules. Rules are evaluated and
- violations reported. The advantage of a declarative language is that
- intermediate results can be cached and reused.
-
-P1 The language is intended to be human readable and human writable, but
- the main goal is to let programs and scripts (e.g. netlisters) to
- generate it.
-
-P2 A rule consists of three parts:
- - the rule keyword; syntax: rule NAME
- - build variables (lists) using search statements
- - state assertions about those lists.
- - comments, empty lines
-
-P3 Variables are named by the user and are local to the rule (TODO)
-
-P4 Lists are ordered.
-
-P5 A list is consists of zero or more objects. An object is:
-P6 - the board
-P7 - a layer
-P8 - a board drawing primitive (line, arc, polygon, via, text)
-P9 - an element primitive (element line, element arc(?), pin, pad, element name)
-P10 - an element as a whole
-P11 - a net
-P61 - a 2D coordinate with or without layer information
-
-P12 Objects have named properties (or fields):
-P13 - core attributes: for each object type a predefined set of key=value
- pairs that always exist (e.g. thickness of a line, start angle of
- an arc); these field names starts with "p."
-P14 - user attributes: free-form key=value pairs optionally assigned by
- the user; these field names start with "a."
-
-P15 Note: the language is case sensitive with keywords and builtins using
- lowercase only. For better readability, in syntax description in this
- document uppercase words are user chosen identifiers or fields. Whitespace
- character sequences are usually treated as a single whitespace. (This
- does not mean identifiers have to be uppercase in a program.)
-
- The syntax of a search statement is:
-
-P16 let LISTNAME EXPR
-
-P17 It creates a list called LISTNAME and evaluates expression EXPR to all
- available objects and adds the objects that match EXPR to the list. Each
- matching object is added only once. The particular order of objects on
- the list is random. Object "matches EXPR" when the EXPR evaluated on
- the object yields true.
-
-P18 The current object used in the iteration during the search is called
- @.
-
-P19 An expression returns a value. A value can be:
-P20 - an object
-P21 - a list
-P22 - scalar: a number or string (might be suffixed, like "42 mm")
-P23 - void (empty, also known as false)
-
-P23 A value is considered true if:
-P24 - it is an existing object
-P25 - it is a non-empty list
-P26 - it is a non-zero number or non-empty string
-P69 - it is a valid coordinate
-
- An expression is one of:
-
- syntax meaning
- ----------------------------------------------------------------
-P27 (EXPR) change precedence
-P28 EXPR || EXPR logical OR (result: number)
-P29 EXPR && EXPR logical AND (result: number)
-P30 EXPR + EXPR add (number only)
-P31 EXPR - EXPR subtract (number only)
-P32 EXPR * EXPR multiply or ... (number only)
-P32 EXPR / EXPR multiply or ... (number only)
-P32 EXPR == EXPR the two values are equal
-P33 EXPR != EXPR the two values are not equal
-P71 EXPR ~ string regex match left EXPR using pattern right string
-P34 EXPR > EXPR left EXPR is greater than right EXPR (number only)
-P35 EXPR >= EXPR left EXPR is greater than or equal to right EXPR (number only)
-P36 EXPR < EXPR left EXPR is less than right EXPR (number only)
-P37 EXPR <= EXPR left EXPR is less than or equal to right EXPR (number only)
-P38 !EXPR logical NOT (result: number, 0 or 1)
-P39 FUNC(EXPR, EXPR, ...) call a function with 0 or more arguments
-P40 EXPR.field evaluated to the value of an object field (see P45, P46)
-
- The syntax of an assertion is:
-
-P41 assert EXPR
-
-P42 If the EXPR in an assert evaluates to false, a DRC violation is generated.
-
-P43 If an assert EXPR is a list anywhere else than in a function argument, it is
- evaluated for all valid members of the list (see P45, P46). For example
- if there is a variable called FOO, which is a list of objects
- (built using a search statement), expression
-
- FOO.p.thickness
-
- is evaluated as many times as many objects are on the list, and the
- full assert is checked each case. If there is another similar list
- called BAR, an expression:
-
- (FOO.p.thickness < BAR.p.thickness)
-
- will compare each possible pair of FOO and BAR objects. That is, if
- FOO has 4 objects and BAR has 15 objects, that is 4*15 = 60 comparisons.
-
-P44 However, each list is iterated only once, even if it is referenced multiple
- times in the same expression. For example, with the above lists:
-
- (FOO.p.clearance > 10 mil) && (FOO.p.thickness < BAR.p.thickness)
-
- the potential number of iterations is still 4*15, and not 4*4*15. In
- practice the engine leverages lazy evaluation so if FOO.p.clearance
- is smaller than 10 mil, the right size is not evaluated. See also: P45, P46.
-
-P45 A field reference is valid if the field exists. For example a line object
- has a thickness attribute, thus the .p.thickness is valid, but a polygon
- object does not have a thickness and .p.thickness on a polygon is invalid.
- An user attribute reference (e.g. field .a.baz) is valid if the attribute
- key exists in the given object.
-
-P46 Invalid fields are skipped in iterations. Thus if variable BLOBB is a list
- that consists of 3 line, 2 arc and a layer objects, the following assert
- will result in 2 comparisons only:
-
- (BLOBB.p.width >= 10 mm)
-
- (because only arc objects have valid .p.width field).
-
-P47. An invalid field in an expression is never considered an
- error. In an assert statement it causes skipping an iteration. In a
- search statement it evaluates to void.
-
-P48. A void value is never equal to anything. A void value is not equal
- even to another void value.
-
-P49. Comments are lines starting with #
-
-
- BUILTIN FUNCTIONS
-
-P70 list(LISTNAME)
- Within an expression, a reference to a list may become an iterator and
- refer to a single object. In case the expression needs the listm the
- list() function protects LISTNAME from becoming an iterator. For
- example llen(list(@)) is the number of all objects the design consists.
-
-P50 llen(EXPR)
- Returns to the number of items of a list (an integer number >= 0).
-
-P51 lvalid(EXPR, field)
- Returns a list of items on the list for which field is valid.
- EXPR can be a list or an object.
-
-P52 lunion(EXPR1, EXPR2)
- A new list is created; items of EXPR1 are copied to the new list in order.
- Those items from EXPR2 that are not on the list already are appended,
- keeping their order. The new list is returned.
-
- Both EXPR1 and EXPR2 can be either a list or an object.
-
- Note: order of arguments does matter (affects order of objects on the
- resulting list).
-
-P53 lintersect(EXPR1, EXPR2)
- A new list is created; items that are present on both EXPR1 and EXPR2
- are copied onto the new list. The new list is returned.
-
- Both EXPR1 and EXPR2 can be either a list or an object.
-
- Note 1: this function can be used as "is this object on the list" query:
- list_intersection(LIST, OBJ) will result an empty list (which means false)
- if OBJ is not on the list.
-
- Note 2: similarly, if both argument are objects, the result is false
- if the two arguments are not the same object.
-
-P54 lcomplement(EXPR1, EXPR2)
- Creates a new list with all items that are present in EXPR1 but not in
- EXPR2. The new list is returned.
-
- Both EXPR1 and EXPR2 can be either a list or an object.
-
-
-P55 ldiff(EXPR1, EXPR2)
- Creates a new list with all items that are present either in EXPR1 or in
- EXPR2 but not in both. The new list is returned.
-
-
-P56 distance(EXPR1, EXPR2)
- Calculates the shortest distance between two objects. Returns a number.
-
- Note: if any expression is a layer, the stack distance is calculated
- (which will be 0 for now, as pcb-rnd doesn't yet know about layer thickness).
- If the expression is a net, the whole shape of the net is used
- (expensive! use is_closer() instead)
- If the expression is the board, the operation is invalid (see P46).
-
-P57 is_closer(EXPR1, EXPR2, NUMBER)
- Checks if EXPR1 and EXPR2 are closer to each-other than NUMBER. It uses
- the classic bloat-and-find algorithm originally used by the classic DRC,
- thus it is much cheaper than distance(EXPR1, EXPR2) < NUMBER.
-
-P58 netlen(EXPR)
- Network length of EXRP1: sum of all non-overlapping trace/arc lengths that
- make up a network; polygons are approximated with their average diameter
- (TODO). If EXPR is an object, its length is returned.
-
-P59 netobjs(EXPR)
- Creates and returns a list of objects consists of a net.
-
-P60 type(EXPR, TYPENAME)
- EXPR is an object. Returns the object if it's type matches TYPENAME, else
- returns void (a.k.a. false). This call is useful to decide whether an
- object is of a specific type. TYPENAME is one of:
- - drawing primitive type: arc, line, polygon, text, via, element
- - element primitive type: element_line, element_name, pin, pad
- - misc type: layer, net
- - meta-type, or a group:
- - copper: primitive that results in copper (arc, line, polygon, text (on copper), via, pin, pad)
- - drilled: anything that drills the board (via, pin)
-
-P62 gridup(EXPR, NUM1, NUM2)
- If expression is an object, return a list of coordinates that are on
- the object, evenly spaced:
-P63 - for lines and arcs, the points are evenly spaced on the centerlane with
- a gap of NUM1, starting from both endpoints, having the corner case in
- the middle; if NUM2 is 0, the gap at the middle may be larger than NUM1,
- else it may be smaller than NUM1.
-P64 - for polygons take a grid of NUM1*NUM2 spacing (NUM1 is always axis
- aligned to X, NUM2 to Y). The offset of the grid is unspecified
-P65 - element and text are ignored
-P66 - a pad or pin is approximated with a polygon
-P67 - for networks, iterate over all objects and append unique coordinates on
- the resulting list
-P68 There's no guarantee on the particular order of the list.
-
Index: 1.1.4/doc-rnd/Makefile
===================================================================
--- 1.1.4/doc-rnd/Makefile (revision 10776)
+++ 1.1.4/doc-rnd/Makefile (nonexistent)
@@ -1,28 +0,0 @@
-MENU_RES=../src/pcb-menu-gtk.lht ../src/pcb-menu-lesstif.lht
-MENU_RES_MKEY=../src/pcb-menu-mkey.lht
-KEYLIST=../util/keylist.sh
-DEBLIST=../util/devhelpers/deblist.sh
-
-all: keys.html keys_mkey.html
- ./Autostyle.sh *.html features/*.html
-
-keys.html: $(MENU_RES) $(KEYLIST)
- $(KEYLIST) $(MENU_RES) > keys.html
-
-keys_mkey.html: $(MENU_RES_MKEY) $(KEYLIST)
- $(KEYLIST) $(MENU_RES_MKEY) > keys_mkey.html
-
-install:
- cd man && make install
-
-linstall:
- cd man && make linstall
-
-uninstall:
- cd man && make uninstall
-
-clean:
- cd man && make clean
-
-distclean:
- cd man && make distclean
Index: 1.1.4/doc-rnd/mac.txt
===================================================================
--- 1.1.4/doc-rnd/mac.txt (revision 10776)
+++ 1.1.4/doc-rnd/mac.txt (nonexistent)
@@ -1,22 +0,0 @@
-State on MacOSX
-~~~~~~~~~~~~~~~
-
-Source releases starting from 1.1.0 should compile and run out-of-the-box.
-
-Requirements for GUI: x11 and gtk+
- - X11 server and client libraries for OS X are available from the XQuartz
- download and install
- - gtk+ is available from brew
- * brew install dependencies (gtk+ and libgd) with the following commands
- brew install libgd
- brew install gtk+
- * if you want to use gEDA with PCB-RND you may want to install it as well
- via brew
- brew install homebrew/science/geda-gaf
-
-Known issues:
- - application window opens behind other windows; it seems to be a gtk bug
- that can not be worked around from the application
- - slow rendering and error messages about invalid numerics on the console
-
-Considerations listed in ../INSTALL apply.
Index: 1.1.4/doc-rnd/logo256.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/logo256.png
===================================================================
--- 1.1.4/doc-rnd/logo256.png (revision 10776)
+++ 1.1.4/doc-rnd/logo256.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/logo256.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/djopt/vianudge.txt
===================================================================
--- 1.1.4/doc-rnd/djopt/vianudge.txt (revision 10776)
+++ 1.1.4/doc-rnd/djopt/vianudge.txt (nonexistent)
@@ -1,3 +0,0 @@
-Looks for vias where all traces leave in the same direction. Tries to
-move via in that direction to eliminate one of the traces (and thus a
-corner).
Index: 1.1.4/doc-rnd/djopt/orthopull.out.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/djopt/orthopull.out.png
===================================================================
--- 1.1.4/doc-rnd/djopt/orthopull.out.png (revision 10776)
+++ 1.1.4/doc-rnd/djopt/orthopull.out.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/djopt/orthopull.out.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/djopt/unjaggy.txt
===================================================================
--- 1.1.4/doc-rnd/djopt/unjaggy.txt (revision 10776)
+++ 1.1.4/doc-rnd/djopt/unjaggy.txt (nonexistent)
@@ -1,2 +0,0 @@
-Looks for corners which could be flipped to eliminate one or more
-corners (i.e. jaggy lines become simpler).
Index: 1.1.4/doc-rnd/djopt/debumpify.pcb
===================================================================
--- 1.1.4/doc-rnd/djopt/debumpify.pcb (revision 10776)
+++ 1.1.4/doc-rnd/djopt/debumpify.pcb (nonexistent)
@@ -1,89 +0,0 @@
-# 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: 1.1.4/doc-rnd/djopt/Post.html
===================================================================
--- 1.1.4/doc-rnd/djopt/Post.html (revision 10776)
+++ 1.1.4/doc-rnd/djopt/Post.html (nonexistent)
@@ -1,4 +0,0 @@
-
auto
run all the above except miter; run them multiple times until there's no more change possible
-
-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.
-
-
-
-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.
-
-
-
argument name
description
example in
example out after 1st iteration
-
debumpify
-Looks for U-shaped traces (with 90 degree corners) that can be shortened
-or eliminated.
-
-
miter
-Replaces 90 degree corners with a pair of 45 degree corners, to reduce
-RF losses and trace length.
-
-
orthopull
-Looks for chains of traces all going in one direction, with more
-traces orthogonal on one side than on the other. Moves the chain in
-that direction, causing a net reduction in trace length, possibly
-eliminating traces and/or corners.
-
-
unjaggy
-Looks for corners which could be flipped to eliminate one or more
-corners (i.e. jaggy lines become simpler).
-
-
vianudge
-Looks for vias where all traces leave in the same direction. Tries to
-move via in that direction to eliminate one of the traces (and thus a
-corner).
-
-
viatrim
-Looks for traces that go from via to via, where moving that trace to a
-different layer eliminates one or both vias.
-
-
auto
run all the above except miter; run them multiple times until there's no more change possible
-
-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).
-
-Some concepts cschem will try to follow (marking with * where there's major
-difference to geda):
-
-
1. design
-
-
1.1. modularity, aka. toolkit approach
-
1.2. flexibility (trough attributes)
-
1.3. one schematics file is one sheet
-
1.4. multi page projects (hierarchic, flat)
-
1.5. data is in structured text files (no builtin sql support in core)
-
1.6. * the concept of a "project"; it's optional, tools can work on a set of schematics files _or_ on a complete project
-
1.7. * nets and components are uniquely identifiable using the same identifiers by all projects
-
1.8. * no excess "smartness" in the GUI editor: no slotting, no pin numbering, no auto renumbering, etc; these all should be done in the netlist layer and results fed back to the editor
-
1.9. * direct, bidirectional communication between the editor (GUI) and the netlist layer without any integration of the two, through simple and clean API, keeping both parts replaceable; attributes cschem got back from the netlister are "volatile": not saved, do not override attributes provided by the user
-
1.10. * less format-specific tricks built into the GUI code, more generic approaches (e.g. a search is a search, not a search-for-text-attribute and results on the result lists are any object of the design)
-
1.11. * slotting, pin mapping, device mapping are in backends
-
1.12. * back annotation should not be any harder than forward annotation
-
1.13. * since a lot of info is invented in backends, not in the GUI (e.g. pin numbers, when slotting), the GUI needs to be able to switch between "views": what (combination of) backend(s) to get these info from; Note: this would also provide an interactive DRC on the GUI with the DRC still implemented in the netlister!
-
1.14. * the scriptable plugin system is based on GPMI from the start to guarantee the tool is not tied to any one specific scripting engine or scripting language
-
-
2. implementation
-
-
2.1. a core library that does common things like figuring what objects are connected with net lines
-
2.2. the simple GUI editor should provide the frame; exotic functions should come from user plugins
-
2.3. a simple netlister that provides only generic (* absolutely no backend specific) queries; actual backends are implemented as plugins
-
2.4. * the core library and the netlister and the GUI core are all implemented in plain C:
-
-
2.4.1. * no dependency on any specific scripting engine or scripting language; no core functionality implemented in anything else but C
-
2.4.2. * no dependency on big "solves-everything" libraries (e.g. no glib or cairo dependency)
-
2.4.3. * the actual GUI is behind the plugin system (like PCB's HIDs)
-
2.4.4. * the first gui, in accordance with the no big libraries, will not be gtk or qt but sdl2 based; this would guarantee to have a front end that doesn't need to be rewritten every 5 years just for the sake of the rewrite
-
2.4.5. * scconfig instead of autotools: smaller, easier to maintain, works better outside of the gnu-win32 world
-
-
-
3. project management
-
-
3.1. automatic tests wherever possible, as early as possible
-
3.2. * VCS: simple, centralized svn with straight linear developement, actively trying to avoid branching
-
3.3. * near-zero-administration releases with svn commits
-
3.4. * users should be able to submit bug reports anonymously, without having to register, without having to run javascript, java applet, flash, etc.
-
-
-
-
-
-There are a lot of open questions:
-
-
q1. how buses should work
-
q2. how slotting should work (but at least we can have alternatives here)
-
q3. how hierarchical design should work
-
q4. * how the GUI should display large amount of attributes without making the whole page an unreadable mess
-
q5. flat vs. non-flat netlists - if turns out it's not just an implementation detail in a netlister backend
-
q6. * whether project file format is a custom format or just a top sch page referencing other sch pages - pcb-rnd is leading here, there is an optional project file format already defined, so this is more or less decided
-
-
-It's appealing to write parametric footprint generators for new footprint
-families: invest some time once, and have a tool that can spit out
-dozens of footprints. However, it is not always worth having a generator
-instead of static footprints. The minimal requirements for a generator are:
-
-
-
-
the footprint family is a series of footprints that can be generated
-using the same code, with changing some base properties (e.g. number of
-pins)
-
-
dimensions and other properties can be calculated from the base
-properties with reasonable formulas and conditional code; e.g. sot* is not
-a good candidate for generation, as sot23 or sot89 can not be generated
-from some common anestor by varying one or two parameters, but would need
-a large table that translates package name to a pattern - easier to keep
-those in static footprint files
-
-
has a reasonable amount of existing variations; e.g. it is not worth
-writing a generator for the dsub family because there are only a few of
-them in common use (db9, db15, db25, and maybe db37).
-
-
preferably a link to a datasheet that shows at least 3 members of the
-family; if that's not possible, separate datasheets describing at least 3
-members of the family.
-
-
-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.
-
-
-
-
-Pcb-rnd (and mainline pcb) maintains a netlist as part of the design. Pcb
-doesn't modify the netlist. The netlist is imported from an external source,
-typically from gschem. This process is called forward annotation.
-
-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.
-
-
Support in pcb-rnd: core
-Pcb-rnd gets a complete netlist. If the user could change the netlist directly,
-there should be some sort of diff tool in foo that can explain the
-changes to gschem, or a diff tool in gschem. What is worse, forward annotation
-happens much more often than back annotation and pcb-rnd would need to be able
-to merge a new netlist with local changes. The simple "gsch2pcb overwrites the
-netlist in pcb from whatever gnetlist produced" approach would not work.
-
-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
-
-The first two lines would remove pins B1 and B2 from n1 and n2. The last
-two would put them back, swapped. New nets could be created or unused nets
-could be removed using the add_net and del_net commands that have empty pinID.
-The table is ordered, rows are strictly executed from top to bottom.
-
-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
-
-would be reduced to
-
-
op
pinID
net
-
del_conn
B1
n1
-
add_conn
B1
n3
-
-Simple linear crawls on the table seems sufficient: it is expected that
-pcb designers will make netlist modifications rarely and they will back
-annotate them ASAP. In extreme cases there may be 64 bit wide bus systems that
-need total reordering; even a 4 such reorders will introduce about 1024 items
-on the list which seems not too big for O(1) algorithms. See section TODO
-for better approaches.
-
-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.
-
-
Support in pcb-rnd: GUI
-A trivial idea is to extend the netlist window so that pins can be moved in
-between nets or deleted or assigned to nets. Changes should be marked. This
-is not the preferred way of editing the netlist, tho: not much more convenient
-than making changes in gschem and doing forward annotation.
-
-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
-
look at initial rats
(empty)
-
first connect A1 to B1
(empty)
-
-
-
then realize it's very hard to connect A2 to B2 while the previous connection is there
-
he would then revert the first connection
-
and connect A1 to B2
-
which would cause shorts
-
-
(empty)
-
-
-
then he would use the "approve netlist change" hotkey/action on the network;
- this would add netlist patch commands for the A1-B2 connection,
- but would also keep the A1-B1 connection, which remains a rat; because
- of the new connection there'd be a rat between A1 and A2 or B1 and B2 too
- (all 4 pins connected together on the patched netlist at the moment!)
-
the user would then use an action (maybe the same one?) on the rat line
- so that pcb-rnd would understand that rat is not needed anymore and
- would add a patch to remove the A1-B1 connection
-
the same thing would need to happen to the A2-B2 rat
-
-An experienced user may think a few steps in advance and
-chose to first remove the A1-B1 and A2-B2 rats and then create the A1-B2
-and A2-B1 connections and then approve the two new connections.
-
-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.
-
-
Support in gschem
-Ideally there should be a very small change in gschem and an optional
-plugin script could do the rest. The plugin script would be in contant
-with foo.
-
-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:
-
-
it should have a concept of an unwanted pin-network connection; a connection
- becomes unwanted only when the back annotation says so
-
it should be able to mark unwanted connections on the active schematic page
-
it should be able to tell the user if there are unwanted connections on
- any of the pages open
-
it should be able to refresh its idea of unwanted connections while
- schematic pages are open
-
-
-Displaying unwanted connections happen at:
-
-
a pin of a component is connected to a net using a "blue line" net: mark the pin-net connection point
-
a pin is directly connected to another pin, no net line in between: mark the connection point
-
a pin is connected to a net using a pin attribute: mark the pin
-
TODO: are there more?
-
-
-TODO: there are a lot to think over about special cases related to
-multipage schematics, hierarchies, slots, split symbols.
-
-
What foo does exactly
-... is not clear yet. It depends on what sort of support gschem would provide.
-
-
Amendment 1: other parameters (1st sep)
-I originally forgot to mention my other intentions in the above document:
-back annotate non-netlist properites. It probably happened because netlist
-related stuff are the hardest to solve.
-
-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:
-
-
1. remember or note down which parts to change footprints for
-
2. go back to gschem and change them
-
3. get the changes in pcb (I use gsch2pcb and Makefiles, one step; the import menu is one step too, just another one)
-
4. disperse the new elements
-
5. find where they used to be
-
6. and then do the fiddling to fit them in
-
-
-The new process would be:
-
-
1. get the footprint replaced, in-place; this would already approve the
- change and there'd be a command for it in the patch table
-
2. do the fiddling to fit the new part in
-
3. do a back annotation
-
(4. optionally, if we go for non-automatic change of attributes in gschem,
- change them manually in gschem, cycling through the affected
- items using some UI feature)
-
-
-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.
-
-
-
-PCB has a nice action infrastructure: most user actions are
-implemented in smallish functions taking (int argc, char *argv[]). Menu
-items, hotkeys, the command line and batch processing just call these
-actions. This is the user->pcb_core direction of commands.
-
-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: 1.1.4/doc-rnd/devlog/20160921_gl.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20160921_gl.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160921_gl.html (nonexistent)
@@ -1,56 +0,0 @@
-
-
utilizing the 2d or 3d hardware acceleration of the GPU in drawing
-
transparent copper layers
-
on some CPU+GPU combination the current software rendering is slower than mainline's opengl rendering
-
-
-Why we don't have it:
-
-
I don't have a hardware+driver combination where opengl rendering works at acceptable speed
-
I have no experience with opengl programming
-
I am not much interested in changing any of the above two
-
-
-What's needed:
-
-
1. split the gtk hid into:
-
-
a generic gtk UI feature plugin (menu, widgets, controls, no drawing)
-
a gtk-gdk (software render) HID plugin that depends on the gtk feature plugin
-
an gtk-opengl HID plugin that depends on the gtk feature plugin and on the opengl utility plugin
-
-
2. get scconfig to detect opengl headers/libs
-
3. resurrect the opengl utility plugin
-
4. resurrect the opengl drawing code
-
-
-How we could have it, gtk+gl:
-
-
A. contribute: I can do 1. and 2. so you need to concentrate only on the opengl part (3. and 4.);
-
B. or donation/sponsoration:
-
-
buy the time of a random developer for point 3. and 4.; I can still do 1. and 2. in free time, scheduled with the other pcb-rnd duties
-
buy my time so I don't need to sit in my regular job but have a few days off to do all four points
-
-
-
-How we could have it, long term:
-
-
I plan to write an SDL2 based HID
-
SDL2 has transparent render support for both software and accelerated drawing, the latter probably means 2d hardware acceleration which is probably as good as direct opengl drawing would be
-
-
-What we can't do:
-
-
make transparent layers with the current gtk/gdk software render (too much effort)
-
make transparent layers with lesstif (too much effort)
-
speed up the software render
-
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s6.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s6.png
===================================================================
--- 1.1.4/doc-rnd/devlog/res/20150830b_s6.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/res/20150830b_s6.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/res/20150830b_s6.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/res/20150830b_annot.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/res/20150830b_annot.png
===================================================================
--- 1.1.4/doc-rnd/devlog/res/20150830b_annot.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/res/20150830b_annot.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/res/20150830b_annot.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/res/20150830b_annot.dot
===================================================================
--- 1.1.4/doc-rnd/devlog/res/20150830b_annot.dot (revision 10776)
+++ 1.1.4/doc-rnd/devlog/res/20150830b_annot.dot (nonexistent)
@@ -1,19 +0,0 @@
-digraph annot {
-
-
- gnetlist [shape=box]
-
- {rank=same pcb gschem spacer1}
-
- spacer1 [style=invisible]
-
- foo [shape=box]
-
- gschem -> gnetlist [label="forward1"]
- pcb -> foo [label="back1"]
-
- gschem->spacer1->pcb [style=invisible arrowhead=none]
-
- gnetlist -> pcb [label="forward2"]
- foo -> gschem [label="back2"]
-}
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s0.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s0.png
===================================================================
--- 1.1.4/doc-rnd/devlog/res/20150830b_s0.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/res/20150830b_s0.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/res/20150830b_s0.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s1.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s1.png
===================================================================
--- 1.1.4/doc-rnd/devlog/res/20150830b_s1.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/res/20150830b_s1.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/res/20150830b_s1.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s2.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s2.png
===================================================================
--- 1.1.4/doc-rnd/devlog/res/20150830b_s2.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/res/20150830b_s2.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/res/20150830b_s2.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s3.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s3.png
===================================================================
--- 1.1.4/doc-rnd/devlog/res/20150830b_s3.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/res/20150830b_s3.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/res/20150830b_s3.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s4.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s4.png
===================================================================
--- 1.1.4/doc-rnd/devlog/res/20150830b_s4.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/res/20150830b_s4.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/res/20150830b_s4.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/res/Makefile
===================================================================
--- 1.1.4/doc-rnd/devlog/res/Makefile (revision 10776)
+++ 1.1.4/doc-rnd/devlog/res/Makefile (nonexistent)
@@ -1,4 +0,0 @@
-all: 20150830b_annot.png
-
-%.png: %.dot
- dot -Tpng < $^ > $@
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s5.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/res/20150830b_s5.png
===================================================================
--- 1.1.4/doc-rnd/devlog/res/20150830b_s5.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/res/20150830b_s5.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/res/20150830b_s5.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/20150731a_menu.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20150731a_menu.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20150731a_menu.html (nonexistent)
@@ -1,59 +0,0 @@
-
-
-
-Before integrating gpmi scripting, pcb-rnd needs to be prepared to
-interface with the scripts. The engine is pretty much ready since ages:
-the action interface is ideal for scripts to register their actions or
-execute existing actions. This also means the command line and batch
-UI are instantly connected with scripts.
-
-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.
-
-
How it works
-
-PCB reads *menu.res and builds the gui on startup; the menu system is
-static after that point. pcb-rnd does the same on startup but also
-stores all menus (referenced by their paths, like "/File/Save as") in a
-hash table. Later on a call to a new hid function (create_menu()) can
-create new menus or submenus, extending the menu tree at any point.
-
-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:
-
-
there will be a new menu, called "/Plugins"
-
each plugin should have its own submenu there (gpmi for scripting: "/Plugins/GPMI scripting")
-
each script is just a child of the gpmi plugin so it should have its submenus under "Plugins/GPMI scripting/scriptname"
-
-
-As long as plugins and scripts stick to this convention, the user can
-create all the menus for all the plugins and scripts in advance. Stock
-menu res files will have the /Plugin menu at least, so its place is fixed.
-
-
Index: 1.1.4/doc-rnd/devlog/20160808_model.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20160808_model.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160808_model.html (nonexistent)
@@ -1,101 +0,0 @@
-
-
-
-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>
-
-
Improper implementation
-
-However, I see an alternative that is not as good as the real thing, but
-might be good enough that users don't see much difference. It's
-possible to implement it step by step, without long years of "nothing
-works as used to" phases. The alternative is:
-
-
-
1. Add io_lihata, first as a second native file format option, but long
-term as the primary file format; it's because we can't really extend the
-code without breaking compatibility with mainline on the .pcb format. In
-other words, we either _pretend_ we are compatible, but using any new
-feature would break compatibility (current state) or we admit that new
-features are implemented only in the lihata syntax and when you save to
-.pcb it's like saving png from gimp, losing some extra layer info. This
-step will happen either way, for other reasons.
-
-
2. rearrange some internals; the core is currently split per operation
-(e.g. there's create.c for creating all sort of objects and remove.c
-for removing them). The new setup should be per object type (e.g. arc.c
-that knows how to create or remove arcs).
-
-
3. Once lihata is in place, we can extend/rewrite some parts. An option
-is to rewrite footprint support to allow them to be sort of a small pcb
-design. So objects on arbitrary layers, footprint-in-footprint, etc.
-
-
4. When 3. is done, we could extend element handling so that pcb-rnd knows
-which element is there for why. So you could have some real elements, with
-refdes, part of the netlist, etc, but you could also do a panelization as
-a matrix of full pcb designs place like if they were elements.
-
-
-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: 1.1.4/doc-rnd/devlog/20150820b_qf.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20150820b_qf.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20150820b_qf.html (nonexistent)
@@ -1,27 +0,0 @@
-
-
-The next group of footprints I decided to generate are qfn(), tqfp(), lqfp().
-The generic set of rules for these footprints is:
-
-
there is a virtual rectangle that forms rows of pads
-
pads are evenly spaced among the edges of that rectangle
-
pin numbering is counter-clockwise
-
the body of the part may be inside of the rectangle or may extend over the pads
-
-
-
low level flexibility vs. high level comfort
-qf() currently has 14 arguments. It is flexible enough to generate qfn, tqfp,
-lqfp, and anything similar I've seen in the package datasheet of a major
-vendor. However, it is not straight forward to convert datasheet tables
-into qf() parameters.
-
-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: 1.1.4/doc-rnd/devlog/20150820a_dimensions.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20150820a_dimensions.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20150820a_dimensions.html (nonexistent)
@@ -1,24 +0,0 @@
-
-
-After attacking the qfn()/qfp() parametric footprint problem today,
-I realized fp2anim lacked a very important feature: dimension lines.
-The footprint being generated is to match the datasheet. Checking the match
-requires visible dimensions.
-
-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:
-
-
add dimension lines for dimension type input parameters
-
add dimension lines for calculated dimensions if they are likely to be informative and be included in the datasheet
-
-
-
fp2anim vector font
-While working on the dimensions, I realized I had to switch to vector fonts:
-the built-in pixel font of animator can not be rotated. The size of a vector
-font text can be calculated, which also enables fp2anim to optionally place
-semi-transparent bars behind the text to make it more visible on dark background
-(like pads).
Index: 1.1.4/doc-rnd/devlog/20160826_virtusers.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20160826_virtusers.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160826_virtusers.html (nonexistent)
@@ -1,65 +0,0 @@
-
-
-
-Pcb-rnd has an pulled-by-users policy on deciding what features to implement.
-Below I try to explain how we ended up using this policy.
-
-
Past: offer, virtual users
-
-When I started pcb-rnd, although I published it, I didn't think anyone else
-would use it. It was just about having mainline with different default
-settings.
-
-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.
-
-
Present: pull, active users
-Mid summer 2016, I switched strategy. Instead of polling the crowd, I picked
-a few users with known feature requests and asked them if they were willing to
-test pcb-rnd if I implemented their feature. More than half of them said yes
-and many of them got hooked up. They all became productive, active members
-of the pcb-rnd community.
-
-Learning from this experiece, the new strategy of pcb-rnd is as follows:
-
-
pull instead of offer: do not hope a new feature would attract users,
- rather arrange active users who then pull the project with their
- feature requests;
-
do not invest too much time in anything that is not currently pulled
- by actual, existing, active users; rather invest that time in fulfilling
- the needs of already existing users
-
reaching 100 users with an average of 0.1% activity will result in
- 0 active useres whereas reaching only 10 users with 30% activity
- will result in 3 active users; thus a small active communit around
- pcb-rnd is more efficient than the much larger geda community;
-
users really appreciate fast response on bugreports and feature requests.
- Instead of trying to impress virtual users, rather keep already interested
- users happy.
-
-
-
-
-
Index: 1.1.4/doc-rnd/devlog/20162601/poll.csv
===================================================================
--- 1.1.4/doc-rnd/devlog/20162601/poll.csv (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20162601/poll.csv (nonexistent)
@@ -1,10 +0,0 @@
-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
Index: 1.1.4/doc-rnd/devlog/20162601/poll.tsv
===================================================================
--- 1.1.4/doc-rnd/devlog/20162601/poll.tsv (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20162601/poll.tsv (nonexistent)
@@ -1,10 +0,0 @@
-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
Index: 1.1.4/doc-rnd/devlog/20162601/header.csv
===================================================================
--- 1.1.4/doc-rnd/devlog/20162601/header.csv (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20162601/header.csv (nonexistent)
@@ -1 +0,0 @@
-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!],,
\ No newline at end of file
Index: 1.1.4/doc-rnd/devlog/20162601/header
===================================================================
--- 1.1.4/doc-rnd/devlog/20162601/header (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20162601/header (nonexistent)
@@ -1,11 +0,0 @@
-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!]
-
Index: 1.1.4/doc-rnd/devlog/20162601/poll.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20162601/poll.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20162601/poll.html (nonexistent)
@@ -1,24 +0,0 @@
-
-
-
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!]
-
-
-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 source of these problems is that glib is a "megalib" that tries to solve
-a host of problems as a package.
-
-
The solution
-
-The solution is to replace the megalib with
-a set of independent minilibs. Each minilib:
-
-
tries to do one thing - e.g. linked lists, without coupling it with a custom memory allocator
-
is simple - the API is so small that it's easy to learn it in minutes
-
is small - so that if anything breaks it's very easy to find and fix the bug (when did you last debug internals of glib?)
-
is replaceable - since they are independent, if one doesn't work up to expectations, it's real easy to replace it without affecting any other part; e.g. replacing linked lists without replacing hash tables
-
-
-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.
-
-
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:
-
-
the GTK HID: because gtk is already coupled with glib, it doesn't make much sense to remove glib from the gtk HID code
-
the toporouter plugin: the code is huge and will be potentially deprecated anyway (lack of developer resources/user interest)
-
the puller: glib should be removed from the puller long term but the code is big and there's no much user need for it in pcb-rnd
-
-
-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: 1.1.4/doc-rnd/devlog/20151028_glib.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20151028_glib.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20151028_glib.html (nonexistent)
@@ -1,65 +0,0 @@
-
-
-
-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.
-
-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.
-
-
glib is not a lib that tries to solve something, it is a prorgamming
-environment that tries to supersede C.
-
-
As such, it feels free to mess with the environment, redefine C
-keywords as it sees fit, because once you use glib, why would you use
-anything else? And once you use glib, you are programming in glib, not in
-"plain C".
-
-
Grepping through the pcb-rnd code, I see that pcb-rnd does not try to
-use glib as a programming environment, but needs only 2 and a half
-features: hash, list and rarely dynamic strings. Any other glib call is
-just a must that had to be done that way to get hashes and lists working.
-
-
genht is 510 sloc. I have a generic list implementation (which, by the
-way, is more efficient than glib's) It costs 256 sloc. So having
-type-independent hashes and lists in C89 costs less than 800 lines of code
-if you pick the right libs. Glib's include/ alone is over 24000 sloc!
-And in return glib breaks inline...
-
-
-
-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: 1.1.4/doc-rnd/devlog/20160126.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20160126.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160126.html (nonexistent)
@@ -1,59 +0,0 @@
-
-
-
-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).
-
-Raw results are available in html, tsv and
-csv format.
-
-
My interpretation
-
-(User obviously means "those users who answered the poll")
-
-
-
1. only half of the users would consider even trying pcb-rnd for blind/burried vias
-
2. there was only one user who'd consider switching to pcb-rnd for blind-burried vias - this feature doesn't seem to be valuable enough to attract users (details below)
-
3. about half of the users need blind/burried via; when they do, they don't use pcb
-
4. 9 out of 10 users runs PCB on Linux
-
-
-
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.
-
-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: 1.1.4/doc-rnd/devlog/20160802.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20160802.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160802.html (nonexistent)
@@ -1,25 +0,0 @@
-
-
-
-Reflecting to (but not joining) the annual geda-user language/libs debate,
-the policy of pcb-rnd (and later cschem) on this:
-
-
the core part of the code is in C - not in C++, C#, cobol, ada, haskell, etc.
-
external dependencies are minimized, especially core shouldn't depend on too many external libs and tools (e.g. core shouldn't depend on glib)
-
core doesn't know anything about [turing complete] scripting languages, user scripting is provided by a plugin
-
the scripting plugin does not attempt to restrict the user to My Favorite Language - it rather supports 10+ different languages, from ruby through awk through python to lua; it even supports an older version of guile; all languages are options.
-
-The above set of rules is crafted so that compiling core functionality is easy
-and excess external libs (gtk, glib) are needed only for optional features
-(such as the gtk hid in pcb-rnd). However, it's equally important not to
-restrict users in optional extras that may require more dependencies. This is
-solved by minimizing core and moving functionality behind APIs in a plugin
-system.
-
-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: 1.1.4/doc-rnd/devlog/20160409/pie_col_3.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/20160409/pie_col_3.png
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/pie_col_3.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/pie_col_3.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/20160409/pie_col_3.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/20160409/poll.csv
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/poll.csv (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/poll.csv (nonexistent)
@@ -1,9 +0,0 @@
-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: 1.1.4/doc-rnd/devlog/20160409/pie_col_4.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/20160409/pie_col_4.png
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/pie_col_4.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/pie_col_4.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/20160409/pie_col_4.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/20160409/poll.tsv
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/poll.tsv (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/poll.tsv (nonexistent)
@@ -1,9 +0,0 @@
-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: 1.1.4/doc-rnd/devlog/20160409/pie_col_5.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/20160409/pie_col_5.png
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/pie_col_5.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/pie_col_5.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/20160409/pie_col_5.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/20160409/header.csv
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/header.csv (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/header.csv (nonexistent)
@@ -1 +0,0 @@
-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: 1.1.4/doc-rnd/devlog/20160409/pie_col_7.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/20160409/pie_col_7.png
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/pie_col_7.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/pie_col_7.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/20160409/pie_col_7.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/20160409/header
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/header (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/header (nonexistent)
@@ -1,7 +0,0 @@
-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: 1.1.4/doc-rnd/devlog/20160409/poll.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/poll.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/poll.html (nonexistent)
@@ -1,98 +0,0 @@
-
-
-
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
-
-
-
-
-
-
-
-
-
-
-
-
-
Legend
-
-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: 1.1.4/doc-rnd/devlog/20160409/legend.txt
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/legend.txt (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/legend.txt (nonexistent)
@@ -1,60 +0,0 @@
-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: 1.1.4/doc-rnd/devlog/20160409/pie_col_1.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/20160409/pie_col_1.png
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/pie_col_1.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/pie_col_1.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/20160409/pie_col_1.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/20160409/pie_col_2.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/devlog/20160409/pie_col_2.png
===================================================================
--- 1.1.4/doc-rnd/devlog/20160409/pie_col_2.png (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160409/pie_col_2.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/devlog/20160409/pie_col_2.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/20160314_valgrind_flex.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20160314_valgrind_flex.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160314_valgrind_flex.html (nonexistent)
@@ -1,79 +0,0 @@
-
-
-
-
-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.
-
-A typical valgrind log for such a leak looks like this:
-
-==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.
-
-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:
-
-
remove the header lines one by one and see if the leak is still there - won't work if a missing header changes how the whole code runs
-
change the size of each header, one by one, and see which action changes leak size - a lot of iterations, and valgrinding is slow
-
-
-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):
-
-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: 1.1.4/doc-rnd/devlog/20160716_sprint.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20160716_sprint.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20160716_sprint.html (nonexistent)
@@ -1,81 +0,0 @@
-
-
-
-
-Please start with procedure I and proceed to procedure II then to procedure III.
-You can postpone or stop any time, even partial results are useful.
-
-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:
-
-
an svn client (e.g. apt-get install subversion)
-
a C compiler (e.g. apt-get install gcc - anything that supports C99 should work)
-
the normal development libs (e.g. libc)
-
extra libs depending on your desired setup (e.g. libgtk2-0-dev)
-
make
-
-
-
I. Setup [10..30 minutes]
-
-
Objective: get a running pcb-rnd.
-
steps:
-
-
1. check out the code in a new directory: svn checkout svn://repo.hu/pcb-rnd/trunk
-
2. configure: cd trunk; ./configure
-
3. check the summary the last step produced; if you don't like it or anything is suspicious, consult Igor2 on IRC
-
4. compile: cd trunk; make
-
5. check if the compilation terminated with error (->Igor2 on IRC)
-
6. dry run: cd trunk/src; ./pcb-rnd
-
7. check if it generally runs as expected (note: there's no opengl, the menu layout and some default settings are slightly different)
-
8. please report even if everything worked: it's for the record/statistics; please include, in your report:
-
-
a. your system: uname -a
-
b. whether you used the gtk HID or the lesstif HID or both
-
-
-
-
-
II. Test drive [30..60 minutes]
-
-
-
Objective: find random bugs and make suggestions via a simulated production test drive.
-
steps:
-
-
1. take on of your existing .pcb (preferably one that you can share in case of a bugreport is needed)
-
2. copy the .pcb to trunk/src as foo.pcb
-
3. run cd trunk/src; ./pcb-rnd foo.pcb
-
4. pretend carrying out a real modification; e.g. replace one of the ICs with a footprint of the same pin count but different dimensions (e.g. so8 -> ssop8 or sot23->to220). Pretend you really want to do this modification and pretend that the board will go in production. Do your usual routine (e.g. check gerbers).
-
5. if you see anything strange, find bugs, have suggestions:
-
-
a. consult Igor2 on IRC
-
b. if there are files to be "attached" or your observation/question can only be stated in a medium sized novel, please send an email to pcb-rnd (at) igor2.repo.hu (and then we can still discuss it on IRC)
-
c. it is sometimes worth checking the behavior of a recent mainline pcb; there are bugs and oddities present in both current mainline and pcb-rnd (because of the common ancestor)
-
-
-
-
-
III. Systematic testing [60..90]
-
-
Objective: systematic testing of specific features that are affected
- by recent code rewrite/development.
-
steps:
-
-
1. contact Igor2 on IRC to get a chunk of the tests
-
2. understand the subsystem in question (from user perspective)
-
3. use your fantasy to invent test methods to see whether the
- subsystem works in common or normal use cases
-
4. use your fantasy to invent test methods to see whether the
- subsystem works in corner cases
-
5. report anything that seems like a bug or undesired behavior or regression
-
6. please do report if there's no bug and the given subsystem
- worked as expected; positive results are just as important as negative ones
-
-
-I received 9 partial 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).
-
-Raw results are available in html, tsv and
-csv format.
-
-
My interpretation
-
-(User obviously means "those users who answered the poll")
-
-
-
1. very few users use the lesstif hid, still user count is more than 1
-
2. users are open to try alternative menu/hotkey layouts...
-
3. ... and only a few users change the default layout
-
4. ... because they are happy with the defaults and/or don't want to maintain the diffs on upgrades
-
5. there is a strong demand for multikey in the GTK HID
-
7. use of vendor (drill) mapping is rare
-
-
-
My conclusions
-pcb-rnd: the GTK HID needs multi-key support.
-
-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: 1.1.4/doc-rnd/devlog/20161014_cleanup.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20161014_cleanup.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20161014_cleanup.html (nonexistent)
@@ -1,35 +0,0 @@
-
-
-This is a long term plan (these will happen slowly, step-by-step, gradually, in
-the background, in parallel with the normal schedule of development:
-
-
phase 0: port the rest [almost done]
-
-
import the remaining plugins and exporters before the big cleanup because it's cheaper to port them now
-
-
phase 1: reorg
-
-
reorganize the code: from action-oriented (e.g. change.c, remove.c, mirror.c) into object-type-oriented code (e.g. obj_line.c, obj_arc.c)
-
global*.h must be dissolved/removed
-
macro.h should be dissolved/removed
-
const.h should be reduced to 1/3
-
-
phase 2: clean the namespace
-
-
pcb_ prefixes
-
unify convention: underscores instead of CamelCase, prefer shorter names
-
better connection between file name and function name prefixes (don't invent 3 different names for the same thing)
-
-
phase 3: split & pack
-
-
move out generic, non-pcb-specific code to "external libs" (e.g. polygon, heap, the conf system)
-
determine layering of the new lib system (e.g. a generic unit, printf, etc. util lib on layer 0, then a lib about the basic object types on layer 1, then footprint libraries and other plugins on layer 2)
-
compile one .a file per layer, link the final executable using those .a files
-
make the libs installable, together with the headers
-
-
-The file a CAD program loads and saves is likely to end up in a Version
-Control System (VCS) sooner or later. To make VCS more meaningful, the
-changes to the file need to be minimal and relevant. For example in a
-load-save round trip (i.e. load the file in the CAD and save it in another
-file without any modification) the diff should be empty. If the user adds a new
-object, the diff should contain only lines added for the new object. (And maybe
-a few lines of changes in an index, if there's an index, but I believe it's
-better if there's no index.) Likewise, if an object is deleted, it is expected
-to result a few lines removed, preferably at a single location.
-
-
-Terminology used in this document:
-
-
file is the data file, represented in a structured text format;
- for the whole document except for the last chapter, any format may work:
- xml, json, ini, lihata, etc.
-
node a data node; may be:
-
-
a leaf node with payload: an actual data item (like a number)
-
a hash that contains an unordered set of other named nodes
-
a list is an ordered list of named or unnamed nodes
-
-
-
-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.
-
-
Problem #0: order
-To achieve the above goals, both gschem and pcb and pcb-rnd are prudent:
-objects are ordered in memory. This is necessary because in an unordered
-list or hash if the number of objects changes (objects added or removed)
-the saving order may shuffle, causing a lot of unnecessary changes.
-
-This problem is already solved.
-
-
Problem #1: canonical form
-Our file formats are plain text. While there are certain constructs that have
-strict format, e.g. a string in quotes can be described only one way without
-changing the content of the string, other parts have alternatives:
-
-
white spaces and other field separators
-
numerical formats: is 8 the same as 08 or 8.0?
-
pcb flag formats, old/new style: the same object can be described
- using different syntax constructions, sometimes resulting the same
- object
-
-
-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.
-
-
Problem #2: hand editing, external scripts
-However, the canonical format is not always the most convenient for the user.
-Sometimes different indentation, maybe even locally, may improve readability.
-Unfortunately a CAD round-trip brings back the file to canonical format, removing
-any user formatting. Or in other words, the user needs to learn the syntax
-of the file format and how the canonical format looks like, else user
-changes to a file may cause VCS noise later.
-
-Even worse, 3rd party scripts need to learn the canonical format too, for the
-same reason.
-
-
-
The solution
-One solution is to merge the canonical format and the syntax, so the resulting
-specification is so strict that there are no alternatives but everything can
-be written using only a single, well described format. This solves problem
-#1 and #2, but creates problem #3: a text file format as rigid as a binary
-format would be. While it could be still parsed by text tools easily, it
-would be much harder to emit properly using the same tools or even harder to
-edit manually, with a text editor. In this sense it may start losing its
-most important text-file-property: free form, to some extent.
-
-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.
-
-
How to implement it (in theory)
-A few unusual features are required:
-
-
F1: the parser needs to be aware of otherwise unimportant
- characters (e.g. whitespace in indentation)
-
F2: if (payload) data is to be converted to a native format by
- the program, the original text representation needs to be saved;
- e.g. the input file contains 4.99999999, the program loads it to
- a float and later saved back, it may end up as 4.999997836;
- instead if the data did not change, the original text shall be
- saved back; this also solves the 005 vs 5 vs 5.0 problem
-
F3: new data should be inserted, obsolete data should be removed
- without reordering stationary data
-
-
-
The obvious approach
-An obvious approach would be to smarten the parser and store delimiters
-(e.g. whitespace) and the original text version for each data node, along with
-the order of nodes in the original file.
-
-
The less obvious approach
-A second approach is to ignore these details on load and keep on storing data
-in native binary format in memory. On save, start parsing the original file
-(or a snapshot of it taken load-time), and:
-
-
any non-data-payload character should be copied the the output;
- this includes whitespace, delimiters, comments, syntax sugar;
- this solves F1
-
if a node did not change, the parser copies it byte-to-byte to
- the output (solves F2 partially - no format change if data is
- unchanged in memory);
-
value change check: while parsing, convert the original value to
- native format again and compare, which solves F2: the same
- string->native conversion should yield the same native result;
- if our in-memory representation differs, it has changed and the
- new value should be copied to the output instead of the old value;
- the format of the new value doesn't matter, can be canonical, since
- the diff is already caused by the fact that the value has changed.
-
if the language supports ordered lists: before emitting list items,
- the input list must be read through (pre-read) and the in-memory and
- just-parse lists need to be compared to detect changes in order;
- existing list items are copied as described above; list items
- deleted in-memory are ignored; list items added in-memory are
- written out (solves F3)
-
if the language supports unordered hashes: check each key parsed;
- if it exists in-memory, copy/write it normally; if it doesn't,
- delete it; add new hash items (the ones present in-memory but
- not seen when the parser reaches the end of the hash; solves F3)
-
-
-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:
-
-
essentially the whole file needs to be stored in-memory
- (for whitespace), but not in one bug chunk but in many
- little chunks among with the data nodes (which leads to
- allocation overhead); the original values need to be stored in
- text too, to solve the numeric problems
-
either the same string->native conversion needs to be done using
- stored text values; or the code needs to keep track of which node
- changed using some data-changed bit
-
the same list/hash merging needs to be done
-
-
-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.
-
-
-
An even less obvious approach
-Take the previous method, but assume the application does not change the
-order of objects on ordered lists and each object has some sort of unique
-identifier (so two identical looking objects can't be on a list).
-This makes list merging much simpler and doable in a single pass, keeping
-a list item pointer with the in-memory list:
-
-
initialization: set the pointer to the first element of the list
-
iteration: parse the first (next) item of the list
-
check if it exists in-memory and is the first
-
-
if yes, copy from the original file, increase the pointer by
- one element
-
if not, check if it got deleted (not present on the list
- in-memory) and skip it if so; pointer stays in place
-
if not, check if it is on the in-memory list as a later entry;
- if so, insert all preceding entries from the in-memory list,
- increasing the pointer by one for each element written
-
-
repeat the iteration until there are no more items on the input list
-
check if there are items remaining from the pointer, if so output
- them (they will end up at the end of the list in the output file)
-
finished: the output file's list now matches the in-memory list.
-
-
-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.
-
-
How it is implemented in practice
-Using the last approach from the above list, with an utility library for
-lihata. The full list of requirements (on the application and the tree
-structure):
-
-
the root element of the input file and the in-memory representation
- must fully match
-
list items must have names that are unique to the list, even across
- item removal from the list within a session (so a newly added item
- never has the same name as a past item parsed back from the file)
-
the application must not change the order of elements on a list -
- new elements may be inserted anywhere and old elements may be
- removed from anywhere but the order of any two remaining old
- elements must be preserved
-
-Most of the infrastructure for a scriptable pcb had been there in pcb-gpmi.
-I had also finished some gpmi cleanup and pcb
-(menu and
- events ) subprojects last week.
-These made it easier to get to reach the current status after a weekend
-coding marathon:
-
import, test, extend the glue layer; scripts can:
-
-
register new actions
-
create new menus and submenus
-
execute existing actions
-
pop up simple dialog boxes (message, report, progress bar, file selection) -- check out the video
-
build and pop up custom dialog boxes (so called attribute dialogs)
-
search for objects (lines, arc, polys, vias, etc.) on the layout
-
create new objects on the layout
-
change "page" properties (dimensions of the board)
-
debug draw on the gui (slightly broken on gtk due to some gtk hid bugs)
-
-
-
-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: 1.1.4/doc-rnd/devlog/20150731b_gtk.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20150731b_gtk.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20150731b_gtk.html (nonexistent)
@@ -1,36 +0,0 @@
-
-
-As described in the previous post,
-pcb-rnd will feature dynamic menus. I first implemented this in the
-gtk hid.
-
-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:
-
-
I am really adding the new widgets...
-
... under the right parent
-
... with the right properties
-
-Then I also printed allocated dimensions and coordinates - but the values
-were misleading. Finally I figured there was different flags like realization
-and visibility, so printed them too. This revealed that all my new menus were
-there in an invisible state.
-
-
Footnotes
-1: not because of the show() call, but because of the way objects
-are stored in memory: too many generic pointers casted forth and back, makes it
-really hard to print all properties of a menu item (including its label)
-with gdb.
Index: 1.1.4/doc-rnd/devlog/poll_common/genpie.sh
===================================================================
--- 1.1.4/doc-rnd/devlog/poll_common/genpie.sh (revision 10776)
+++ 1.1.4/doc-rnd/devlog/poll_common/genpie.sh (nonexistent)
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-gen()
-{
- awk -F "[\t]" -v "col=$1" '
- BEGIN {
- if (col < 0) {
- col = -col
- keep_na = 1
- }
- }
- {
- val=$col
- if (val == "-") {
- if (keep_na)
- val="n/a"
- else
- next
- }
- split(val, VAL, "[+]")
- for(n in VAL) {
- VOTE[VAL[n]]++
- }
- }
-
- END {
- for(n in VOTE) {
- print "@slice\n" VOTE[n]
- print "@label\n" n
- }
- }
- '
-}
-
-for n in $*
-do
- (gen $n < poll.tsv | animpie && echo "screenshot \"pie_col_$n.png\"") | animator -H -x 150 -y 150
-done
Property changes on: 1.1.4/doc-rnd/devlog/poll_common/genpie.sh
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: 1.1.4/doc-rnd/devlog/poll_common/genhtml.sh
===================================================================
--- 1.1.4/doc-rnd/devlog/poll_common/genhtml.sh (revision 10776)
+++ 1.1.4/doc-rnd/devlog/poll_common/genhtml.sh (nonexistent)
@@ -1,54 +0,0 @@
-#!/bin/sh
-(
-echo '
'
-echo "
"
-sed "s@^@
@" < header
-sed "s@^@
@;s@\t@
@g" < poll.tsv
-echo "
"
-hl=`wc -l < header`
-for n in `seq $hl`
-do
- ./genpie.sh $n
- fn=pie_col_$n.png
- if test -f "$fn"
- then
- echo "
-I've been working on the documentation for pcb-rnd scripting lately.
-Proof reading and comments would be appreciated. The documents are
-work-in-progress.
-
-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: 1.1.4/doc-rnd/devlog/20150830a_fork_faq.html
===================================================================
--- 1.1.4/doc-rnd/devlog/20150830a_fork_faq.html (revision 10776)
+++ 1.1.4/doc-rnd/devlog/20150830a_fork_faq.html (nonexistent)
@@ -1,257 +0,0 @@
-
-
-
-This document contains my short answers to questions commonly popping up
-in endless flamewars on the geda mailing list. The purpose of this
-document is not to convince anyone about any of the questions, only
-to save me some time typing the same answers when someone asks me
-one these questions for the 100th time. As I don't want to convince you
-that my answers are the best ones, please don't try to convince me that
-they are bad. Been there, done that, never worked in either way: e.g.
-I never convinced any git fanboy to switch to svn, and they never
-convince me to switch to git.
-
-
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-
-In version 1.0.8 and 1.0.9 a cosiderable chunk of core code has been moved into
-core plugins. A core plugin is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-
-
to compile it as a buildin (static-link it into the pcb executable)
-
to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
-
to disable the plugin, so it is not compiled at all
-
-
-I believe such modularization has benefits on multiple levels:
-
-
it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
-
in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
-
such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-
-
-
Progress in charts
-
Before-after
-All numbers are in SLOC
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-
-
-
-
Before modularization: pcb-rnd version 1.0.7
- Note: gpmi was already a plugin
-
-
After modularization: pcb-rnd version 1.0.9
- Note: gpmi is part of the "plugins" slice
-
-
-
Zooming on to the plugins
-
-
-
-(Red means the plugin doesn't really work).
-
-
Progress in numbers
-Below is a table with the summary of core plugins.
-
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-
-In version 1.0.8 and 1.0.9 a cosiderable chunk of core code has been moved into
-core plugins. A core plugin is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-
-
to compile it as a buildin (static-link it into the pcb executable)
-
to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
-
to disable the plugin, so it is not compiled at all
-
-
-I believe such modularization has benefits on multiple levels:
-
-
it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
-
in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
-
such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-
-
-
Progress in charts
-
Before-after
-All numbers are in SLOC
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-
-
-
-
Before modularization: pcb-rnd version 1.0.7
- Note: gpmi was already a plugin
-
-
After modularization: pcb-rnd version 1.0.9
- Note: gpmi is part of the "plugins" slice
-
-
-
Zooming on to the plugins
-
-
-
-(Red means the plugin doesn't really work).
-
-
Progress in numbers
-Below is a table with the summary of core plugins.
-
-
module
size [sloc]
status
configure default
description
-
-
-
autoplace
612
-
works
-
buildin
-
Automatically place elements.
-
autoroute
4337
-
works
-
buildin
-
Automatically route selected or all rats. This is the original autorouter.
-
dbus
438
-
disabled
- (TODO: needs scconfig support)
-
disabled
-
Remote control PCB using DBUS.
-
djopt
2320
-
works
-
buildin
-
Various board optimization algorithms.
-
export_bom
374
-
works
-
buildin
-
Export bom (Bill of Materials)
-
export_gcode
2452
-
works
-
buildin
-
Export to gcode
-
export_gerber
972
-
works
-
buildin
-
Export to gerber
-
export_lpr
96
-
works
-
buildin
-
Export to lpr (using export_ps to generate postscript)
-
export_nelma
685
-
works
-
buildin
-
Export to nelma (Numerical capacitance calculator)
-
export_png
1107
-
works
-
buildin
-
Export to png, gif and jpeg
-
export_ps
1613
-
works
-
buildin
-
Export postscript or embedded postscript.
-
fontmode
163
-
works
-
buildin
-
Font editing actions.
-
gpmi
3003
-
works
-
buildin
- (if gpmi is installed)
-
Scriptable plugin system with about 10 scripting languages supported and dynamic load/unload of scripts that can manipulate the GUI, the board, can implement exporters, etc.
-
import_edif
3578
-
works
-
buildin
-
Import code for netlists in the EDIF format.
-
import_sch
259
-
works
-
buildin
-
Imports element and netlist data from the schematics (or some other source).
-
legacy_func
72
-
works
-
buildin
-
Random collection of old/obsolete (legacy) functions. 3rd party plugins may depend on them. This module implements C functions and variables and does not register actions or flags.
-
mincut
886
-
works
-
buildin
-
Use the minimal cut algorithm to indicate shorts: instead of highlighting two random pins/pads, try to highlight the least number of objects that connect the two networks.
-
oldactions
57
-
works
-
disabled
-
Random collection of old/obsolete actions. Bell(): audible feedback; DumpLibrary(): print footprint library on stdout
-
puller
1884
-
works
-
buildin
-
Pull traces to minimize their length.
-
renumber
222
-
works
-
buildin
-
Renumber elements (renaming them) and generate a text file for back annotation.
-
stroke
124
-
partially works (doesn't work with lesstif; works with the gtk hid, but there's no zoom bindings)
-
disabled
- (requires libstroke installed)
-
Gesture recognition with libstroke.
-
toporouter
6165
-
fails
- (infinite loop in gts)
-
disabled
-
Automatically route selected or all rats using a topological algorithm. This is the new autorouter from 2009.
-
vendordrill
572
-
works
-
buildin
-
Vendor drill mapping.
-
-
-
Index: 1.1.4/doc-rnd/wishlist.txt
===================================================================
--- 1.1.4/doc-rnd/wishlist.txt (revision 10776)
+++ 1.1.4/doc-rnd/wishlist.txt (nonexistent)
@@ -1,32 +0,0 @@
-Active user wishes:
- W1: cschem [Chris]
- W2: proper primitives [Chris]
- W3: more generic footprints [Chris, Evan]
- W4: user doc [Miloh]
- W5: 3d modeller export [Miloh, Evan]
- W6: GUI access to object attributes: gtk editor, find/select by attrib [James]
- W7: programmable drc (star grounding) [James]
- W8: gl support [Erich, Evan]
- W9: push & shove [Erich, Evan]
-
-Plan (parallel threads of development):
-
- A. file format and model
- Steps:
- 1. lihata persistency
- 2. native lihata file format
- 3. extend the file format
- - everything should have an attribute hash -> W6
- - footprints should have optional attachments (e.g. 3d models) -> W5
- This helps us testing out the persistent-lihata idea that'd be
- later used in chscem from the start -> W1
- This is also needed for more generic footprint implementation -> W3
-
- B. visible attribute support
- Steps:
- 1. GTK dialog box for attribute edition
- 2. search & select should work by attribute
- 3. extend the routing style system to auto-add attributes
- (this needs A., the new file format)
- Allows the user to manage properties like "50 ohm net" in attributes,
- to group objects by property, and to select them by property. -> W6
Index: 1.1.4/doc-rnd/mods3/gen.sh
===================================================================
--- 1.1.4/doc-rnd/mods3/gen.sh (revision 10776)
+++ 1.1.4/doc-rnd/mods3/gen.sh (nonexistent)
@@ -1,125 +0,0 @@
-#!/bin/sh
-
-path=../../src_plugins
-
-sloc()
-{
- (cd "$1" && sloccount .) | awk '/^Total Phys/ { size=$9; sub(",", "", size); print size }'
-}
-
-gen_pie()
-{
- local bn=$1 code_size=$2 color=$3
- echo ""
- echo "@slice"
- echo "$code_size"
- echo "@label"
- echo "$bn ($code_size)"
- if test ! -z "$color"
- then
- echo "@color"
- echo "$color"
- fi
-}
-
-echo "#autogenerated by gen.sh" > mods.pie
-echo "#autogenerated by gen.sh" > after.pie
-
-echo Core >&2
-tmp=/tmp/pcb-mods-stat
-mkdir $tmp
-cp -r ../../src/*.c ../../src/*.h ../../src/Makefile* $tmp
-code_size=`sloc $tmp`
-gen_pie "core" $code_size "#00ff88" >> after.pie
-
-#echo 3rd >&2
-#code_size=`sloc ../../src_3rd`
-#gen_pie "3rd" $code_size >> after.pie
-
-
-(
-cat pre.html
-for n in $path/*
-do
- if test -d "$n"
- then
- echo $n >&2
- bn=`basename $n`
- code_size=`sloc $n`
- total=$(($total + $code_size))
- gen_pie $bn $code_size >> mods.pie
-# case $bn in
-# gpmi) echo "@pull" >> mods.pie; echo "0.1" >> mods.pie;;
-# esac
-
- echo "
" desc
- }
- ' < $n/README
- fi
-done
-cat post.html
-gen_pie "plugins" "$total" "#0088ff" >> after.pie
-) > index.html
-
-for n in mods after
-do
- animpie < $n.pie | animator -H -d $n
- pngtopnm ${n}0000.png | pnmcrop | pnmtopng > $n.png
- rm ${n}0000.png
-done
-
Property changes on: 1.1.4/doc-rnd/mods3/gen.sh
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: 1.1.4/doc-rnd/mods3/after.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/mods3/after.png
===================================================================
--- 1.1.4/doc-rnd/mods3/after.png (revision 10776)
+++ 1.1.4/doc-rnd/mods3/after.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/mods3/after.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/mods3/before.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/mods3/before.png
===================================================================
--- 1.1.4/doc-rnd/mods3/before.png (revision 10776)
+++ 1.1.4/doc-rnd/mods3/before.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/mods3/before.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/mods3/mods.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/mods3/mods.png
===================================================================
--- 1.1.4/doc-rnd/mods3/mods.png (revision 10776)
+++ 1.1.4/doc-rnd/mods3/mods.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/mods3/mods.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/mods3/post.html
===================================================================
--- 1.1.4/doc-rnd/mods3/post.html (revision 10776)
+++ 1.1.4/doc-rnd/mods3/post.html (nonexistent)
@@ -1,17 +0,0 @@
-
-
-
Classes
-Each plugin implements a class (rarely a set of classes). Classes are:
-
-
name
description
-
(feature)
random features directly accessible for the user, usually actions
-
(lib)
support code library for other plugins (core doesn't depend on these); functionality not directly accessible for the user but other plugins may depend on it
-
hid
Human Interface Device: interactive user interface, usually GUI
-
import
load alien formats into the design space
-
export
save (parts of) the design space in alien formats
-
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-
-In version 1.0.8 to 1.1.0 a cosiderable chunk of core code has been moved into
-core plugins. A core plugin is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-
-
to compile it as a buildin (static-link it into the pcb executable)
-
to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
-
to disable the plugin, so it is not compiled at all
-
-
-I believe such modularization has benefits on multiple levels:
-
-
it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
-
in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
-
such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-
-
-
Progress in charts
-
Before-after
-All numbers are in SLOC
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-
-
-
-
Before modularization: pcb-rnd version 1.0.7
- Note: gpmi was already a plugin
-
-
After modularization: pcb-rnd version 1.1.0
- Note: gpmi is part of the "plugins" slice
-
-
-
Zooming on to the plugins
-
-
-
-(Red means the plugin doesn't really work).
-
-
Progress in numbers
-Below is a table with the summary of core plugins.
-
-I believe good software should be modular. This is especially important in
-the context of large software, such as CAD applications. There should be
-a thin core that can model the world and provide the basic operations defined
-on it but anything else should go in separate modules.
-
-Fortunately PCB already had a strong infrastructure supporting this idea.
-It has dynamic loadable plugins and the GUI and exporters are in separate
-HID modules. While working on pcb-gpmi and later pcb-rnd, I added the
-gpmi module as a separate plugin.
-
-In version 1.0.8 to 1.1.0 a cosiderable chunk of core code has been moved into
-core plugins. A core plugin is just a plugin that is
-maintained together with the core, in the same repository, still the code is
-somewhat detached from the core. More importantly, the user can choose, for
-each plugin, separately:
-
-
to compile it as a buildin (static-link it into the pcb executable)
-
to compile it as a plugin (dynamic-link it runtime, if the .so is installed in the plugins/ directory)
-
to disable the plugin, so it is not compiled at all
-
-
-I believe such modularization has benefits on multiple levels:
-
-
it is possible to compiler smaller, potentially faster executables by omitting features the specific user would never use anyway
-
in a distribution dynamic-link plugins can be distributed as separate packages providing the user with the option to decide what features to install
-
such plugins have to have some sort of APIs if they want to reference eachother or if the code needs to reference them; such an API may not (and often did not) exist when the code is part of the core
-
-
-
Progress in charts
-
Before-after
-All numbers are in SLOC
-and are acquired running sloccount on the given directory. While lines of
-code alone is not a true measure of complexity, it's a good estimation. The
-slices of pie charts are the major components of the pcb-rnd executable.
-
-
-
-
Before modularization: pcb-rnd version 1.0.7
- Note: gpmi was already a plugin
-
-
After modularization: pcb-rnd version 1.1.0
- Note: gpmi is part of the "plugins" slice
-
-
-
Zooming on to the plugins
-
-
-
-(Red means the plugin doesn't really work).
-
-
Progress in numbers
-Below is a table with the summary of core plugins.
-
-
module
size [sloc]
status
configure default
class
description
-
-
-
autocrop
158
-
works
-
buildin
-
(feature)
-
Reduce the board dimensions to just enclose the elements.
-
autoplace
614
-
works
-
buildin
-
(feature)
-
Automatically place elements.
-
autoroute
4343
-
works
-
buildin
-
(feature)
-
Automatically route selected or all rats. This is the original autorouter.
-
boardflip
131
-
WIP
- (doesn't update rtrees)
-
disabled
-
(feature)
-
All objects on the board are up-down flipped.
-
dbus
483
-
WIP
- (needs to install the xml?)
-
disabled
-
(feature)
-
Remote control PCB using DBUS.
-
diag
162
-
works
-
disabled
-
(feature)
-
Actions for pcb-rnd core diagnostics, intended for developers. These are not in core because end users normally don't need these. As a plugin, due to dynamic loading, it can be dropped on an existing pcb-rnd installation with minimal risk of scaring away a reproducible bug.
-
distalign
428
-
works
-
buildin
-
(feature)
-
Introducing Align() and Distribute(), which work much like the similarly named functions in Visio. Given that PCB does not have the concept of "first selected object" to draw on, the reference points can be selected by arguments.
-
distaligntext
466
-
works
-
buildin
-
(feature)
-
Same as distalign, operates on text objects.
-
djopt
2320
-
works
-
buildin
-
(feature)
-
Various board optimization algorithms.
-
export_bboard
426
-
WIP
-
disabled
-
export
-
Export breadboard
-
export_bom
230
-
works
-
buildin
-
export
-
Export bom (Bill of Materials)
-
export_dsn
443
-
Work-in-progress
-
disable
-
export
-
Export specctra .dsn files
-
export_dxf
3992
-
WIP
-
disabled
-
export
-
Export dxf
-
export_gcode
2466
-
works
-
buildin
-
export
-
Export to gcode
-
export_gerber
971
-
works
-
buildin
-
export
-
Export to gerber
-
export_ipcd356
468
-
Work-in-progress
-
disable
-
export
-
IPC-D-356 Netlist export.
-
export_lpr
106
-
works
-
buildin
-
export
-
Export to lpr (using export_ps to generate postscript)
-
export_nelma
679
-
works
-
buildin
-
export
-
Export to nelma (Numerical capacitance calculator)
-
export_openscad
1394
-
WIP
-
disabled
-
export
-
Export openscad
-
export_png
1120
-
works
-
buildin
-
export
-
Export to png, gif and jpeg
-
export_ps
1638
-
works
-
buildin
-
export
-
Export postscript or embedded postscript.
-
export_test
257
-
disabled
- (work in progress)
-
buildin
-
export
-
A thin layer of code to dump exporter calls for testing the HID exporter API.
-
export_xy
270
-
works
-
buildin
-
export
-
Export XY centroid element data for pick & place.
-
fontmode
165
-
works
-
buildin
-
(feature)
-
Font editing actions.
-
fp_fs
379
-
works
-
buildin
-
fp
-
Footprint: file system based implementation. Used to be called Newlib: load footprints from directories. Run external processes for the parametric footprints.
-
fp_wget
302
-
works
-
buildin
-
fp
-
Footprint: get static (file) footprints from the web, e.g. from http://gedasymbols.org
-
gl
590
-
disabled
- (pcb-rnd has no support for opengl.)
-
disabled
-
(feature)
-
Common gl functions for hids.
-
gpmi
3046
-
works
-
buildin
- (if gpmi is installed)
-
(feature)
-
Scriptable plugin system with about 10 scripting languages supported and dynamic load/unload of scripts that can manipulate the GUI, the board, can implement exporters, etc.
-
hid_batch
333
-
works
-
buildin
-
hid
-
HID without GUI; read actions from stdin.
-
hid_gtk
15972
-
works
-
buildin
-
hid
-
GUI: the GTK HID.
-
hid_lesstif
6923
-
works
-
buildin
-
hid
-
GUI: the lesstif HID.
-
import_dsn
114
-
Work-in-progress
-
disable
-
import
-
Import specctra .dsn files
-
import_edif
3621
-
works
-
buildin
-
import
-
Import plugin for netlists in the EDIF format.
-
import_netlist
131
-
works
-
buildin
-
import
-
Import plugin for netlists in the classic pcb netlist format.
-
import_sch
301
-
works
-
buildin
-
import
-
Imports element and netlist data from the schematics (or some other source).
-
io_kicad
998
-
work-in-progress
-
disabled
-
io
-
Load and save the design and elements in Kicad's s-expression format - this is the new, currently preferred format in Kicad.
-
io_kicad_legacy
941
-
work-in-progress
-
buildin
-
io
-
Load and save the design and elements in Kicad's legacy format.
-
io_lihata
1042
-
WIP
-
disabled
-
io
-
Load and save the design and elements in the lihata board format.
-
io_pcb
2174
-
works
-
buildin
-
io
-
Load and save the design and elements in the original pcb text format.
-
jostle
446
-
works
-
buildin
-
(feature)
-
Pushes lines out of the way.
-
lib_gensexpr
6
-
works
-
disabled
-
(lib)
-
S-expression parser lib
-
lib_legacy_func
74
-
works
-
buildin
-
(lib)
-
Random collection of old/obsolete (legacy) functions. 3rd party plugins may depend on them. This module implements C functions and variables and does not register actions or flags.
-
loghid
273
-
WIP
-
disabled
-
(feature)
-
Sits between a HID (or exporter) and the core and logs all core->plugin calls made through the HID structure.
-
mincut
909
-
works
-
buildin
-
(feature)
-
Use the minimal cut algorithm to indicate shorts: instead of highlighting two random pins/pads, try to highlight the least number of objects that connect the two networks.
-
oldactions
155
-
works
-
disabled
-
(feature)
-
Random collection of old/obsolete actions. Bell(): audible feedback; DumpLibrary(): print footprint library on stdout; a set of debug actions useful for writing pcb scripts: Debug(), DebugXY(), Return(). Old plugin actions to toggle or set settings that are now accessible via the unified config system (vendordrill, djopt)
-
polycombine
208
-
works
-
buildin
-
(feature)
-
The selected polygons are combined together according to the ordering of their points.
-
polystitch
185
-
segfaults
-
disable
-
(feature)
-
The polygon under the cursor (based on closest-corner) is stitched together with the polygon surrounding it on the same layer. Use with pstoedit conversions where there's a "hole" in the shape - select the hole.
-
propedit
766
-
works
-
buildin
-
(feature)
-
List and edit properties of a group of objects.
-
puller
1888
-
works
-
buildin
-
(feature)
-
Pull traces to minimize their length.
-
query
1823
-
WIP
-
disable
-
(feature)
-
pcb-rnd query language: execute expressions on objects and rules for the programmed drc.
-
renumber
310
-
works
-
buildin
-
(feature)
-
Renumber elements (renaming them) and generate a text file for back annotation.
-
report
749
-
works
-
buildin
-
(feature)
-
Report() and ReportObject() actions - print a report about design objects.
-
shand_cmd
212
-
works
-
buildin
-
(feature)
-
vi-like command shorthands (1..3 character long commands)
-
smartdisperse
173
-
works
-
buildin
-
(feature)
-
Improve the initial dispersion of elements by choosing an order based on the netlist, rather than the arbitrary element order. This isn't the same as a global autoplace, it's more of a linear autoplace. It might make some useful local groupings. For example, you should not have to chase all over the board to find the resistor that goes with a given LED.
-
stroke
135
-
partially works (doesn't work with lesstif; works with the gtk hid, but there's no zoom bindings)
-
disabled
-
(feature)
-
Gesture recognition with libstroke.
-
teardrops
226
-
works
-
buildin
-
(feature)
-
Draw teardrops on pins.
-
toporouter
6162
-
fails
- (infinite loop in gts)
-
disabled
-
(feature)
-
Automatically route selected or all rats using a topological algorithm. This is the new autorouter from 2009.
-
vendordrill
513
-
works
-
buildin
-
(feature)
-
Vendor drill mapping.
-
-
-
Classes
-Each plugin implements a class (rarely a set of classes). Classes are:
-
-
name
description
-
(feature)
random features directly accessible for the user, usually actions
-
(lib)
support code library for other plugins (core doesn't depend on these); functionality not directly accessible for the user but other plugins may depend on it
-
hid
Human Interface Device: interactive user interface, usually GUI
-
import
load alien formats into the design space
-
export
save (parts of) the design space in alien formats
-
- The following software needs to be installed on the system
- that will host the scripts:
-
-
/bin/bash (did not test with POSIX shell)
-
awk (tested with gawk, may work with other modern implementation)
-
common binutils, e.g. ls, find
-
animator, the svn HEAD version; NOTE: it is possible to manually compile animator into a static executable (useful on dedicated web servers)
-
a web server that can execute plain old CGI scripts
-
a full checkout of pcb-rnd/trunk from svn://repo.hu/pcb-rnd/trunk
-
-
-
Installation
-Since the CGIs are just demo scripts for repo.hu and are not really installed
-anywhere else normally, there is no install script but a manual installation
-process. For both the parametric and the static footprint CGI:
-
-
check out pcb-rnd/trunk in a directory readable (but not writable) by www-data (or whatever user the CGI will run with)
-
copy the config file pcblib.cgi.conf from pcb-rnd/trunk/util to /etc
-
edit the config file; ignore setting sdir for now
-
hardlink, copy, or wrap the cgi files from under pcb-rnd/trunk/util into the web server's CGI directory
-
-
-For the static footprint CGI (set up the map cache):
-
-
cd to trunk/util/pcblib-map in the checkout and run make - NOTE: some awk scripts have hardwired CGI paths yet (TODO)
-
copy this directory to a web-accessible directory
-
set sdir to the absolute path of the web-accessible copy in /etc/pcblib.cgi.conf
-
-
-
Tips and tricks
-
cgi wrapping
-Making the checkout directly into the cgi-bin dir is not a good idea. Using
-a hard link on each CGI between the checkout and the cgi-bin dir is better,
-but an svn up will silently break the link leaving the old version live.
-The most stable solution is placing a wrapper script in the cgi-bin dir:
-
-
-
Index: 1.1.4/doc-rnd/screenshot.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/screenshot.jpg
===================================================================
--- 1.1.4/doc-rnd/screenshot.jpg (revision 10776)
+++ 1.1.4/doc-rnd/screenshot.jpg (nonexistent)
Property changes on: 1.1.4/doc-rnd/screenshot.jpg
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/gpmi_temp_inst.txt
===================================================================
--- 1.1.4/doc-rnd/gpmi_temp_inst.txt (revision 10776)
+++ 1.1.4/doc-rnd/gpmi_temp_inst.txt (nonexistent)
@@ -1,65 +0,0 @@
-GPMI system-wide installation
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The installation process is somewhat manual at this early stage. Please
-follow the steps below.
-
-First, you'll need libgpmi - it's a general purpose script glue interface.
-
-A/1. svn checkout svn://repo.hu/gpmi/trunk gpmi/trunk
-A/2. look at doc/languages.txt there; if you have preferred languages,
-please install the -dev packages of those. My favorite is mawk, but I
-think most of the example pcb scripts would be in lua. Versions should
-match; it may be that gpmi works with a newer minor version out of the
-box, tho.
-A/3. run ./configure
-A/4. check if it found the language(s) you wanted; if not, or anything
-else breaks, please send me your scconfig/config.log
-A/5. make
-A/6. make install (as root, but see below)
-
-There are options to step 6:
-
-- if you want to check what it'd do, you could run this:
-
- install_root=/tmp/foo make install
-
- it's like DESTDIR for autotools: it will do everything but will use
- /tmp/foo instead of / so you see what it'd do without using root or
- messing with /usr
-
-- you can use make linstall instead of make install; this creates symlinks
-(pointing to the binaries in your user checkout) instead of copying the
-files. If gpmi changes and you need to update and recompile, you won't
-need to reinstall (until the number of files change).
-
-- there's a make uninstall, but it's more or less untested (failed once
-and worked once for me)
-
-Second, you'll need pcb-rnd:
-
-B/1. svn checkout svn://repo.hu/pcb-rnd/trunk pcb-rnd/trunk
-B/2. ./configure
-B/3. check the output; if anything went wrong, please send me
-scconfig/config.log
-B/4. make
-B/5. you don't need to install it for testing: cd src; ./pcb-rnd
-
-
-There are options in step 2: by default, if gpmi is found, it's compiled
-in "buildin" mode, which means script support is compiled into the pcb-rnd
-executable. An alternative is to have it as a plugin (dynamic linkable
-object). This can be done using the --plugin-gpmi argument for ./configure.
-
-
-GPMI local installation
-~~~~~~~~~~~~~~~~~~~~~~~
-GPMI can be installed without root, into a local user directory (typically
-under home). To achieve this, follow the above steps with the following
-modifications (assuming you want to install gpmi in ~/usr):
-
-A/3. ./configure --prefix=~/usr
-B/2. ./configure --gpmi-prefix=~/usr
-
-NOTE: you don't need to use install_root; gpmi will install under ~/usr as
-if it was /usr.
Index: 1.1.4/doc-rnd/gpmi/scripting_intro.html
===================================================================
--- 1.1.4/doc-rnd/gpmi/scripting_intro.html (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/scripting_intro.html (nonexistent)
@@ -1,226 +0,0 @@
-
-
-
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:
-
-
a core that handles the file format, data structures, UI and exporter logics
-
a hid system that is a layer between core and the HIDs
-
a set of GUI HIDs which are responsible for interactive graphical display of the current design
-
a set of exporter HIDs which are responsible for exporting offline representation of the current design
-
a plugin system that can load HIDs from on the fly, from dynamic loadable libraries (.so or .dll)
-
a buildin system which is the "static link" variant of the plugin system: some plugins can be selected to be statically linked into the pcb-rnd executable so they are "always loaded"
-
-
-Note 1: at the moment GUI hids can not be plugins or buildins.
-
-Note 2: plugins/buildins are always exporter HIDs technically, but in practice
-they do not have to offer exporting. This means such a HID plugin is loaded
-and registered as an exporter on paper, but it doesn't really create a
-new export facility, just sits there, interacting with pcb-rnd (creating
-menus, actions, etc). Most script plugins do this.
-
-When pcb-rnd executable is compiled, the core, the default GUI and exporter HIDs
-and buildins are compiled into the executable. Later on
-
-The GPMI hid is an optional plugin that, by compile-time choice
-of the user, can be:
-
-
left out all-together - pcb-rnd does not have scripting
-
compiled as a plugin - when the .so (or .dll) is put in the right directory, pcb-rnd loads it during startup and has scripting
-
compiled as buildin - becomes part of the pcb-rnd executable so that scripting is always available
-
-
-
1.2. Actions, menus, exporters
-The core implements actions. An action is a command with custom arguments,
-e.g. Delete(Selected). These actions are the commands on the default command
-line in pcb-rnd. In batch mode the command language uses these actions as well.
-Remote controlling pcb-rnd using the --listen switch will read these actions
-on the standard input.
-
-GUI menus are configured to execute actions too. This also means it is impossible
-to realize an user-accessible functionality that can be triggered from
-the GUI command line, menu or batch input without making it an action.
-
-The only exception, where new functionality is not behind a new action is
-exporters. An exporter is a structured dialog box of options and a set of
-callback functions implementing a drawing API. Exporting works by the following
-steps:
-
-
An exporter HID may register one or more exporters.
-
When the user tries to export the design, pcb-rnd lists all
- registered exporters.
-
The user chooses one, and the preconfigured dialog box
- with the selected exporter's options are popped up.
-
pcb-rnd core runs the dialog and saves the results if the user
- clicked on the ok button.
-
pcb-rnd starts the exporting process: it calls the callbacks
- to draw the design layer by layer, object by object.
-
-
-
1.3. How a script can interact with the user
-
-
The script may register actions - these actions are instantly accessible from the GUI command line, on stdin with --listen and in batch mode
-
The script may create menus and bind them to actions - when the menu is selected, the action is executed
-
The script may bind to events that will be generated asynchronously by pcb-rnd - when such an event is received, the script executes some code
-
The script may register new exporter(s) - the user will be able to export the design using the script
-
The script may run arbitrary code "on load" (when the script is loaded) - however, that time the design or even the GUI may not be loaded/initialized yet - this is useful for registering actions, bind to events or set up exporters
-
-
-
-
2. GPMI intro
-
-
2.1. GPMI's place in the pcb-rnd world
-
-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:
-
-
gpmi module: dynamic lib written in C, knows how to load and interpret a script and how to deliver events to the script
-
gpmi package: dynamic lib, provides C functions the script can directly call; package functions then know how to deal with PCB internals
-
-Arrows drawn with dashed line represents a slow, string based communication.
-
-
-
2.2. Module, script, script context, packages
-
-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:
-
-
a script that registers actions needs to bind the ACTE_action event to serve the action requests
-
if a script registers multiple actions, in the event handler it needs to check which action triggered the event (e.g. with a switch()-like construction on the event name)
-
-
-
-
-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.
-
-
-
-
2.4. Exporting
-
-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.
-
-
-
2.5. Making modifications on the design
-The purpose of a script might be to manipulate the objects in the current design.
-Such a script registers actions, and implements the handler of the actions
-using the layout package. The layout package provides calls to query,
-change and create design objects.
-
-
-
3. How it works in practice
-
-
3.1. Loading the GPMI plugin
-Check the output of ./configure, it will tell if gpmi is compiled as buildin
-or plugin (or not at all).
-If the gpmi plugin is compiled as a buildin, it is already loaded, no
-further steps are required.
-
-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
-
-In the above table:
-
-
$prefix is the installation prefix (normally /usr)
-
$arch is the host arch triplet, e.g. i386-unknown-linux; this is useful if multiple architectures share the same NFS mounted plugin dir
-
~ is the user home directory, if exists, e.g. /home/jdoe
-
./ is the current working directory pcb has been started from; may be useful for project-local scripts
-
-
-
3.2. Loading scripts
-The gpmi plugin looks for a file called "pcb-rnd-gpmi.conf" in each of the
-plugin directories. Wherever the file is found, it is loaded and parsed.
-The file is plain text, each line describes a script to be loaded. Empty
-lines and lines starting with # are comments and are ignored.
-
-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
-
-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:
-
-
first argument is the name of the action
-
second is the xy query string; it is empty since this action won't need coordinates to operate on
-
third is the description that shows up in dumps and helps
-
fourth is the syntax description (also for helps)
-
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.
-
-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:
-
-
first argument is the name of the action
-
second is the xy query string; it is empty since this action won't need coordinates to operate on
-
third is the description that shows up in dumps and helps
-
fourth is the syntax description (also for helps)
-
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.
-
layout for searching selected objects and moving objects.
-
-
-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:
-
-
fetch event argument 0 and 1 using action_arg;
-
resolve the conversion rate from mm to PCB's units using mm2pcb_multiplier;
-
perform a search for all selected object using layout_search_selected (return value is the number of objects found), name the resulting list "mv_search"
-
-A loop then iterates over the objects on the list:
-
-
resolve the Nth element of the list using layout_search_get, referecing the list by name ("mv_search") and specifying which element to get (the Nth); the result is an object pointer;
-
move the object using layout_obj_move; specify the object pointer, then which part of the object should be moved ("OC_OBJ" means the whole object) and relative offsets (dx and dy calculated earlier)
-
-Finally the search list shall be destroyed to reclaim memory, using layout_search_free.
-
-
-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:
-
-
first argument is the name of the action
-
second is the xy query string; it is empty since this action won't need coordinates to operate on
-
third is the description that shows up in dumps and helps
-
fourth is the syntax description (also for helps)
-
-layout
- for searching selected objects and moving objects.
-
-
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:
-
-
fetch event argument 0 and 1 using
-action_arg
-;
-
resolve the conversion rate from mm to PCB's units using
-mm2pcb_multiplier
-;
-
perform a search for all selected object using
-layout_search_selected
- (return value is the number of objects found), name the resulting list "mv_search"
- A loop then iterates over the objects on the list:
-
-
resolve the Nth element of the list using
-layout_search_get
-, referecing the list by name ("mv_search") and specifying which element to get (the Nth); the result is an object pointer;
-
move the object using
-layout_obj_move
-; specify the object pointer, then which part of the object should be moved ("OC_OBJ" means the whole object) and relative offsets (dx and dy calculated earlier)
- Finally the search list shall be destroyed to reclaim memory, using
-layout_search_free
-.
-
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.
-
second is the xy query string; it is empty since this action won't need coordinates to operate on
-
third is the description that shows up in dumps and helps
-
fourth is the syntax description (also for helps)
-
Index: 1.1.4/doc-rnd/gpmi/rosetta/30_move/ID.name
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/30_move/ID.name (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/30_move/ID.name (nonexistent)
@@ -1 +0,0 @@
-action: move selected objects
Index: 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.lua
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.lua (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.lua (nonexistent)
@@ -1,18 +0,0 @@
-PkgLoad("pcb-rnd-gpmi/actions", 0);
-PkgLoad("pcb-rnd-gpmi/layout", 0);
-
-function ev_action(id, name, argc, x, y)
- local dx = action_arg(0) * mm2pcb_multiplier()
- local dy = action_arg(1) * mm2pcb_multiplier()
-
- local num_objs = layout_search_selected("mv_search", "OM_ANY")
- for n=0,num_objs+1
- do
- obj_ptr = layout_search_get("mv_search", n)
- layout_obj_move(obj_ptr, "OC_OBJ", dx, dy)
- end
- layout_search_free("mv_search")
-end
-
-Bind("ACTE_action", "ev_action");
-action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)");
\ No newline at end of file
Index: 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.tcl
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.tcl (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.tcl (nonexistent)
@@ -1,17 +0,0 @@
-PkgLoad pcb-rnd-gpmi/actions 0
-PkgLoad pcb-rnd-gpmi/layout 0
-
-proc ev_action {id, name, argc, x, y} {
- set dx [expr round([action_arg 0] * [mm2pcb_multiplier])]
- set dy [expr round([action_arg 1] * [mm2pcb_multiplier])]
-
- set num_objs [layout_search_selected mv_search OM_ANY]
- for {set n 0} {$n < $num_objs} {incr n} {
- set obj_ptr [layout_search_get mv_search $n]
- layout_obj_move $obj_ptr OC_OBJ $dx $dy
- }
- layout_search_free mv_search
-}
-
-Bind ACTE_action ev_action
-action_register "mv" "" "move selected objects by dx and dy mm" "mv(dx,dy)"
Index: 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.scm
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.scm (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.scm (nonexistent)
@@ -1,20 +0,0 @@
-(PkgLoad "pcb-rnd-gpmi/actions" 0)
-(PkgLoad "pcb-rnd-gpmi/layout" 0)
-
-(define ev_action (lambda (id name argc x y)
-(let
- (
- (dx (* (string->number (action_arg 0)) (string->number (mm2pcb_multiplier))))
- (dy (* (string->number (action_arg 1)) (string->number (mm2pcb_multiplier))))
- (num_objs (string->number (layout_search_selected "mv_search" "OM_ANY")))
- (obj_ptr 0)
- )
- (do ((n 0 (1+ n)))
- ((> n num_objs))
- (set! obj_ptr (layout_search_get "mv_search" n))
- (layout_obj_move obj_ptr "OC_OBJ" (inexact->exact dx) (inexact->exact dy))
- )
-)))
-
-(Bind "ACTE_action" "ev_action")
-(action_register "mv" "" "move selected objects by dx and dy mm" "mv(dx,dy)")
Index: 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.awk
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.awk (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.awk (nonexistent)
@@ -1,22 +0,0 @@
-BEGIN {
- PkgLoad("pcb-rnd-gpmi/actions", 0);
- PkgLoad("pcb-rnd-gpmi/layout", 0);
-}
-
-function ev_action(id, name, argc, x, y ,dx,dy,n,num_objs,obj_ptr)
-{
- dx = action_arg(0) * mm2pcb_multiplier()
- dy = action_arg(1) * mm2pcb_multiplier()
-
- num_objs = layout_search_selected("mv_search", "OM_ANY")
- for(n = 0; n < num_objs; n++) {
- obj_ptr = layout_search_get("mv_search", n)
- layout_obj_move(obj_ptr, "OC_OBJ", dx, dy)
- }
- layout_search_free("mv_search")
-}
-
-BEGIN {
- Bind("ACTE_action", "ev_action");
- action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)");
-}
Index: 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.rb
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.rb (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/30_move/ex.rb (nonexistent)
@@ -1,25 +0,0 @@
-PkgLoad("pcb-rnd-gpmi/actions", 0);
-PkgLoad("pcb-rnd-gpmi/layout", 0);
-
-def ev_action(id, name, argc, x, y)
-# TODO: how to convert 1e+06 in ruby?
-# conv = mm2pcb_multiplier().to_i
- conv = 1000000
-
-
- dx = action_arg(0).to_i * conv.to_i;
- dy = action_arg(1).to_i * conv.to_i;
-
- num_objs = layout_search_selected("mv_search", "OM_ANY").to_i;
-
- for n in 0..(num_objs-1)
- obj_ptr = layout_search_get("mv_search", n);
- layout_obj_move(obj_ptr, "OC_OBJ", dx, dy);
- n += 1;
- end
- layout_search_free("mv_search");
-
-end
-
-Bind("ACTE_action", "ev_action");
-action_register("mv", "", "move selected objects by dx and dy mm", "mv(dx,dy)");
Index: 1.1.4/doc-rnd/gpmi/rosetta/12_hello_menu/ex.html
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/12_hello_menu/ex.html (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/12_hello_menu/ex.html (nonexistent)
@@ -1,33 +0,0 @@
-Load packages the script depends on:
-
-
actions for registering the new action;
-
dialogs for creating a dialog box.
-
-
-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:
-
-
first argument is the name of the action
-
second is the xy query string; it is empty since this action won't need coordinates to operate on
-
third is the description that shows up in dumps and helps
-
fourth is the syntax description (also for helps)
-
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.
-
-The Rosetta Stone
-of pcb-rnd scripting is a collection of example scripts implemented in
-various scripting languages. Rosetta has multiple purposes:
-
-
to provide examples of using the pcb-rnd API;
-
to not scare away newcomers by showing the first examples in an unfamiliar language;
-
to help the user to decide which language to use for a specific task;
-
to provide examples on how to convert idioms of pcb-rnd scripts from one language to another.
-
-
-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.
-
-
-
-The Rosetta Stone
-of pcb-rnd scripting is a collection of example scripts implemented in
-various scripting languages. Rosetta has multiple purposes:
-
-
to provide examples of using the pcb-rnd API;
-
to not scare away newcomers by showing the first examples in an unfamiliar language;
-
to help the user to decide which language to use for a specific task;
-
to provide examples on how to convert idioms of pcb-rnd scripts from one language to another.
-
-
-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
-
-
-
-
-
Index: 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.html
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.html (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.html (nonexistent)
@@ -1,60 +0,0 @@
-
-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:
-
-
hid for registering the new exporter;
-
layout for unit conversion;
-
dialogs for error reporting.
-
-
-Set up an exporter hid, storing the handle of each object created in
-a global variable:
-
-
create a hid using hid_create
-
add two attributes (fields) to the dialog using hid_add_attribute
-
register the new hid using hid_register - this makes it an exporter
-
-
-Set up global state variables:
-
-
fmt will be a cache for the format selected by the user
-
conv is the conversion scale between mm and PCB internal coordinate unit
-
channel specifies a file handle or indicates that the output file is open
-
green_light indicates that the exporter is drawing the relevant layer
-
-
-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: 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ID.desc
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ID.desc (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ID.desc (nonexistent)
@@ -1 +0,0 @@
-Create a new exporter that prints a list of drills in x,y,dia table in CSV, TSV or text format
Index: 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/index.html
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/index.html (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/index.html (nonexistent)
@@ -1,71 +0,0 @@
-
-
- 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:
-
-
-hid
- for registering the new exporter;
-
-layout
- for unit conversion;
-
-dialogs
- for error reporting.
-
-
Set up an exporter hid, storing the handle of each object created in a global variable:
-
add two attributes (fields) to the dialog using
-hid_add_attribute
-
-
register the new hid using
-hid_register
- - this makes it an exporter
-
-
Set up global state variables:
-
-
fmt will be a cache for the format selected by the user
-
conv is the conversion scale between mm and PCB internal coordinate unit
-
channel specifies a file handle or indicates that the output file is open
-
green_light indicates that the exporter is drawing the relevant layer
-
-
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: 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ID.name
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ID.name (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ID.name (nonexistent)
@@ -1 +0,0 @@
-drill list exporter
Index: 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.lua
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.lua (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.lua (nonexistent)
@@ -1,65 +0,0 @@
-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(event_id, hid, name, group, empty)
- if name == "topassembly"
- then
- green_light = 1
- else
- green_light = 0
- end
-end
-
-function fill_circle(event_id, hid, gc, cx, cy, r)
- if green_light
- 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", "set_layer")
-Bind("HIDE_fill_circle", "fill_circle")
Index: 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.tcl
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.tcl (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.tcl (nonexistent)
@@ -1,63 +0,0 @@
-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 {event_id hid name group empty} {
- global green_light
-
- if { $name eq "topassembly" } { set green_light 1 } { 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 set_layer
-Bind HIDE_fill_circle fill_circle
Index: 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.awk
===================================================================
--- 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.awk (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/rosetta/35_export_drill/ex.awk (nonexistent)
@@ -1,60 +0,0 @@
-BEGIN {
- 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 = ""
- green_light = 0
-}
-
-function make_gc(event_id, hid, gc) {
- if (channel == "") {
- channel = hid_get_attribute(hid, attr_path)
-# awk: can't check whether the file can be open here
- fmt = hid_get_attribute(hid, attr_format)
- }
-}
-
-function destroy_gc(event_id, hid, gc) {
- if (channel != "") {
- close(channel)
- channel = ""
- }
-}
-
-function set_layer(event_id, hid, name, group, empty) {
- if (name == "topassembly")
- green_light = 1
- else
- green_light = 0
-}
-
-function fill_circle(event_id, hid, gc, cx, cy, r ,dia) {
- if (green_light) {
- cx = cx / conv
- cy = cy / conv
- dia = r / conv * 2
-
- if (fmt == "CSV") {
- print cx "," cy "," dia > channel
- } else if (fmt == "TSV") {
- print cx "\t" cy "\t" dia > channel
- } else if (fmt == "text") {
- print cx " " cy " " dia > channel
- }
- }
-}
-
-BEGIN {
- Bind("HIDE_make_gc", "make_gc")
- Bind("HIDE_destroy_gc", "destroy_gc")
- Bind("HIDE_set_layer", "set_layer")
- Bind("HIDE_fill_circle", "fill_circle")
-}
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_exp.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_exp.png
===================================================================
--- 1.1.4/doc-rnd/gpmi/gpmi_flow_exp.png (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/gpmi_flow_exp.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/gpmi/gpmi_flow_exp.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/gpmi/Porting
===================================================================
--- 1.1.4/doc-rnd/gpmi/Porting (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/Porting (nonexistent)
@@ -1,5 +0,0 @@
-Currently the project works on Linux only. GPMI is portable, so we need
-only Makefile tweakings on pcb-gpmi to be able to compile it anywhere
-where GPMI compiles. However, first I want to see some test results
-from Linux users.
-
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_exp.dot
===================================================================
--- 1.1.4/doc-rnd/gpmi/gpmi_flow_exp.dot (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/gpmi_flow_exp.dot (nonexistent)
@@ -1,65 +0,0 @@
-digraph g {
- rankdir=LR
- splines="polyline"
-# nodesep=1
-# ranksep=1.5
-
- subgraph cluster_0 {
- label="pcb-rnd"
-# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record]
- core [label="core" shape=box]
- hids [label="HID system" shape=box height=2]
- plugins [label="plugin system" shape=box height=2]
- }
-
- subgraph cluster_1 {
- label="GPMI"
- gpmi_hid [label="gpmi HID"]
- gpmi_pkg [label="gpmi package\n(host glue layer)"]
- gpmi_mod1 [label="gpmi lua module\n(script glue layer)"]
- gpmi_scr1 [label="lua script"]
- gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"]
- gpmi_scr2 [label="awk script"]
- outfile [label="export\noutput file" color=green]
- }
-
-
-
- gui [label="the active\nGUI HID\n(e.g. gtk)"]
- exp1 [label="PS exporer"]
- exp2 [label="PNG exporer"]
-
-
- exp1 -> hids [label="register"]
- exp2 -> hids [label="register"]
-
- hids -> exp1 [label="drawing"]
- hids -> exp2 [label="drawing"]
- hids -> gui [label="drawing"]
-
- plugins -> gpmi_hid [label="load plugin"]
- gpmi_hid -> hids [label="register"]
- hids -> gpmi_hid [label="drawing" color=green]
- core -> gpmi_hid [label="event"]
-
- gpmi_pkg -> core [label="calls & variables"]
- gpmi_pkg -> hids [label="calls & variables" color=red]
- gpmi_pkg -> gpmi_hid [label="calls & variables"]
- gpmi_pkg -> plugins [label="calls & variables"]
-
-
- gpmi_hid -> gpmi_mod1 [label="load script"]
- gpmi_hid -> gpmi_mod1 [label="event" color=green]
- gpmi_hid -> gpmi_mod2 [label="load script"]
- gpmi_hid -> gpmi_mod2 [label="event"]
-
- gpmi_mod1 -> gpmi_scr1 [label="load and exec"]
- gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed color=green]
- gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=red]
- gpmi_scr1 -> outfile [label="write" color=green]
-
- gpmi_mod2 -> gpmi_scr2 [label="load and exec"]
- gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed]
- gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed]
-
-}
\ No newline at end of file
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_menu.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_menu.png
===================================================================
--- 1.1.4/doc-rnd/gpmi/gpmi_flow_menu.png (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/gpmi_flow_menu.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/gpmi/gpmi_flow_menu.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_menu.dot
===================================================================
--- 1.1.4/doc-rnd/gpmi/gpmi_flow_menu.dot (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/gpmi_flow_menu.dot (nonexistent)
@@ -1,63 +0,0 @@
-digraph g {
- rankdir=LR
- splines="polyline"
-# nodesep=1
-# ranksep=1.5
-
- subgraph cluster_0 {
- label="pcb-rnd"
-# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record]
- core [label="core" shape=box]
- hids [label="HID system" shape=box height=2]
- plugins [label="plugin system" shape=box height=2]
- }
-
- subgraph cluster_1 {
- label="GPMI"
- gpmi_hid [label="gpmi HID"]
- gpmi_pkg [label="gpmi package\n(host glue layer)"]
- gpmi_mod1 [label="gpmi lua module\n(script glue layer)"]
- gpmi_scr1 [label="lua script"]
- gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"]
- gpmi_scr2 [label="awk script"]
- }
-
-
-
- gui [label="the active\nGUI HID\n(e.g. gtk)"]
- exp1 [label="PS exporer"]
- exp2 [label="PNG exporer"]
-
-
- exp1 -> hids [label="register"]
- exp2 -> hids [label="register"]
-
- hids -> exp1 [label="drawing"]
- hids -> exp2 [label="drawing"]
- hids -> gui [label="drawing" color=green]
-
- plugins -> gpmi_hid [label="load plugin"]
- gpmi_hid -> hids [label="register"]
- hids -> gpmi_hid [label="drawing"]
- core -> gpmi_hid [label="event" color=red]
-
- gpmi_pkg -> core [label="calls & variables"]
- gpmi_pkg -> hids [label="calls & variables" color=green]
- gpmi_pkg -> gpmi_hid [label="calls & variables"]
- gpmi_pkg -> plugins [label="calls & variables"]
-
-
- gpmi_hid -> gpmi_mod1 [label="load script"]
- gpmi_hid -> gpmi_mod1 [label="event" color=red]
- gpmi_hid -> gpmi_mod2 [label="load script"]
- gpmi_hid -> gpmi_mod2 [label="event"]
-
- gpmi_mod1 -> gpmi_scr1 [label="load and exec"]
- gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed color=red]
- gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=green]
-
- gpmi_mod2 -> gpmi_scr2 [label="load and exec"]
- gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed]
- gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed]
-
-}
\ No newline at end of file
Index: 1.1.4/doc-rnd/gpmi/Credits
===================================================================
--- 1.1.4/doc-rnd/gpmi/Credits (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/Credits (nonexistent)
@@ -1,11 +0,0 @@
-2006...2009
-~~~~~~~~~~~
-Big thanks to DJ Delorie who added external HID support in PCB and commited
-many small patches needed to get this project working in the period
-when the whole project was a plugin to vanilla pcb.
-
-The following people helped the project with their valuable feedbacks
-in the early stage:
- John Griessen
- Carlos Nieves Onega
-
Index: 1.1.4/doc-rnd/gpmi/History
===================================================================
--- 1.1.4/doc-rnd/gpmi/History (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/History (nonexistent)
@@ -1,32 +0,0 @@
-History
-~~~~~~~
-As of October 2006, PCB has native support for external (or dynamic
-loadable) HIDs. This project is plugin that provides scripting features.
-
-For a long time I believe that good applications should be scriptable,
-and real good ones should not restrict scripting to one or two languages.
-For this reason I have been working on GPMI with various other developers
-for years. GPMI provides a general way to split up big applications in
-smaller, usually dynamic loadable parts, and encourages that some of these
-parts should be written in a script language. For me, the ideal model
-of an application is a small core that knows how to manipulate the
-internal representation of the task and a lot of dynamic functionality
-plugins and support plugins that do all the high-level job for the user.
-
-PCB is an old and big software, with a stable user base. Restructuring the
-whole source to "GPMIize" it is no option. Instead, a nice compromise is
-implementing this functionality in a plugin that pcb can load for the users
-who are interested in such extras.
-
-From 2006 to 2009 spring the project was on hold, because I was nagging
-PCB developers to add support for customizable dialog boxes. In late March
-2009, PCB developers pointed out that the interface I was waiting for had been
-there for who-knows-how-long. With the help of DJ Delorie I extended the
-action handling of PCB to remember action contexts, which was another showstopper.
-After all obstacles removed, I allocated a 24 hour coding session where I
-finished the exporter functionality, added action binding, dialog box handling
-and layout manipulation functions.
-
-During the summer of 2015 I merged pcb-gpmi into pcb-rnd and made it
-the default scirpting engine for pcb-rnd.
-
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_reg.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_reg.png
===================================================================
--- 1.1.4/doc-rnd/gpmi/gpmi_flow_reg.png (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/gpmi_flow_reg.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/gpmi/gpmi_flow_reg.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_reg.dot
===================================================================
--- 1.1.4/doc-rnd/gpmi/gpmi_flow_reg.dot (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/gpmi_flow_reg.dot (nonexistent)
@@ -1,64 +0,0 @@
-digraph g {
- rankdir=LR
- splines="polyline"
-# nodesep=1
-# ranksep=1.5
-
- subgraph cluster_0 {
- label="pcb-rnd"
-# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record]
- core [label="core" shape=box]
- hids [label="HID system" shape=box height=2]
- plugins [label="plugin system" shape=box height=2]
- }
-
- subgraph cluster_1 {
- label="GPMI"
- gpmi_hid [label="gpmi HID"]
- gpmi_pkg [label="gpmi package\n(host glue layer)"]
- gpmi_mod1 [label="gpmi lua module\n(script glue layer)"]
- gpmi_scr1 [label="lua script"]
- gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"]
- gpmi_scr2 [label="awk script"]
- }
-
-
-
- gui [label="the active\nGUI HID\n(e.g. gtk)"]
- exp1 [label="PS exporer"]
- exp2 [label="PNG exporer"]
-
-
- exp1 -> hids [label="register"]
- exp2 -> hids [label="register"]
-
- hids -> exp1 [label="drawing"]
- hids -> exp2 [label="drawing"]
- hids -> gui [label="drawing"]
-
- plugins -> gpmi_hid [label="load plugin"]
- gpmi_hid -> hids [label="register"]
- hids -> gpmi_hid [label="drawing"]
- core -> gpmi_hid [label="event"]
-
- gpmi_pkg -> core [label="calls & variables" color=green]
- gpmi_pkg -> hids [label="calls & variables"]
- gpmi_pkg -> gpmi_hid [label="calls & variables" color=red]
- gpmi_pkg -> plugins [label="calls & variables"]
-
-
- gpmi_hid -> gpmi_mod1 [label="load script"]
- gpmi_hid -> gpmi_mod1 [label="event"]
- gpmi_hid -> gpmi_mod2 [label="load script"]
- gpmi_hid -> gpmi_mod2 [label="event"]
-
- gpmi_mod1 -> gpmi_scr1 [label="load and exec"]
- gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed]
- gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=red]
- gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=green]
-
- gpmi_mod2 -> gpmi_scr2 [label="load and exec"]
- gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed]
- gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed]
-
-}
\ No newline at end of file
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_load.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_load.png
===================================================================
--- 1.1.4/doc-rnd/gpmi/gpmi_flow_load.png (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/gpmi_flow_load.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/gpmi/gpmi_flow_load.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow.png
===================================================================
--- 1.1.4/doc-rnd/gpmi/gpmi_flow.png (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/gpmi_flow.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/gpmi/gpmi_flow.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow_load.dot
===================================================================
--- 1.1.4/doc-rnd/gpmi/gpmi_flow_load.dot (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/gpmi_flow_load.dot (nonexistent)
@@ -1,63 +0,0 @@
-digraph g {
- rankdir=LR
- splines="polyline"
-# nodesep=1
-# ranksep=1.5
-
- subgraph cluster_0 {
- label="pcb-rnd"
-# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record]
- core [label="core" shape=box]
- hids [label="HID system" shape=box height=2]
- plugins [label="plugin system" shape=box height=2]
- }
-
- subgraph cluster_1 {
- label="GPMI"
- gpmi_hid [label="gpmi HID"]
- gpmi_pkg [label="gpmi package\n(host glue layer)"]
- gpmi_mod1 [label="gpmi lua module\n(script glue layer)"]
- gpmi_scr1 [label="lua script"]
- gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"]
- gpmi_scr2 [label="awk script"]
- }
-
-
-
- gui [label="the active\nGUI HID\n(e.g. gtk)"]
- exp1 [label="PS exporer"]
- exp2 [label="PNG exporer"]
-
-
- exp1 -> hids [label="register"]
- exp2 -> hids [label="register"]
-
- hids -> exp1 [label="drawing"]
- hids -> exp2 [label="drawing"]
- hids -> gui [label="drawing"]
-
- plugins -> gpmi_hid [label="load plugin" color=red]
- gpmi_hid -> hids [label="register"]
- hids -> gpmi_hid [label="drawing"]
- core -> gpmi_hid [label="event"]
-
- gpmi_pkg -> core [label="calls & variables"]
- gpmi_pkg -> hids [label="calls & variables"]
- gpmi_pkg -> gpmi_hid [label="calls & variables" color=green]
- gpmi_pkg -> plugins [label="calls & variables"]
-
-
- gpmi_hid -> gpmi_mod1 [label="load script" color=red]
- gpmi_hid -> gpmi_mod1 [label="event"]
- gpmi_hid -> gpmi_mod2 [label="load script"]
- gpmi_hid -> gpmi_mod2 [label="event"]
-
- gpmi_mod1 -> gpmi_scr1 [label="load and exec" color=red]
- gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed]
- gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed color=green]
-
- gpmi_mod2 -> gpmi_scr2 [label="load and exec"]
- gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed]
- gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed]
-
-}
\ No newline at end of file
Index: 1.1.4/doc-rnd/gpmi/gpmi_flow.dot
===================================================================
--- 1.1.4/doc-rnd/gpmi/gpmi_flow.dot (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/gpmi_flow.dot (nonexistent)
@@ -1,63 +0,0 @@
-digraph g {
- rankdir=LR
- splines="polyline"
-# nodesep=1
-# ranksep=1.5
-
- subgraph cluster_0 {
- label="pcb-rnd"
-# core [label="pcb-rnd core|{{HID system|plugin system}}" shape=record]
- core [label="core" shape=box]
- hids [label="HID system" shape=box height=2]
- plugins [label="plugin system" shape=box height=2]
- }
-
- subgraph cluster_1 {
- label="GPMI"
- gpmi_hid [label="gpmi HID"]
- gpmi_pkg [label="gpmi package\n(host glue layer)"]
- gpmi_mod1 [label="gpmi lua module\n(script glue layer)"]
- gpmi_scr1 [label="lua script"]
- gpmi_mod2 [label="gpmi mawk module\n(script glue layer)"]
- gpmi_scr2 [label="awk script"]
- }
-
-
-
- gui [label="the active\nGUI HID\n(e.g. gtk)"]
- exp1 [label="PS exporer"]
- exp2 [label="PNG exporer"]
-
-
- exp1 -> hids [label="register"]
- exp2 -> hids [label="register"]
-
- hids -> exp1 [label="drawing"]
- hids -> exp2 [label="drawing"]
- hids -> gui [label="drawing"]
-
- plugins -> gpmi_hid [label="load plugin"]
- gpmi_hid -> hids [label="register"]
- hids -> gpmi_hid [label="drawing"]
- core -> gpmi_hid [label="event"]
-
- gpmi_pkg -> core [label="calls & variables"]
- gpmi_pkg -> hids [label="calls & variables"]
- gpmi_pkg -> gpmi_hid [label="calls & variables"]
- gpmi_pkg -> plugins [label="calls & variables"]
-
-
- gpmi_hid -> gpmi_mod1 [label="load script"]
- gpmi_hid -> gpmi_mod1 [label="event"]
- gpmi_hid -> gpmi_mod2 [label="load script"]
- gpmi_hid -> gpmi_mod2 [label="event"]
-
- gpmi_mod1 -> gpmi_scr1 [label="load and exec"]
- gpmi_mod1 -> gpmi_scr1 [label="event" style=dashed]
- gpmi_scr1 -> gpmi_pkg [label="function calls" style=dashed]
-
- gpmi_mod2 -> gpmi_scr2 [label="load and exec"]
- gpmi_mod2 -> gpmi_scr2 [label="event" style=dashed]
- gpmi_scr2 -> gpmi_pkg [label="function calls" style=dashed]
-
-}
\ No newline at end of file
Index: 1.1.4/doc-rnd/gpmi/index.html
===================================================================
--- 1.1.4/doc-rnd/gpmi/index.html (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/index.html (nonexistent)
@@ -1,32 +0,0 @@
-
-
-
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).
-
-
-
-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:
-
-
int layout_get_page_width();
-
int layout_get_page_height();
-
void layout_set_page_size(int width, int height);
-
-
-
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.
-
-
int layout_resolve_layer(const char *name): resolve layer number by name (case sensitive); returns negative number if not found
-
int layout_get_current_layer(): returns the number of the current layer
-
void layout_switch_to_layer(int layer): switch to layer (further actions will take place there)
-
-
-
-
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()).
-
-
-
-
-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: 1.1.4/doc-rnd/gpmi/packages/dialogs_ref.html
===================================================================
--- 1.1.4/doc-rnd/gpmi/packages/dialogs_ref.html (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/packages/dialogs_ref.html (nonexistent)
@@ -1,105 +0,0 @@
-
-
when the selected file will be read, not written (HID_FILESELECT_READ)
-
FS_NOT_EXIST
the function calling hid->fileselect will deal with the case when the selected file already exists. If not given, then the gui will prompt with an "overwrite?" prompt. Only used when writing. (HID_FILESELECT_MAY_NOT_EXIST)
-
FS_TEMPLATE
the call is supposed to return a file template (for gerber output for example) instead of an actual file. Only used when writing. (HID_FILESELECT_IS_TEMPLATE)
-
-
-
Functions
-
-
The following functions are registered in script context.
-
-
-
-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:
-
-
create an event handler for event ACTE_action
-
register one or more actions using function action_register
-
optional: when the event handler is triggered, check argument name (for scripts with multiple actions registered)
-
optional: use argument argc and function action_arg to fetch action arguments
-
optional: use arguments x, y to learn the cursor position on the layout.
-
-
-Example (written in lua):
-
--- 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):
-
-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:
-
-
-
/main_menu/ is the menubar
-
/popups/something/ is a popup menu called something; the lesstif HID does
- not support popups; popups are popped up by actions.
-
-
-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
-
-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: 1.1.4/doc-rnd/gpmi/packages/hid_ref.html
===================================================================
--- 1.1.4/doc-rnd/gpmi/packages/hid_ref.html (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/packages/hid_ref.html (nonexistent)
@@ -1,205 +0,0 @@
-
-
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).
-
-
- 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: 1.1.4/doc-rnd/gpmi/packages/hid.html
===================================================================
--- 1.1.4/doc-rnd/gpmi/packages/hid.html (revision 10776)
+++ 1.1.4/doc-rnd/gpmi/packages/hid.html (nonexistent)
@@ -1,76 +0,0 @@
-
-
-
hid package
-
-The hid package has two purposes:
-
-
it is glue layer for exporter dialog boxes and attribute dialog boxes;
-
it can register exporter HIDs in PCB
-
-
-
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
-
-
hid_register(), which registers a new exporter hid using the
- attributes of the dialog box; or
-
dialog_attribute() (of the dialog package) which pops up a custom
- dialog box immediately.
-
-
-
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 to set up exporting
-
many draw events to actually export the objects
-
an envelope event to finish exporting
-
-
-
Envelope: events generated before or after exporting
-
-
HIDE_get_export_options(void *hid): Generated before get_exporter_options returns the option list to the GUI hid
-
HIDE_do_export_start(void *hid): Generated before export redraw starts
-
HIDE_do_export_finish(void *hid): Generated after export redraw finihsed
-
-
-
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:
-
-
HIDE_make_gc(void *hid, void *gc);
-
HIDE_destroy_gc(void *hid, void *gc);
-
-
- Gc properties are changed by the following events:
-
-
HIDE_set_layer(void *hid, const char *name, int group);
-
Copy selection to buffer GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Unselect(All); Mode(PasteBuffer)
-
Copy selection to buffer GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Unselect(All); Mode(PasteBuffer)
-
ChangeDrill +5 mil ChangeDrillSize(Object,+5,mil)
-
-
s-alt-shift
-
ChangeDrill -5 mil ChangeDrillSize(Object,-5,mil)
-
-
s-ctrl
-
Save Layout Save(Layout)
-
-
s-ctrl-shift
-
Save Layout As... Save(LayoutAs)
-
-
s-shift
-
ChangeSize -5 mil ChangeSize(Object,-5,mil)
-
-
space
-
Arrow Mode Mode(Arrow)
-
-
t
-
Text Tool scale +10 mil SetValue(TextScale,+10,mil)
-
-
t-shift
-
Text Tool scale -10 mil SetValue(TextScale,-10,mil)
-
-
tab
-
Flip up/down SwapSides(V)
-
-
tab-ctrl
-
Spin 180 degrees SwapSides(R)
-
-
tab-ctrl-shift
-
Swap Sides SwapSides()
-
-
tab-shift
-
Flip left/right SwapSides(H)
-
-
u
-
Undo last operation Undo()
-
-
u-ctrl-shift
-
Clear undo-buffer Undo(ClearList)
-
-
up
-
Step Up Cursor(Warp,0,1,grid)
-
-
up-shift
-
Step +Up Cursor(Pan,0,50,view)
-
-
v-alt
-
Via Tool drill +5 mil SetValue(ViaDrillingHole,+5,mil)
-
-
v-alt-shift
-
Via Tool drill -5 mil SetValue(ViaDrillingHole,-5,mil)
-
-
v-ctrl
-
Paste buffer to layout Mode(PasteBuffer)
-
-
v-ctrl-shift
-
Via Tool size -5 mil SetValue(ViaSize,-5,mil)
-
-
v-shift
-
Via Tool size +5 mil SetValue(ViaSize,+5,mil)
-
-
v e
-
Zoom Max Zoom()
-
-
v f
-
Zoom Max Zoom()
-
-
v i
-
Zoom In 2X Zoom(-2)
-
-
v o
-
Zoom Out 2X Zoom(+2)
-
-
w
-
Add All Rats AddRats(AllRats)
-
-
w-shift
-
AddRats Selected AddRats(SelectedRats)
-
-
x
-
Cycle object being dragged CycleDrag()
-
-
x-ctrl
-
Cut selection to buffer GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); RemoveSelected(); Mode(PasteBuffer)
-
-
x-shift
-
Swap nets on two selected pins net(swap)
-
-
y
-
Puller Puller()
-
-
y-ctrl
-
Redo last undone operation Redo()
-
-
y-shift
-
ChangeSizes to Route style ChangeSizes(Object,style,mil)
-
-Gsch2pcb-rnd is a standalone utility that can extract netlists and
-element data from a schematics produced by gschem. Thus it is a glue
-between gschem and pcb-rnd, doing forward annotation. It is ideal
-for automating the design process as it can be easily called from
-Makefiles, shell scripts or other programs/scripts, whereas the
-"import schematics" feautre (import_sch plugin) is more geared for the
-GUI user.
-
-Multiple methods of operation are offered - the user can select
-one of these by name, using the -m command line argument (e.g.
-gsch2pcb-rnd -m importsep foo.sch):
-
-
-
method name
-
description
-
-
pcb
-
The classic approach: load the existing extract elements from
- the .sch file, load the .pcb file, compare element lists, load
- footprint libraries and create .new.pcb and .net and .cmd and let
- the user handle the rest. Does not work with anything else
- than the .pcb format. This method is deprecated and is
- provided only for compatibility with some old workflows.
-
-
import
-
Runs the same gnetlist backend as the import_sch plugin. A single
- action command file generated with .cmd suffix. When executed
- (using action ExcuteFile(foo.cmd)), it syncs (replaces/creates)
- every element and sets up all nets. Pro: single-command import.
- Con: can't load netlist only or elements only.
-
-
importsep
-
Similar to import, but produces two files: a .cmd file with element
- updates only (can be appled the same way as import's) and a
- separate .net netlist file that can be imported the same way as the
- .net of the pcb method. Pro: the user can update elements-only or
- nets-only. Con: requires two user actions to get a full impoty.
-
Index: 1.1.4/doc-rnd/TODO
===================================================================
--- 1.1.4/doc-rnd/TODO (revision 10776)
+++ 1.1.4/doc-rnd/TODO (nonexistent)
@@ -1,154 +0,0 @@
-- BUGS
- ? all route styles deleted when using 'File>load layout data to paste buffer'
- + in the 45-deg line mode, while DRC enforce settings toggled 'on' can cause isolated trace crossing, violating DRC
- - save as: change format, save as again: it sets back the format to default but the file name is wrong [report:Erich]
-
-- Lihata persistent save:
- - flag compatibility: save unknown, string-flags as loaded by io_pcb
- - ind: space in ha:layer name
- - ind: symbol height is not in-line on the output
- - ind: indentation bug in via and netlists
- - ind: indentation bug in inline struct therm: closing } is preceded by indentation whitespace for some reason
- - keep numeric format: test all
- - keep unknown subtrees
-
-- replace settings with lihata (conf_*)
- - TEST:
- - vendor drill mapping (all functionality, including regex based refdes ignore)
- - route style in gtk and lesstif, save, load, 0, 1 or a lot of styles
- - route style vs. autorouter
-
-- query & advanced search
- - search expr wizard should pick up the expression from the button when clicked
- - field accessors:
- - pad area
- - pin area
- - line (and pad) length and length^2
- - make a run on alarge board, speed test, with -O0 and -O3:
- - iteration speed (a simple @)
- - eval speed (a simple @ with a lot of constants in an expr)
- - geo speed
- - regex and string cmp match speed vs. select by name
-
-CLEANUP #5
-- save/load bugs:
- - gtk load dialog extension filter should reflect known formats
- - when changing format in the save dialog, the file extension is not modified
- - there should be an "auto" or "guess by extension" option in the save dialog format
-- convert PCBChanged into an event (and provide a core action for compatibility)
-- rework the gpmi plugin to make it more standard in regard of the build system and to remove a few directories
-- dir rename trunk/pcblib/tru-hole should handle make correctly and not walk on existing web services or user installs
-- grid status line label doesn't update when using setvalue(grid,delta) add another hook to update this value [miloh]
-- Erich's select undo bug: place an element, select, save & load, unselect, undo 2 times: bad serial
-- Erich's gtk lag report: press 's' a lot then move the mouse - 's' ends up in the new loc!
-- conf: throw an error if user config can not be written
-- the TAB bug: (over ssh -X) press tab for a good 15 seconds; release; it won't work again for a fraction of a second
-- mark bug - ortho shouldn't use it, it should use last point (crosshair.X2); make sure nothing else abuses it [James]
-- conf:
- - remove CFN_INCREMENTS, test if saving increments from preferences works
- - config pov: change prio
- - gtk preferences: check what takes 131 megs of VIRT ram (on top); destroy the dialog structures when closed
- - gtk preferences: poly isle area widget missing from the sizes tab
- - debug why default layer names from the user config are ignored
- - fp_fs_search: kill anything that gets ':' separated string as path list, get a config list instead
- - switch the lesstif HID over from attribs to conf
- - remove redundancy: don't store values in the PCB struct that are in the design conf
- - increments are not really implemented
- - if font file is not found:
- - embedded version?
- - warn when try to write text on pcb?
-- action bug: gui_act.c shouldn't reference Crosshair.X directly; check d-fix.patch about how to fix it
-- next_gui: keep them open, hide
-- look for #warnings
-- fix librarychanged: disable update of gedasymbols on-start, make it an explicit refresh button
-- libstroke: zoom
-- cleanup/rewrite resources:
- - load/swap menus (TODO#1)
- - gpmi:
- - hid: hid_destroy (pair of hid_create)
- - cleanup on unload: remove menus
-- check whether local copy of gts is needed, bisect when toporouter broke
-- check gpmi when pcb-rnd is fully linstalled - broken symlinks?
-- multi-key: display state on the gui
-- implement loglevels and log style tags in the lesstif HID
-- TODO#3: works only on US keyboard
-- gsch2pcb: generalize plugin/buildin loading for external tools, check if gsch2pcb can work from plugins
-
-CLEANUP #6:
-- lihata board format:
- - pads should be polygons (0 long line can't be rotated!)
-- layer groups from config (e.g. CLI) is ignored
-- res:
- - search for vendor in the hid plugins, there should be no trace of it (vendor should register its in submenus with anchors)
- - re-add dynamic menus after a gui change:
- - either remember dynamic menus in a separate list so they can be rebuilt
- - or provide hooks and let plugins deal with it
- - gpmi: auto-remove menus by cookie (TODO#2)
- - load new res on the fly (replace the menu system):
- - low level reload code (re-add the dynamic menus too!)
- - action to reload if file name is known
- - gui load dialog with tags listed
-- decide about exporter policy:
- - png exports selection (even in not-as-shown), others don't
- - extend png hid attribs with a flag for this, maybe do the same for others
- - document the decision in "hacking"
-- reduce
- - export_bom: rewrite the string list code using htsp and/or lists
- - hash in hid_attrib.c?
- - nelma and gcode both invent .png name locally
- - get rid of gcode/lists.h, and vector.[ch] (autorouter)
- - vendordrill
- - search for /units, replace it with pcb-printf something
- - add round down
- - replace ignore_refdes, ignore_value and ignore_descr with genvector
- - mods:
- - gpmi (and other buildins/plugins) not showing up in the about box
-- self contained
- - files
- - default font
- - action (--show-paths!) and dialog box to print where the actual files are coming from
- - project specific menus from extra lihata files - maybe from project.lht
-- main.c:
- - SIGPIPE - detect it (needed for popen)
-
-CLEANUP #7: the big object split
-- remove pcb_obj_type_t from const.h - use obj_any.h instead
-
-
-
-
-FEATURES
-- BUILD: menuconfig and a config file for scconfig
-
-Low prio:
-- scconfig: check if it picks up settings from env vars (for a gentoo build)
-- replace mkdtemp() with something safer
-- display net names on pins, vias (and maybe tracks?) when zoomed in enough
-- DRC should warn for thin poly hair
-- rotate shaped vias don't rotate the shape (is via rotated at all?)
-- new examples
- - blinking led with parametric footprints
- - example of nonetlist: 1206 jumpers and logos
-- decide what to do with old doc - texi doesn't seem to work at all
-- rethink/rewrite the action/change infrastructure - too many void *ptr1
- pointers, too many code duplication
-- double sided board, poly on both layers; grab existing lines on one layer and
- move then around. If all layers are visible, redraw of the far side layer
- is slow and causes flickering elements from that layer until the front is
- redrawn. Maybe we should have less flushes?
-- gpmi:
- - dialog: attribute dialog: mini parser from text
- - fix debug draw in the gtk hid
- - ACTE_action(): coords should not be int but Coord
- - get timers to work
-- dmalloc: #include from the bottom from each file. Is this a good idea?!
-- win32 port {large}
- - clean up central Makefile.in rules:
- - remove cat, sed, grep where possible, use scconfig instead
-- arc bug: draw an arc with one end out of the drawing area; it will be jumpy and can not be placed properly
- -> AttachForCopy() calls SetCrosshairRange() that then sets corsshair max* which
- limits the arc to move freely. Problem: this is not arc-specific, this happens with any buffer copy! going for no-design-limit is probably better
-- while drawing a line, the temporary outline should reflect the layer color
-- push&shove
- - keep 45-deg knee when grabbing a point for drag&drop in non-all-dir
-- examine current handling of long options [miloh]
Index: 1.1.4/doc-rnd/index.html
===================================================================
--- 1.1.4/doc-rnd/index.html (revision 10776)
+++ 1.1.4/doc-rnd/index.html (nonexistent)
@@ -1,123 +0,0 @@
-
-
- pcb-rnd - main
-
-
-
-
-
-
-
-
- editor for multilayer Printed Circuit Boards
- scriptable in 10+ different scripting languages
- parametric footprint generation, web footprints
- modular code with a flexible plugin system
- fits well in a UNIXy workflow
- supports CLI and server applications
- active development, frequent releases
- friendly and efficient developer and user community
- predictable development cycles
-
-
Suported platforms
- Linux desktop (various distributions, from source)
- Mac OS X
- Arch Linux (user package)
-
- IRIX 5.3
- (Likely: any 90's UNIX system with motif)
- Screen resolution as small as 800x600
- GUI options: motif/lesstif, gtk
-
Developers try to respond on user needs, adding features that are actually needed by current users.
-
-
-
-
-
-
- Response Not Delayed
-
Bugrepots, user requests and patches submitted are answered ASAP. There are no patches bitrotting for months. There are no forgotten bugreports.
-
-
-
-
-
-
-
Research & Development
-
-
- Rázós, Nehéz Döntések (Brave, hard decisions)
-
There is a constant experimentation with new features and directions. We are willing to try strange/unusual ideas without risking the stability of the daily workflow.
-
-
-
-
-
-
-
Rants Now Dissipating
-
Instead of talking and ranting a lot about what could work better, we just sit down and make it work better.
-
-
-
-
-
-
-
Rather Nicely Decentralized
-
Slim, generic core; most of the code organized in replacable plugins. Most plugins depend only on the core.
-
-
-
-
Index: 1.1.4/doc-rnd/logo128.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/logo128.png
===================================================================
--- 1.1.4/doc-rnd/logo128.png (revision 10776)
+++ 1.1.4/doc-rnd/logo128.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/logo128.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/keys.html
===================================================================
--- 1.1.4/doc-rnd/keys.html (revision 10776)
+++ 1.1.4/doc-rnd/keys.html (nonexistent)
@@ -1,684 +0,0 @@
-
-
Copy selection to buffer GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Mode(PasteBuffer)
-
Copy selection to buffer GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Unselect(All); Mode(PasteBuffer)
-
ChangeDrill +5 mil ChangeDrillSize(Object,+5,mil)
-
ChangeDrill +5 mil ChangeDrillSize(Object,+5,mil)
-
-
s-alt-shift
-
ChangeDrill -5 mil ChangeDrillSize(Object,-5,mil)
-
ChangeDrill -5 mil ChangeDrillSize(Object,-5,mil)
-
-
s-ctrl
-
Save layout Save(Layout)
-
Save Layout Save(Layout)
-
-
s-ctrl-shift
-
Save layout as... Save(LayoutAs)
-
Save Layout As... Save(LayoutAs)
-
-
s-shift
-
ChangeSize -5 mil ChangeSize(Object,-5,mil)
-
ChangeSize -5 mil ChangeSize(Object,-5,mil)
-
-
space
-
Arrow Mode(Arrow)
-
Arrow Mode Mode(Arrow)
-
-
t
-
Text Tool scale +10 mil SetValue(TextScale,+10,mil)
-
Text Tool scale +10 mil SetValue(TextScale,+10,mil)
-
-
t-shift
-
Text Tool scale -10 mil SetValue(TextScale,-10,mil)
-
Text Tool scale -10 mil SetValue(TextScale,-10,mil)
-
-
tab
-
Flip up/down SwapSides(V)
-
Flip up/down SwapSides(V)
-
-
tab-ctrl
-
Spin 180° SwapSides(R)
-
Spin 180 degrees SwapSides(R)
-
-
tab-ctrl-shift
-
Swap Sides SwapSides()
-
Swap Sides SwapSides()
-
-
tab-shift
-
Flip left/right SwapSides(H)
-
Flip left/right SwapSides(H)
-
-
u
-
Undo last operation Undo()
-
Undo last operation Undo()
-
-
u-ctrl-shift
-
Clear undo-buffer Undo(ClearList)
-
Clear undo-buffer Undo(ClearList)
-
-
up
-
Step Up Cursor(Warp,0,1,grid)
-
Step Up Cursor(Warp,0,1,grid)
-
-
up-shift
-
Step +Up Cursor(Pan,0,50,view)
-
Step +Up Cursor(Pan,0,50,view)
-
-
v
-
Zoom Max Zoom()
-
Zoom Max Zoom()
-
-
v-alt
-
Via Tool drill +5 mil SetValue(ViaDrillingHole,+5,mil)
-
Via Tool drill +5 mil SetValue(ViaDrillingHole,+5,mil)
-
-
v-alt-shift
-
Via Tool drill -5 mil SetValue(ViaDrillingHole,-5,mil)
-
Via Tool drill -5 mil SetValue(ViaDrillingHole,-5,mil)
-
-
v-ctrl
-
Paste buffer to layout Mode(PasteBuffer)
-
Paste buffer to layout Mode(PasteBuffer)
-
-
v-ctrl-shift
-
Via Tool size -5 mil SetValue(ViaSize,-5,mil)
-
Via Tool size -5 mil SetValue(ViaSize,-5,mil)
-
-
v-shift
-
Via Tool size +5 mil SetValue(ViaSize,+5,mil)
-
Via Tool size +5 mil SetValue(ViaSize,+5,mil)
-
-
w
-
Add All Rats AddRats(AllRats)
-
Add All Rats AddRats(AllRats)
-
-
w-shift
-
AddRats Selected AddRats(SelectedRats)
-
AddRats Selected AddRats(SelectedRats)
-
-
x
-
-
Cycle object being dragged CycleDrag()
-
-
x-ctrl
-
Cut selection to buffer GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); RemoveSelected(); Mode(PasteBuffer)
-
Cut selection to buffer GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); RemoveSelected(); Mode(PasteBuffer)
-
-
x-shift
-
-
Swap nets on two selected pins net(swap)
-
-
y
-
Puller Puller()
-
Puller Puller()
-
-
y-shift
-
ChangeSizes to Route style ChangeSizes(Object,style,mil)
-
ChangeSizes to Route style ChangeSizes(Object,style,mil)
-
-
-A long standing misfeature of pcb (and pcb-rnd) has been that when dragging the
-end of connected traces, pcb chosen one of the traces "randomly". It often
-didn't pick the one the user wanted to move. The workaround was to move the
-one that pcb picked and then return and move the target trace then
-move the other trace back. This gets even more annoying if there are more than
-two objects connected in the given point: 3 traces and a via for example.
-
-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.
-
-
save/load and compatibility
-Not affected.
-
-
plans
-It does not work with the lesstif HID. It does not work with the rubber band
-mode.
-
-
-
Index: 1.1.4/doc-rnd/features/mincut.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/features/mincut.png
===================================================================
--- 1.1.4/doc-rnd/features/mincut.png (revision 10776)
+++ 1.1.4/doc-rnd/features/mincut.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/features/mincut.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/features/nonetlist.html
===================================================================
--- 1.1.4/doc-rnd/features/nonetlist.html (revision 10776)
+++ 1.1.4/doc-rnd/features/nonetlist.html (nonexistent)
@@ -1,71 +0,0 @@
-
-
- pcb-rnd - [nonetlist]
-
-
-
-
-
-
-
-
-
-The [nonetlist] patch adds an element flag that makes PCB ignore the marked
-element when dealing with netlists. This means connecting a net to a pin of
-a nonetlist element will not cause a short. The refdes of a nonetlist
-part is drawn with color element-color-nonetlist (ElementColor_nonetlist
-in the source; default value #777777, grey).
-
-Uses of the nonetlist feature:
-
-
smd jumper: Combined with the [intconn] 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 and passing the DRC.
-
mechanical parts that should not show up on the schematics:
-
-
mounting hole elements: single pin holes with silk marking the head of the screw
-
chassis (often with mounting holes or keep-out areas)
-
logos in footprints (no poly support in footprint - yet?)
-
mechanical parts which do not have solderable pins (plastic spacers, extra connector shields)
-
"spare connectors", e.g. unused/disconnected DIP sockets, pin grids, or connectors in the corner of the PCB for prototyping (dev-board style)
-
-
-
-Preservation: gsch2pcb-rnd leaves nonetlist elements in the PCB.
-
save/load and compatibility
-This patch introduces a new element flag. The following example demonstrates
-a 1206 jumper footprint:
-
-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.
-
-
plans
-No plans, the feature is complete.
-
-
Index: 1.1.4/doc-rnd/features/square.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/features/square.png
===================================================================
--- 1.1.4/doc-rnd/features/square.png (revision 10776)
+++ 1.1.4/doc-rnd/features/square.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/features/square.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/features/unglib.html
===================================================================
--- 1.1.4/doc-rnd/features/unglib.html (revision 10776)
+++ 1.1.4/doc-rnd/features/unglib.html (nonexistent)
@@ -1,35 +0,0 @@
-
-
- pcb-rnd - [unglib]
-
-
-
-
-
-
-
-
-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.
-
-
-The original code has a special setup for representing trees, C structures
-called LibraryMenu and LibraryEntry. This system can represent only a subset
-of trees: there is a root, a level consist of directories only and a next level,
-each directory consist of data nodes only. This has been enough for newlib,
-which strictly follows this model in the file system hierarchy. The lesstif
-HID also hardwired this model in the GUI.
-
-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.
-
-
-Many of the patches in this fork, and in possible future branches/forks
-may introduce new pin, pad or element flags. PCB loads and saves flags
-by converting the text representation to an in-memory binary format. Any
-flag not understood is lost.
-
-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.
-
-
save/load and compatibility
-This patch ensures compatibility in save/load cycles with flags introduced
-by later versions of mainline PCB or different branches/forks of PCB by
-not removing flags they introduced.
-
-
plans
-No plans - this feature is fully implemented.
-
-
Index: 1.1.4/doc-rnd/features/grid_edge.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/features/grid_edge.png
===================================================================
--- 1.1.4/doc-rnd/features/grid_edge.png (revision 10776)
+++ 1.1.4/doc-rnd/features/grid_edge.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/features/grid_edge.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/features/pcblib.html
===================================================================
--- 1.1.4/doc-rnd/features/pcblib.html (revision 10776)
+++ 1.1.4/doc-rnd/features/pcblib.html (nonexistent)
@@ -1,74 +0,0 @@
-
-
- pcb-rnd - [pcblib]
-
-
-
-
-
-
-
-
pcb-rnd - the [pcblib] and [pcblib-param] and [fp_fs] patches
-
-
-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 ...
-
-
... for the very beginning of the learning curve;
-
... and to be the core of the user's own library later.
-
-
-[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.
-
-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.
-
-
-
-Thanks to gpmi, pcb-rnd is scriptable in about 10 scripting languages (e.g.
-lua, awk, ruby, python, scheme, tcl). Scripts are integrated in pcb-rnd and
-have access to most of the internals. Scripts
-are able to:
-
-
register new actions
-
create new menus and submenus
-
execute existing actions
-
pop up simple dialog boxes (message, report, progress bar, file selection) -- check out the video
-
build and pop up custom dialog boxes (so called attribute dialogs)
-
search for objects (lines, arc, polys, vias, etc.) on the layout
-
change and move existing objects on the layout
-
create new objects on the layout
-
change "page" properties (dimensions of the board)
-
debug draw on the gui (slightly broken on gtk due to some gtk hid bugs)
-
-
-
-This feature has three options:
-
-
disabled: not compiled at all - when gpmi is not installed (no gpmi scripting in PCB)
-
buildin: compiled and linked in the executable - pcb-rnd always can load and run scripts
-
plugin: compiled as a loadable plugin - pcb-rnd can load and run scripts if the plugin is installed
-
-
-The original code was highlighting pins/pads only when a short came around
-after rats nest optimization. This was not very helpful on a complex board.
-There had been a long discussion on the mailing list about the best solutions.
-There were a few very good ideas, including:
-
-
manual tagging of objects (lines, polys, arcs, vias) with net and warn
- where two differently tagged net connects
-
automatic tagging based on "where it was connected first", then the same
- warning mechanism as above
-
trace history (using the undo buffer?) and go back until when it was
- not broken, check what exactly broke it
-
history combined with tagging
-
calculate minimal cut
-
-
-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).
-
-
save/load and compatibility
-New PCB flag enablemincut. Mainline pcb ignores this flag but does not
-preserve it.
-
-
-On small screen the overhead of the menu line, bottom status line and left
-layer selection bar is just too expensive. Since 1.1.2, the gtk hid can
-be switched between the usual setup and a so called "full screen mode"
-where most widgets are hidden, leaving much more screen space to the
-editor widget. There's a FullScreen() action that can set or toggle
-the state and a default key binding in gtk on the backslash ('\') to
-toggle it.
-
-
save/load and compatibility
-Not affected.
-
-
plans
-Make hiding various parts of the GUI configurable. No plans to implement
-it for the lesstif HID.
-
-
-
Index: 1.1.4/doc-rnd/features/query.html
===================================================================
--- 1.1.4/doc-rnd/features/query.html (revision 10776)
+++ 1.1.4/doc-rnd/features/query.html (nonexistent)
@@ -1,42 +0,0 @@
-
-
- pcb-rnd - [query]
-
-
-
-
-
-
-
-
-Pcb-rnd features a flexible query language that can list (or select or find, etc.)
-objects mathcing an expression. The language handles different data types,
-including lists, provides means to iterate over objects and lists, supports
-the common logical and arithmetic operators.
-
-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.
-
-
pcb-rnd - the [cycdrag] patches, negative box select
-
-When a selection is made using drag&drop (box selection), depending
-on the direction the rule for object selection differ:
-
-
drag from top-right towards bottom-left (positive sized box):
- select objects that are fully contained in the box (original behaviour)
-
drag from bottom-left towards top-right (negative sized box):
- select objects that are even partially within the box or merely touch
- the edge of the box
-
-
-
save/load and compatibility
-Not affected.
-
-
plans
-Work more on some rough corners of the negative direction: e.g. pads are
-handled as 0 width lines so the selection has to hit the center.
-
-
-
Index: 1.1.4/doc-rnd/features/intconn1.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/features/intconn1.png
===================================================================
--- 1.1.4/doc-rnd/features/intconn1.png (revision 10776)
+++ 1.1.4/doc-rnd/features/intconn1.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/features/intconn1.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/features/intconn2.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/features/intconn2.png
===================================================================
--- 1.1.4/doc-rnd/features/intconn2.png (revision 10776)
+++ 1.1.4/doc-rnd/features/intconn2.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/features/intconn2.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/features/jumper_1206.fp
===================================================================
--- 1.1.4/doc-rnd/features/jumper_1206.fp (revision 10776)
+++ 1.1.4/doc-rnd/features/jumper_1206.fp (nonexistent)
@@ -1,7 +0,0 @@
-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]
-)
Index: 1.1.4/doc-rnd/features/intconn3.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/features/intconn3.png
===================================================================
--- 1.1.4/doc-rnd/features/intconn3.png (revision 10776)
+++ 1.1.4/doc-rnd/features/intconn3.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/features/intconn3.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/features/debian_list.html
===================================================================
--- 1.1.4/doc-rnd/features/debian_list.html (revision 10776)
+++ 1.1.4/doc-rnd/features/debian_list.html (nonexistent)
@@ -1,64 +0,0 @@
-
-
-
-
- pcb-rnd - Debian package list
-
-
-
-
-
-
-
-
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 provides 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.
-
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-gsch2pcb
This package provides the external tool gsch2pcb-rnd that can convert a gschem schematics to files that can be imported in pcb-rnd.
-
-
-
-In this effort I imported a set of old PCB plugins to be core plugins of
-pcb-rnd. This will make it easier to keep them up to date, to defeat
-the bitrot effect. The feature plugins that got imported so far:
-
-
autocrop
-
boardflip
-
distalign
-
distaligntext
-
jostle - doesn't work properly
-
polycombine
-
polystich - segfaults
-
teardrops
-
renumberblock - as part of the renumber plugin
-
smaprtdisperse
-
-
-The import/export plugins improted over the default set of the last official
-mainline release:
-
-
import_dsn - specctra importer - compiles, parser needs a full rewrite, it tries to read an s-expression line by line with fgets()
-
export_dsn - specctra exporter - compiles, produces valid-looking output - need tester to validate the output
-
-
-Our current Debian packaging reflects the modularity of pcb-rnd: it has
-most plugins in separate packages. The main package is called
-pcb-rnd-core: this provides the executable and the footprint library
-and the batch HID. The GUI HIDs are in pcb-rnd-gtk and
-pcb-rnd-lesstif - it's possible to install neither, either or both.
-When there are multiple HIDs installed, the user can select one by the
---gui command line parameter or by changing the GUI preference in the
-configuration (the default preference is gtk > lesstif > batch).
-
-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:
-
-
decide which packages you need; this package list may help
-
build them on your Debian box: use svn trunk, install debhelper and all the build dependencies of pcb-rnd and run "fakeroot debian/rules binary" in trunk (shorthand: "make deb")
-
-Back annotation was a long standing missing functionality. There has been
-different suggestions, including:
-
-
back annotation is not needed at all, the user can do it manually
-
pcb should generate a new netlist, the user should run diff on the netlists and manually edit the schematics
-
gschem should be able to load netlists emitted by PCB; or gnetlist could reverse-process such a netlist
-
-
-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.
-
-
Design decisions
-This devlog entry functions
-as a design decision document.
- Another entry is a summary
-on how the feature ended up in a private feature-fork of gschem.
-
-
save/load and compatibility
-Deliberate changes are tracked so that a new forward annotation from
-the old schematics won't break them. To do this, pcb-rnd saves a
-NetListPatch() section in the file. Mainline PCB can not handle this section.
-Compatibility, by use case:
-
-
1. No back annotation is made in pcb-rnd: the file stays compatible
-
2. Back annotation is made in pcb-rnd, then the changes are done on the schematics and a forward annotation is also done: the netlist patch in pcb-rnd becomes empty so the pcb file is again compatible with mainline pcb; this is called resolution of netlist patches
-
3. There are unresolved netlist patches saved in pcb-rnd and the user attempts to load the pcb file in mainline pcb: syntax error (but no data loss); solution: resolve the netlist patch as described in point 2.
-
4. Cheat for situation 3.: manually remove the NetListPatch() section from the save file. This way the back annotation info is lost, but mainline pcb can load the file again. This action is sort of "revert back annotation".
-
5. Any file saved by mainline PCB can be opened by pcb-rnd, back annotation does not affect that.
-
-
-
-The original code draws every grid point on screen, even the ones that are
-off the board. When the user zooms out with a dense grid, it can become too
-dense - the original code turns the grid off in this case.
-
-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.
-
-
-
New grid
-
-To overcome this problem, pcb-rnd offers configuration settings to limit
-the number of dots to be drawn. There are mainly two parallel approaches:
-using a local grid or draw less dots in a global grid. The
-old code defined only a global grid and did not have runtime settings for
-the properties of the grid.
-
-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.
-
-
Global grid improvements
-
-The most trivial optimization is that grid points off the board are simply
-not drawn:
-
-
-
-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:
-
-
-
-
Introduction of the local grid
-Another approach is to use a local grid. The grid helps finding whether
-existing objects are aligned or where the next move/click would end up.
-These are usually interesting only in a small range around the crosshair and
-less interesting on the other end of the board. Local grid draws the grid
-points only near the crosshair. Such local grid follows the crosshair
-everywhere:
-
-
-
-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.
-
-
save/load and compatibility
-Not affected.
-
-
plans
-This feature is gtk-specific and is complete. There are no plans to
-implement this in the lesstif HID at the moment.
-
-
-
Index: 1.1.4/doc-rnd/features/propedit.html
===================================================================
--- 1.1.4/doc-rnd/features/propedit.html (revision 10776)
+++ 1.1.4/doc-rnd/features/propedit.html (nonexistent)
@@ -1,65 +0,0 @@
-
-
- pcb-rnd - [propedit]
-
-
-
-
-
-
-
-
-Since 1.1.2, pcb-rnd core is able to attach user defined attributes
-(arbitrary textual key=value pairs) to any object. The original mainline
-pcb-rnd was forked from already supported attributes on some objects (e.g.
-board attributes, net attributes) but not on all. However, the user had
-very little access to the attributes - no GUI or action would handle them.
-
-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:
-
-
the most common value
-
minimum value (for numeric value types)
-
maximum value (for numeric value types)
-
average value (for numeric value types)
-
-
-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.
-
-
save/load and compatibility
-Attributes of most objects can not be saved in the original .pcb format.
-The propedit feature is most useful when used with the lihata board format.
-
-
plans
-Various improvements. Currently there's no plan to make this function available
-in the lesstif HID.
-
-
-
Index: 1.1.4/doc-rnd/features/pcb-fp.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/features/pcb-fp.png
===================================================================
--- 1.1.4/doc-rnd/features/pcb-fp.png (revision 10776)
+++ 1.1.4/doc-rnd/features/pcb-fp.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/features/pcb-fp.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/features/res.html
===================================================================
--- 1.1.4/doc-rnd/features/res.html (revision 10776)
+++ 1.1.4/doc-rnd/features/res.html (nonexistent)
@@ -1,147 +0,0 @@
-
-
- pcb-rnd - [res]
-
-
-
-
-
-
-
-
-
-PCB used to have an own file format for describing resources (menu structure
-and hotkey bindings, vendor drill mapping). The resource format was generic
-enough to describe these things, but the syntax was somewhat wierd: mixed
-positional and named fields. More precisely, composite nodes could contain
-named and anonymous subnodes, and the meaning of anonymous subnodes depended
-on their position in the anon-subnode-list.
-
-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.
-
-
menu files
-There are pcb-menu-gtk.lht and pcb-menu-lesstif.lht. They are in trunk/src
-in the source tree and are instaslled in the SHAREDIR. Currently each GUI
-HID (lesstif, gtk) loads the corresponding menu file.
-
-
menu resource lihata structure
-The root of a menu resource file should be a ha: with the following
-children:
-
-
li:mouse for mouse button bindings
-
li:main_menu for describing the main menu
-
li:popups for describing the popup menus
-
-All children are optional, but recommended. Thus the file stucture, zoomed
-out, is:
-
-The mouse subtree may contain a li: for each mouse button action;
-the children of the list are further li: nodes for key modifiers, whose
-children are text nodes: actions executed in order.
-
-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.
-
-The main menu is a list of menubar items that may host submenu items
-recursively. Each normal item is a hash with the following children:
-
-
li:submenu an ordered list of submenu nodes (should not have accel key or action)
-
tip tooltip text
-
action text or list of actions to execute when menu is selected
-
a a key description for an accelerator key (hotkey)
-
li:a a list of key descriptions for an accelerator keys (hotkeys); all keys will be bound to the menu and the first key is shown in the menu
-
-Special menu items are text nodes instead of hashes; they are:
-
-
starting with @, are dynamic, auto-generated items (e.g. layers; might be HID-dependent)
-
a singel dash: separator
-
-
-A key description is a text in the form of:
-
-
the name of the node is the visible name of the menu item
-
<key>keyname, e.g. "<key>k" for key K, or "<key>F10" for F10
-
modifier<key>keyname, e.g. "Alt-<key>K" for Alt+K
-
modifier-modifier<key>keyname, e.g. "Shift-Alt-<key>K" for Shift+Alt+K; modifiers are Alt, Shift and Ctrl; order does not matter, all three can be used together.
-
multikey sequence: multiple of the above, separated by semicolons (protected with {} for lihata, as the text contains semicolon); e.g. "{<key>f;<key>o}" means the user presses "f" then "o". Sequences can be a dozen stroke long and any segment may use modifiers
-
-
-An example menu item with submenus (can be a main menu or a submenu of
-another menu item):
-
-Each children is a hash that describes a popup menu. A popup menu behaves
-exactly like a menu item, it should have a submenu list. Popup windows will
-be popped up by executing an action with the name of the popup menu.
-
-
save/load and compatibility
-Not affected.
-
-
plans
-The resource file format conversion is done. There are other parts of the code
-that will probably get lihata instead of the current custom parsers, e.g.
-the preferences/settings file.
-
-
-
Index: 1.1.4/doc-rnd/features/polygrid.html
===================================================================
--- 1.1.4/doc-rnd/features/polygrid.html (revision 10776)
+++ 1.1.4/doc-rnd/features/polygrid.html (nonexistent)
@@ -1,35 +0,0 @@
-
-
- pcb-rnd - [polygrid]
-
-
-
-
-
-
-
-
-
-Polygrid adds an option to the ps exporter to fill polygons with a grid
-of horizontal and vertical lines instead of full fill. When toner transfer
-is used or test prints are produced, the grid may save some toner.
-
-
-
-Since version 1.0.10, pcb-rnd implements a new footprint mechanism (see
-[fp_fs] and [library_t]).
-The new code allows footprint backend plugins to get library from anywhere.
-The [fp_wget] plugin is an implementation that:
-
-
downloads a library list from the web on startup into a local cache
-
downloads footprints from the web on-demand into a local cache
-
-
-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:
-
-
generate a plain text list of all footprints available
-
return the raw footprint file by name
-
-
-The plugin uses external program wget to communicate on the web.
-
-
-
How to configure for gedasymbols.org
-Add wget@gedasymbols in the library search path (e.g. in preferences as library-newlib).
-
-
save/load and compatibility
-Not affected.
-
-
plans
-Better feedback on progress, explicit user requested refresh, refresh in
-the background.
-
-
-
Index: 1.1.4/doc-rnd/features/grid_global_nosparse.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/features/grid_global_nosparse.png
===================================================================
--- 1.1.4/doc-rnd/features/grid_global_nosparse.png (revision 10776)
+++ 1.1.4/doc-rnd/features/grid_global_nosparse.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/features/grid_global_nosparse.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/features/square.html
===================================================================
--- 1.1.4/doc-rnd/features/square.html (revision 10776)
+++ 1.1.4/doc-rnd/features/square.html (nonexistent)
@@ -1,89 +0,0 @@
-
-
- pcb-rnd - [square]
-
-
-
-
-
-
-
-
-Most of my PCBs end up in toner transfer. There are a lot
-of tricks around prototyping at home. One of the problems I often
-face is small rings peeling off during rework (and rework tend to
-happen on the first prototypes). The solution for this is increasing
-ring size - which is not suitable if traces are passing between pins.
-Another solution is to increase the area of the pin:
-
-
square pin: while it makes the pin slightly larger still letting traces pass between pins, it's too symmetrical and can not use up extra room
-
DJ's teardrop plugin: this increases the area only toward the trace, whereas very often there's more room on the opposite side
-
manually add an extra poly around the pin; with multiple pins it's hard to get the polys separate
-
manually add a short extra track on the pin, width matching the size of the pin; this is very close, but increases workload when components are moved, layers are changed
-
-
-
-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.
-
-
save/load and compatibility
-This patch introduces a new pin flag called shape(n), where n is an integer
-selecting the shape of the pin when the square flag is also set:
-
-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.
-
-
plans
-In the original code there are separate code paths for round, octagonal and
-square pins. The separation repeats for at least:
-
-
drawing the pin shape
-
calculating the clearance
-
checking whether things overlap or connect (pin vs pin, pin vs line, etc.)
-
autorouter
-
-In most cases a set of hardwired constants are written in the C code. A notable
-exception was the octagon pin draw function, that had x and y offsets in a const
-table for 8 points and a loop to create the poly (or line segments in thin draw).
-
-The [square] feature is a good base for cleaning up the code a bit and for
-moving toward a generic pin shape patch:
-
-
hardwired octagon calculations should be replaced to use the same x;y const offset table
-
the table should be replaced by a struct that describes length (number of points) - alternatively use POLYAREA
-
square pin should be renamed to polygon pin
-
octagon flag shall be removed - it should be a configuration of the x;y const table
-
square flag shall be removed - it should be a configuration
-
the only flag remaining should be shape(); if a pin is not shaped, it's round
-
the pin shape struct should have a field for compatibility - to mark the entry corresponding to the original square and octagon pins so PCB-rnd format can be converted to and from the mainline PCB format.
-
there should be a set of pin shapes in a default configuration table, including square and octagonal; these should be static
-
the PCB file format should be extended with an option to expand the pin shape table with custom shapes
-
UI: shapes could be imported (converted) from polys around vias
-
UI: since there may be a lot of pin shapes, a GUI selector alternative shall be offered while also keeping the cycle-thru 'q' key
-
-
-Footprints bring their own hole sizes, copper ring sizes and clearances.
-These parameters often depend on the manufacturing process, and such a value
-coming from a footprint may differ much from the values used on the board already.
-
-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:
-
-
change clearance size now works on elements: it changes the clearance of all pins/pads; this is the same as change drill has been working for a long time
-
size change actions normally take a value and a unit; if the value is not a number but text style, the value is copied from the currently active routing style
-
a new ChangeSizes() action that attempts to execute the other three change size actions with the same arguments and fails only if all of them failed; the three sizes are: main size, drill size, clearance size
-
a menu item and hotkey binding to key 'Shift+Y' (for routing stYle) that calls ChangeSizes() of the selected or current object(s) to resize them to the current routing style
-
-
-The new route style set works on:
-
-
lines and arcs: sets their line width and clearance
-
vias and individual pins: sets their ring dia, drill dia and clearance
-
individual pads: sets their clearance
-
elements: set all their pins and pads
-
-
-
Example
-GUI: select a routing style; hover above a line, a via, a pin/pad of an element
-or the silk of an element; press Shift+Y; undo if necessary.
-
-
-Mainline PCB core was coupled with the file format; the [io] patch set is
-an effort to decouple any file design I/O from core. The original file format
-(plain text .pcb and .fp) lives on as plugin called io_pcb.
-
-
-TODO
-
-
save/load and compatibility
-Not affected when io_pcb is used and .pcb or .fp files are loaded or saved.
-
-Using other io_* implementations will obviously result in files that are
-incompatible with mainline pcb (unless mainline pcb learns how to load those
-formats).
-
-
plans
-The project is still in an early phase.
-
-
-
Index: 1.1.4/doc-rnd/features/index.html
===================================================================
--- 1.1.4/doc-rnd/features/index.html (revision 10776)
+++ 1.1.4/doc-rnd/features/index.html (nonexistent)
@@ -1,61 +0,0 @@
-
-
- pcb-rnd - features
-
-
-
-
-
-
-
-
-
-There are parts with internal connections (e.g. pin 2 and 4 of a SO8
-package are internally connected). Mainline PCB can not handle this,
-leaving the following options:
-
-
connect both pins to the net from the schematics - this works if all the internally connected pins are required to connect to copper (common with GND or power pins) but is very inconvenient for signal pins where only one of them needs to be connected
-
back-annotate which pin is connected - there's no easy back annotation
-
one pin connected, the other is closer to the next target; PCB doesn't understand that they are already connected internally; normally one shouldn't use the internal connection of a component instead of copper; except for the common practice to use 0 ohm SMD resistors for jumping wires
-
-
-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.
-
Example
-The first image depicts crossing traces, a common problem encountered when rats
-nesting a new layout from a netlist. One method to resolve such issues is to
-use a zero ohm jumper resistor that allows one signal trace to 'jump' across
-another.
-
-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.
-
-
-
-
-
-
-
-
-
-
-
save/load and compatibility
-This patch introduces a new pin flag. In the following example
-pin 2 and 4 are connected internally as group 9, while pin 3
-does not have any internal connections:
-
-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.
-
-
plans
-No plans - this feature is fully implemented. There is no plan for implementing
-a GUI, internal connections should be hand-edited into the element.
-
-
Index: 1.1.4/doc-rnd/features/routings.html
===================================================================
--- 1.1.4/doc-rnd/features/routings.html (revision 10776)
+++ 1.1.4/doc-rnd/features/routings.html (nonexistent)
@@ -1,97 +0,0 @@
-
-
- pcb-rnd - routing style fixes
-
-
-
-
-
-
-
-
-In the original code there are a compile-time fixed number (4) of routing
-styles. This is often not enough for more complex designs. While in theory
-this limit can be raised, the resulting .pcb files will be incomatible with
-pcb compilations using a different number of styles.
-
-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.
-
-
Explicit custom style
-Pcb had 4 explicit styles and a hidden, implicit style. All drawing
-action uses the hidden style. When the user selects one of the explicit
-styles, its properties are copied into the implicit style. Any drawing
-action uses the implicit style, this it's sort of the "pen style".
-
-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:
-
-
draw a line using one of the existing styles
-
increase the width (with the 's' key) a few times - now the style of the line does not match any of the existing styles
-
use the SetSame() action over the line (hover the pointer over the line and press 'a') - it will try to set the style that corresponds to the line
-
since no style matches the line's, the radio button gets deselected - that's good
-
now click on the Route Style button - it will show the properties of the last selected route style, even tho it is not selected at the moment
-
-
-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:
-
-
no style marked on the radio button (just like in mainline)
-
the Route Style button opens with the <custom> style, with the values picked up from the object by SetSame
-
the user can change the values, which will affect the implicit pen style
-
this means the user can draw with the new settings, without having to create a permanent style
-
-
-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.
-
-
SetSame() bugs fixed
-A line does not have drill parameters. When mainline tries to pick up
-object properties for a line, it will pick thickness and clearance but
-will leave hole and ring diameters unchanged. This very often results in
-a mixed style: e.g. "signal" line properties picked up from a line while
-"power" hole/ring properties left over from the current style selection.
-Such a mixed pickup will result in the GUI get confused and not selecting any
-of the styles. The expected behaviour is to select the "signal" style if the
-line width/clearance matches the parameters of that style, and ignore the
-drill/ring parameters.
-
-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.
-
-
save/load and compatibility
-Saving a design with number of styles not equal to 4 may cause problems
-when loading with mainline. The rest of these features do not affect
-compatibility.
-
-
plans
-No plans - these features are fully implemented.
-
-
Index: 1.1.4/doc-rnd/features/pcblib.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: 1.1.4/doc-rnd/features/pcblib.png
===================================================================
--- 1.1.4/doc-rnd/features/pcblib.png (revision 10776)
+++ 1.1.4/doc-rnd/features/pcblib.png (nonexistent)
Property changes on: 1.1.4/doc-rnd/features/pcblib.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: 1.1.4/doc-rnd/features/dynstyle.html
===================================================================
--- 1.1.4/doc-rnd/features/dynstyle.html (revision 10776)
+++ 1.1.4/doc-rnd/features/dynstyle.html (nonexistent)
@@ -1,38 +0,0 @@
-
-
- pcb-rnd - [dynstyle]
-
-
-
-
-
-
-
-
-
-Pcb-rnd doesn't have a hardwired limit on number of routing styles
-anymore. Routing styles can be created on the fly and are saved to and loaded
-from .pcb files.
-
-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.
-
-
save/load and compatibility
-The first 4 styles are loaded and preserved by mainline. Styles above
-4 would probably be deleted in a mainline load-save cycle. The number 4
-is a constant value that can be changed if mainline is recompiled.
-
-
plans
-GUI HID representation of styles (especially in menus) need more testing.
-
-
Index: 1.1.4/Changelog
===================================================================
--- 1.1.4/Changelog (revision 10776)
+++ 1.1.4/Changelog (nonexistent)
@@ -1,714 +0,0 @@
-pcb-rnd 1.1.4 (r5778)
-~~~~~~~~~~~~~~~~~~~~~
- [gsch2pcb-rnd]
- -Add: method infrastructure
- -Add: a method that uses the same mechanism as import_sch
- -Add: a method that uses import_sch's gnetlist backend for elements but a the usual PCB backend for the netlist
-
- [import_sch]
- -Fix: install and use the .scm script from our own directory instead of guessing gnetlist's installation
-
- [debian]
- -Del: remove debian/ to ease official packaging
-
-pcb-rnd 1.1.3 (r4479)
-~~~~~~~~~~~~~~~~~~~~~
- [mods]
- -Fix: the IO system remembers which format (plugin) a file is loaded or last saved with and uses that on a 'save' instead of the default one, unless a different format is explicitly requested ('save as')
- -Fix: load plugins from /usr/lib/pcb-rnd/plugins instead of /usr/lib/pcb/plugins
- -Fix: macro argument bug in fontmode (thanks Chad!)
- -Fix: import_sch: rename the gschem forward-annotation script so that it doesn't collide with mainline's
- -Cleanup: rename legacy_func to lib_legacy_func as part of the plugin lib cleanup
- -Add: io_kicad: load and save kicad s-expression board layout files
- -Add: io_kicad_legacy: save boards and/or modules in the old kicad format
- -Add: io_lihata: preserve formatting and numeric format on load/save
- -Add: io_lihata: custom indentation rules for boards (more compact, easier to read)
- -Add: in export_xy: code from mainline to support IPC-7351 on element rotation guesses
- -Import: autocrop original code
- -Import: boardflip
- -Import: distalign
- -Import: distaligntext
- -Import: jostle
- -Import: polycombine
- -Import: polystich
- -Import: renumberblock (as part of the renumber plugin)
- -Import: smartdisperse
- -Import: teardrops
- -Import: bboard exporter from git
- -Import: dsn exporter from git
- -Import: dxf exporter
- -Import: ipcd356 exporter from git
- -Import: openscad exporter from git
-
- [query]
- -Add: query language - select/unselect objects using expressions
- -Add: advanced search dialog box frontend for the query language in the GTK HID
-
- [core]
- -Cleanup: const correctness on net creation: style is read-only
- -Cleanup: move generic find-net-for-pin function from rats_patch to netlist
- -Fix: changing grid should not only change it in PCB but also in the conf tree - this will deliver the conf change event that will trigger the update in gtk
- -Fix: const correctness in hid_flags, pin-to-net lookups
- -Fix: coord conversion rounding errors
- -Fix: deselect not incrementing undo serial number (from Charles Parker); caused undo panic upon undoing a deselection
- -Fix: invalid function ptr to data ptr casts
- -Fix: move global netlist states from global variables to PCB struct fields (on the way to a proper lib...)
- -Fix: rubber band: when move didn't happen, flags were left behind
- -Fix: undo element text size bug
- -Fix: plug_io file load: when multiple formats matched an explicit load format description, try them all, until one worked
- -Split: generalize format-string-like variable substitution so it's easier to build custom file names (and other strings) from config templates; supports %F (file name), %N (board name), %T (UNIX time), %B (basename) and %D (dirname)
- -Add: remove_menu concept in HID API
- -Add: generic flag change macro that can set, clear or toggle the flag depending on an argument
- -Add: hid export option to draw holes after all copper, silk and mask layers has been drawn so that holes punch through everything
- -Add: layer creation and rename helper functions
- -Add: obj_any - a generic type+union struct (and a list of that) for holding pcb objects of any kind
- -Import: LookupConnectionByPin from mainline
- -Import: clear flags by object type from mainline (import and port)
-
- [debian]
- -Change: redo the whole script for a modular packaging of plugins
-
- [util]
- -Add: devhelper script for testing round trips
- -Add: pcb-strip (remove attributes and/or symbols from a .pcb)
-
- [gtk]
- -Add: full screen button in the scroll-bar corner
- -Fix: call the checkbox menu update function from conf change callback installed at menus, instead of assuming checkbox states are changed only from within the GUI and calling the updater directly
-
- [propedit]
- -Add: text set applies on element texts too
-
- [res]
- -Add: RemoveMenu() action
- -Add: gtk can remove menus
- -Add: update_on field - bind checkbox updating to a config var
-
- [scconfig]
- -Fix: when generating dependency generator rules, use -MT for src_3rd targets or else gcc will ruin the target object names; this means proper dependencies in src_3rd
- -Cleanup: use bison/flex output file name CLI arguments instead of the tmp/mv hacks - the code depended on bison anyway
- -Add: --symbols to enable debug symbols without the extra asserts and -O0
-
-pcb-rnd 1.1.2 (r3773)
-~~~~~~~~~~~~~~~~~~~~~
- [cleanup]
- - ANSI/C89 compliance
- - char * const correctness
-
- [mods]
- -Fix: io_pcb: do not convert measure through int (Chris' mm grid bug)
- -Fix: import_sch: generate proper error messages if there's no make or gnetlist program configured
- -Fix: io: qsort cmp function API bug - wrong format preference
- -Fix: io: make sure the PCBChanged action is ran on revert so that route styles and other properties are updated
- -Fix: fontmode broken coord-to-cell conversion rendered the font editor useless
- -Cleanup: export_bom and export_xy are separate plugins; export_xy depends on export_bom because of the name escaping function
- -Rename: debug plugin to diag plugin to avoid confision with --debug in ./configure command line
- -Add: diag: layer dump action
- -Add: diag: evalconf() action to evaluate the configuration situation of a path
- -Add: io_kicad_legacy: first steps for PCB layout implemented. Mildly broken module exported.
- -Add: propedit: object property editor (with gtk support)
- -Add: io_lihata: initial implementation without object ordering
- -Add: io_pcb: 3 different flavors of the original format (using different numeric formats)
- -Add: import_sch: make and gnetlist programs configured in the default config
-
- [lesstif]
- -Fix: compile and link even if xrender is not found
- -Fix: print angle as %f in the status line as it's a floating point value
-
- [gtk]
- -Fix: library selection window switches to arrow mode before replacing the buffer, so that the outline drawing code doesn't get confused
- -Fix: library path file chooser should be a "folder chooser" not a "file chooser"
- -Fix: display the correct $(path) syntax in the library window help
- -Fix: when file name changes, update window title
- -Fix: do not allow to zoom out so much that Coord can't handle it anymore and overflows
- -Fix: work around the control bug on some mac systems
- -Fix: do not draw global grid beyond board edges
- -Fix: shift+tab: translate left-tab back to tab, shift is handled by the core
- -Fix: when popping up the log window for a Message(), don't raise it so focus is not stolen (especially if it's already up)
- -Fix: when the main window is closed while the command entry main loop is running, quit the CLI main loop first, so the Quit action can execute and break the outer main loop of the GUI
- -Fix: mark the PCB changed when the route style changes so it's saved
- -Add: a delete option to the route style selector
- -Add: explicit route style (pen style) for sizes diverged from any known style
- -Add: finish gtk preferences dialog's "Config PoV" subtree
- -Add: "save as" dialog with file format widget
- -Add: remember preferences tree expansion and other states when the dialog box needs to be rebooted
- -Add: implement fullscreen mode
- -Add: local grid implementation: optionally draw grid only in a small radius around the crosshair instead of on the whole screen (speeds up sw rendering on large screen)
- -Add: global grid can be sparse (drawing every Nth grid point only); min distance is a configuration item
- -Change: match gtk status line style with elegant lesstif status line
-
- [scconfig]
- -Fix: use generic code for plugin vs. plugin dependencies, deps are coded as data
- -Fix: various portability fixes for a working IRIX port
- -Add: revtest and revision stamps - this tool will let Makefile automatically request the user to reconfigure
- -Add: central distclean cleans src_3rd/
- -Add: --workaround-* system, with a gtk-ctrl workaround
- -Add: new cli arg for mass-enabling/disabling all plugins: --all=*
-
- [core]
- -Fix: hid input mouse scroll mixup: up and down were for scroll but left and right were for buttons. Prefix all scroll names with "scroll" (fixes macos pan-zoom-select bug)
- -Fix: cancel on "new pcb" makes sure PCB never ends up NULL; worst case it tries to create an empty PCB to fall back on or exits with a fatal error if even that fails
- -Fix: funchash should be case-insensitive (case insensitive actions and params)
- -Fix: introduce pcb_cardinal_t instead of redeclaring X's Cardinal
- -Fix: cursor position is Coord, not long - long won't work on 64 bit coords
- -Fix: initialize builtins before loading plugins so later buildin <-> plugin collision can be resolved by not loading the plugin
- -Fix: full-polygons are sensitive when clicked on the "clipped away" part
- -Fix: non-refactored line drc enforcement
- -Fix: qsort cmp function return value bug - wrong ordering of sources for the merge
- -Add: RouteStyle() action accepts style name, not only index
- -Add: action, change and undo code for chaning arc radii (width and height really) and start/delta angles
- -Add: new, future-proof layer API, phasing out the old API
- -Add: close polygon if the user clicks twice on the same point ('doubleclick'; like with the line tool; thanks to hzeller)
- -Add: message log entries have severity levels; user can configure color and whether the message log should pop up for each severity
- -Add: pcb-printf %mH prints human readable metric or imperial coords
- -Add: inhibit draw counter: when moving an element with all rubber bands (e.g. netlists) attached, inhibit redraw them individually, redraw only once, at the end
- -Add: reenable signals as detected by scconfig so that emergency save can run on crash
- -Change: attribute list in all object types
- -Split: layer.[ch] from misc.[ch]; the layer code is large and complex enough to get an own module; it's also in-line with the module-per-object-type idea
-
- [util]
- -Add: workaround script to comment out #warnings in a source file (for real C89 targets)
- -Add: gsch2pcb-rnd: warn for old config overriding pcb-rnd search paths
- -Add: install gnet pcb forward backend so that import_sch works out of the box
-
-pcb-rnd 1.1.1 (r2683)
-~~~~~~~~~~~~~
- [io_kicad_legacy]
- - Add: save paste buffer elements to kicad (legacy) .mod as native format
-
- [scconfig]
- -Change: remove config.manul.h (use scconfig CLI args instead), rename config.auto.h to config.h
- -Change: coord type, the corresponding MAX value and abs() function should not be set manually in config.manual.h; ./configure --coord=32 or --coord=64 sets these all, 32 being the default value for now
- -Change: move the dot_pcb_rnd setting from manual config header to scconfig (CLI arg)
- -Fix: don't attempt to use -rdynamic for compilation, only for linking
- -Fix: accept that IS_LNK may not be set (using conditional variable reference)
- -Fix: working cross-compilation: proper separation of host and target tools (cp, ln, ar and friends are part of the build system, use the host version)
- -Add: ./configure --enable-dmalloc detects dmalloc
- -Add: detect dbus and compile the plugin if enabled
- -Add: windows port: detect LoadLibrary(), _getcwd()/getwd(), _spawnvp, getpwuid, realpath, rint(), mkdtemp and mkdir/_mkdir
- -Cleanup: split up config.auto.h.in: move dbus related item to dbus and gl related items to gtkhid-gl to keep central part plugin-neutral
- -Cleanup: stop using HAVE_WHATEVER_H, rahter generate the #includes per function
-
- [core]
- -API change: rtree returns success and optionally sets the number of objects found - this allows the caller to avoid long jumps to stop the search at the first hit
- -Fix: action names are case-insensitive again
- -Fix: don't crash if select-by-text gets empty name or cancel
- -Fix: undo crashes/asserts for updating NULL rtree with selected element text
- -Split: huge find.c in smaller files, per topic
- -Change: use genregex minilib instead of POSIX regex, for better portability
- -Cleanup: remove find.c dead code
- -Cleanup: rtree API names return values instead of using 0..1
- -Cleanup: const correctness in EvaluateFileName
- -Cleanup: introduce pcb_rnd(), which is a wrapper around rand() (or optionally, random()). rand() is portable, but on some very old system may be weak.
- -Cleanup: introduce pcb_strdup() and pcb_strndup() and avoid using non-C89 libc calls
- -Cleanup: always provide pcb_mkdir() as a portability wrapper around mkdir; all code should use this instead of mkdir()
- -Cleanup: remove #ifdef wrapping of standard C89 header #includes - it's reasonable to assume/require proper C89 support more than 25 years after the standard came out
- -Cleanup: a set of unused/obsolete #includes
- -Cleanup: convert const.h #defines into enums (for the type, namespace and debugging); also proper name prefixing
- -Cleanup: move route-style specific function from action-oriented set.c to object-oriented route-style.c
- -Cleanup: rename SwapBuffers to pcb_swap_buffers for proper prefixing (win32 API name collision)
- -Add: central function for looking up a routing style using a sparse list of properties
-
- [gtk]
- -Fix: gtk gdk background image drawing: clip for negative pan to avoid artifacts and segfault
- -Fix: remember Messages() that are written before the message window is set up and append them in the window when it is already constructed
- -Fix: do not crash if there is no route style defined, just go with an empty style section and let the user create new styles
- -Fix: rework the win32-workarounds for corss-compiling
- -Fix: always update bottom style printout when the style changes, even if there's no matching stock style (thanks to miloh for reporting this)
- -Add: a mandatory route style to indicate non-matching types (hidden in the menu)
- -Add: optional file format combo box on the save as dialog
- -Change: use round radio buttons instead of rectangular toggle buttons for the layer preferences table - on some setups gtk theme made the buttons unreadable
-
- [mods]
- -Add: import plugin API
- -Add: new features in the I/O API to support user-selected output format and listing available formats
- -Split: move out netlist read from the io plug code to a separate import plugin
- -Cleanup: remove edif stub, convert edif to an import plugin
- -Cleanup: do not attempt to extract password entries manually in random plugins, use the central user name retrival function - easier to port, heuristics not duplicated
- -Cleanup: ps export: get rid of non-portable alloca() - polygrid is used rarely, performance penalty of malloc() should not be a problem
- -Cleanup: pcb I/O: do not use non-portable bzero, prefer memset()
- -Fix: dbus: if there's no GUI by the time dbus is uninitialized, don't call it
-
- [doc-rnd]
- -Split: move out developer docs from doc-rnd/ to doc-rnd/hacking
- -Add: windows cross-compilation notes
- -Add: hacking doc for writing importers (incldues a description of the main pcb data structures)
-
- [conf]
- -Fix: gtk gui preferences saves editor/auto_place in the config file
- -Fix: gtk preferences' general tab should also save editor/save_in_tmp
-
- [w32]
- -Add: minipack: recipe for pkg-config
- -Fix: minipack: calculate output filename for wget so that ?download suffix can be truncated
- -Fix: minipack: don't attempt to build pcb-rnd from minipack (policy: minipack builds all deps then we crosscompile pcb-rnd)
- -Update: minipack: gd and tiff recipes for newer versions
-
-pcb-rnd 1.1.0
-~~~~~~~~~~~~~
- [conf] - full rewrite of the config settings subsystem
- - Del: settings, color files, preferences - everything is in the conf system from now
- - Add: config settings are stored in structured lihata files on different levels
- - Add: all config setting are equal - they can be stored in system, user, project or design file
-
- [core] - cleanup
- -Fix: editing text should properly update the rtree
- -Fix: Display(PinOrPadName) doesn't use crosshair directly, without checking validity, but uses getxy which asks the user in turn, if the crosshair is invalid
- -Fix: ortho draw lines, polys and poly holes did not update last drawn point and generally did not work
-
- -Cleanup: remove a bunch of excess #includes to reduce the amount of deps
- -Cleanup: rename keepaway to clearance; terminology: clearance is copper vs. copper spacing; keepaway is any other spacing
- -Cleanup: generic dead-code and compiler warning removal
- -Change: menus: make a new Maintenance submenu in the File menu, move printer calibration and library rescan there
-
- [poly] - bugfix
- -Fix: don't xor-overdraw the first line of a poly rubber band while drawing the second line so it doesn't cancel itself out
- -Fix: first click of the poly hole is also the first point of the hole
- -Fix: reset attached object state after finishing a poly hole so that the second hole doesn't start in invalid state (caused poly duplication)
- -Fix: don't let the user start drawing a poly hole if first click is not a poly
- -Add: draw assumed closing rubber band line dashed
-
- [dynstyle]
- -Fix: number of styles is not limited anymore (styles is a dynamic vector)
-
- [res]
- -Fix: dynamic menu insertion bug: don't add new level if it is already added
-
- [mods]
- -Fix: report doesn't crash if there's nothing to report
- -Add: debug plugin to host core debugging actions so that they can be removed from core
- -Add: debug plugin to tmpasm lists
- -Add: io_* hooks - native file formats are plugins now
- -Change: turn .pcb (.fp) file IO code into plugin io_pcb
- -Add: io_pcb can save (CFR_DESIGN) config in the design as attributes
- -Add: central infrastructure for per plugin help (usage), plus the help text in each plugin
- -Add: fp_rehash() action to trigger a rehash
-
- [gtk]
- -Fix: double-zoom GUI lockup, pan+scroll wheel lockup
- -Fix: shift+mouse click should work
- -Fix: preferences window now easily fit in 800x600
- -Fix: don't destroy the tooptip timer when it destroys itself - fixes the famous tooltip glib warning
- -Fix: gtk warning/assert introduced by r1439: toolbar can not be a vbox, the parent vbox needs to be tracket separately
- -Fix: abs() handling with non-int types - more proper handling of coords on corner cases like tiny objects (contributed by Chris Smith)
- -Cleanup: dialog titles should be pcb-rnd, not PCB
- -Add: properly remember window positions and sizes, save and reload them if the user enabled the feature
-
- [scconfig]
- -Fix: really compile if there's no glib installed and no glib-dependent plugin selected
- -Fix: remove m4 bin from config.h template - no code uses this anymore; do not even detect m4, it's not needed anywhere
- -Fix: reorder link command for the main executable so that libs end up at the end of the link list (some linkers are sensitive to this)
- -Fix: various random fixes for a mac port
- -Del: hid.conf: not needed anymore, hid types are managed differently
- -Cleanup: C89 always has atexit() and there's no on_exit
- -Add: --debug (that shoudl enable asserts and -g) and a tmpasm script to set cflags accordingly
- -Add: detect gettext if intl is requested
- -Add: detect bison/flex (with an option to disable it)
-
-pcb-rnd 1.0.10
-~~~~~~~~~~~~~~
- [res] - resource->lihata conversion
- -Add: new action: CreateMenu()
- -Add: centralized hid keyboard handling API
- -Add: optional: a gtk-clone multi-key capable menu file that copies gschem's hotkeys mostly
- -Change: remove res parser, use lihata instead; affected plugins: hid_gtk, hid_lesstif, vendordrill
- -API CHANGE: dynamic create menu call API takes a string path, not an already splitted array
- -Update: keylist html generator util works from lihata and handles multikey
- -Fix: remove hardwired layer selection key bindings, use configured hotkeys (alternative menu files may want to use the same keys differently, hardwired keys are bad)
-
- [library_t] - library data structure cleanup/rewrite
- - Change: replace MenuEntry and related code to a library_t
- - Add: allow a generic tree representation in footprint library
-
- [reduce] - reduce code size without losing actual functionality
- -Del: extern "C": pcb is a pure C project, if someone wants to include headers from whatever other language, he should take care of it on that side
- -API CHANGE: rewrite action_funchash to not use custom local hash but genht and to offer cookie based namespaces for modules
- -Cleanup: rename action_funclist to funchash_core_list to decouple functions from actions
-
- [scconfig]
- -Fix: scconfig/build doesnt' fail even if lesstif is not installed
- -Fix: do not attempt to detect libgtk is the gtk hid is disabled
- -Fix: don't detect gd if it's not needed; disable exporters that depend on GD if required parts are not available
- -Fix: relax gcode/nelma png requirements: print a warning about reduced functionality but let them compile if there's no png but gd is present
- -Fix: get the dep file sorted by target; this should avoid unintended changes introduced by unordered lists
- -Change: split up the tmpasm list of modules so that it's easier to get gsch2pcb link again using whatever backend plugins
- -Cleanup: move strflags test code to regression/
- -Change: portability, realpath are compat_*; compat.[ch] split to _dl and _misc
- -Move: remove Makefile.in.mod, move module tmpasm files to src_plugins/
- -Add: detect libstroke and compile with the right cflags and ldflags
- -Add: tool to quote files into C strings; generate compiled-in, C versions of the new lht menu files, per hid
-
- [mods]
- -Add: API to remove functions by cookie
- -Add: print warning if a module leaves anything in the func hash at exit
- -Add: infrastructure for switching from one gui to another
- -Add: fp_wget: web based footprint implementation, gedasymbols.org integration
- -Move: command.[ch] to a shorthand command plugin (shand_cmd)
- -Move: report to a feature plugin
- -Move: fp_fs plugin: separate footprint code from file.[ch]
- -Move: move debug actions from lesstif to comomn "oldactions" as they are not GUI-dependant and might be generally useful
- -Move: hid/common/ to core hid_*, split up large, random collections of functions by purpose
- -Move: split and rename action.[ch] to make room for hid-common actions.[ch] in core and avoid confusion in names; rename actions.h to hid_actions.h for naming consistency
- -Move: HIDs to plugins, removing the hid/ directory
- -Move: hidgl to a separate plugin (to be compiled later)
- -Fix: event unbind shouldn't segfault if multiple adjacent events are free'd
- -Fix: event_bind() takes cookie as const char *, not as void * to comform the convention
- -Fix: hids install and uninstall actions, flags and attributes only around their do_export main loop so they don't conflict
-
- [leak] - cleaning up memory leaks
- -Add: hid attribute remove by cookie
- -Fix: lesstif and gtk hids remove their attributes
- -Fix: vendordrill free()s all cache memory used when the cache is discarded
-
- [gtk]
- -Fix: make sure menubar is always wide enough to expose all buttons (using a hidden invisible hbox of calculated size)
- -Add: copy accel key menuitems from gschem and take over keyboard handling; hid_gtk now supports multi-key hotkeys
- -Add: set tooltip on menu items
- -Add: include all hotkeys in the tooltip for submenus
-
- [lesstif]
- -Del: remove dumpkeys action/code: this info should be extracted from the lihata file
- -Fix: there should be no global variable named 'n' in lesstif; make the stdarg thing a bit more robust and reusable
- -Add: reenable code to set set menu font and color
-
- [core]
- -Fix: draw_pad() used uninitialized pad color
- -Add: SwitchHID action to change the HID module on the fly (works partially)
-
- [png]
- -Fix: png max dpi should be 10k - modern printers easily do 2400 but some models are said to do 9600 DPI in one direction
-
- [gpmi]
- -Fix: auto-copy .so files to src's plugin dir on compile so that running from source always has the latest .so files
-
-
-pcb-rnd 1.0.9
-~~~~~~~~~~~~~
- [unglib]
- -Fix: replace glib with minilibs in core and util/
- -Del: remove local dynamic string implementation in favor of genvector
- -Move: vector.[ch] is used only by the autorouter, move it there
-
- [scconfig]
- -Add: print warnings if glib is not found and selected components need to be left out
- -Add: repeate some of the critical messages below the summary
- -Fix: compiler warnings
- -Fix: instead of two booleans, implement a 3-state "/controls" node with values disable, buildin, plugin for the plugins
- -Change: better module summary printout at the end of ./configure
- -Fix: use -fPIC on x86_64 to make sure plugins link
- -Fix: gpmi plugin installation bugs
- -Fix: src/plugin is cleaned on make clean
-
- [leak]
- -API CHANGE: plugin init should return a pointer to the plugin uninit function
- -Fix: a bunch of random memory leaks
- -Fix: a bunch of potential buffer overruns
- -Add: central infrastructure for uninit'ing GUI hids
- -Fix: missing closedir()
- -Add: uninit paste buffers
- -Add: actions, flags and attributes are registered with a cookie so they an be deleted by cookie
- -Fix: uninit plugins before hids so they have a chance to clean up registrations
- -Fix: don't use dynamic strings where printing quoted string directly to a file would work
-
- [mods]
- -Change: convert the ps and lpr exporters into configurable exporter plugins
- -Rename: edif plugin to import_edif for consistency
- -Change: move gcode and nelma from hid to plugin
- -Move: gerber, bom and png to expoter plugins
- -Cleanup: move old/unused/legacy functions to a new plugin called legacy_func
- -Change: move fontmode to a separate plugin
-
- [core]
- -Change: use a hash for flag storage - faster and simpler code
-
- [gpmi]
- -Add: expotert hid callback for filled pad exporting
-
-pcb-rnd 1.0.8
-~~~~~~~~~~~~~
- [doc-rnd]
- -Add: djopt examples
-
- [mods]
- -Cleanup: split up action.c and spread the code in core and plugins
- -Move: action pscalib() to the ps hid code
- -Move: autoplace to a core plugin
- -Move: autoroute to a core plugin
- -Move: dbus to a defunct core plugin
- -Move: djopt to a core plugin
- -Move: edif to a core plugin
- -Move: gpmi to a core plugin
- -Move: import_sch to a core plugin
- -Move: mincut to a core plugin
- -Move: oldactions to a core plugin
- -Move: puller to a core plugin
- -Move: renumber to a core plugin
- -Move: stroke to a core plugin
- -Move: toporouter to a core plugin
- -Move: vendordrill to a core plugin
-
- [ba]
- -Add: when applying patches to the edited netlist, create missing nets
- (new connections may implicitly define new nets)
- -Fix: get the renumber action() fixed
- -Fix: enable net(add,net,pin) action again and make it operate on the
- edited netlist for the back annotation to take notes of the
- changes made
-
- [libstroke]
- -Add: menu in the gtk hid's res to toggle stroke enable
- -Fix: osolete calls in libstroke action - libstroke support compiles now
- -Fix: get the gtk gui call the central crosshair move event handler
- instead of reproducing its code locally (... without libstroke)
-
- [util]
- -Add: make clean
- -Fix: compiler warnings, mostly unused vars in gsch2pcb
- -Cleanup: indentation in gsch2pcb
-
-
-pcb-rnd 1.0.7
-~~~~~~~~~~~~~
- -Cleanup: src/ should compile in c89 - no more // comments and variables declared in for()
- -Cleanup: const correctness in src/
- -Cleanup: missing #includes in src/
- -Cleanup: unified, tab based indentation all over src/
- -Cleanup: move dmalloc include to central config.h
- -Cleanup: move gts to src/3rd
- -Cleanup: remove old/obsolete files inherited from the fork
- -Cleanup: rename doc/ to doc-orig/ to avoid confusion and make it compile
- -Fix: poly pin bounding box calculation adds clearance as rtree expects ([square])
- -Fix: loading default.pcb shouldn't override cursor pos and board sizes and shoudln't cause file date to be changed in the gui hids since it is loading a "misc" file
- -Add: README in each main directory to explain what the directory is for
-
-pcb-rnd 1.0.6
-~~~~~~~~~~~~~
- [cycdrag]
- -Add: "negative sized" selection selects anything that touches
- -Add: cycle drag object action
-
- [scconfig]
- -Fix: toporouter Makefile module adds its own action registration code,
- so the central Makefile is independent of toporouter
- -Add: --disable-toporouter
- -Fix: use cc/cc for c compiler (so that it can be overridden)
- -Fix: remove -std=gnu99: -std=c99 breaks with new gcc and -std is not
- really portable
- -Fix: include genht before glib.h because glib.h ruins inline
-
- [pinnum]
- -Add: action and key binding for changing pin numbers in a footprint
-
- [gpmi]
- -Fix: typo in hotkey name for manage plugins (reported by Bert Timmerman)
-
- [util]
- -Fix: keylist: tolerate whitepsace in key sequences
- -Fix: keylist resets locale to avoid broken table when gawk tries to
- be too clever
-
-
-pcb-rnd 1.0.5
-~~~~~~~~~~~~~
- [onpoint]
- -Add: Robert Drehmel's on-point patch adapted for pcb-rnd
-
- [scconfig]
- -Fix: properly configure and build and install even if there's space
- in the source path (thanks to Jason White)
- -Fix: take genht from the local copy, don't depend it being installed
-
-pcb-rnd 1.0.4
-~~~~~~~~~~~~~
- [ba]
- -Add: back annotation
-
- [core]
- -Fix: suppress no-font error message while loading default.pcb - the actual font is coming from the default font file
-
- [pcblib-param]
- -Add: screw(), low level
- -Fix: typo in the help of rcy()
-
- [mincut]
- -Fix: solve debug works again
- -Fix: make debug pngs during load optional
- -Fix: don't use function-in-function - that's a gcc-specific feature
- -Fix: don't use alloca(), use malloc() (C99)
- -Add: Makefile to test against known refs
-
- [pcb-fp]
- -Fix: gtk lib window tag print doesn't segfault if there are no tags for a footprint
- -Del: local hash and library search implementation for footprint names in buffer.c - libpcb_fp should handle this
-
-pcb-rnd 1.0.3
-~~~~~~~~~~~~~
- [gpmi]
- -Add: GPMI plugin/buildin for scripiting (import of project pcb-gpmi)
-
- [tostyle]
- -Add: new feature to adjust the sizes of object(s) to the values of the current routing style
-
- [pcb-fp]
- -Add: support for parsing and caching footprint tags (file elements)
- -Add: the gtk HID displays tags
- -Add: the gtk HID can filter for tags
-
- [pcblib-param]
- -Add: bga()
- -Add: generic qf() generator
- -Add: qfn() - based on qf()
- -Add: qfp() - based on qf()
- -Add: plcc() - based on qf()
- -Add: qsop() - based on so()
- -Add: silkmark: accept multiple values
- -Add: silkmark: can be external
- -Add: silkmark: new styles exteranl45, dot, circle, and arc
- -Add: connector() has a sequence option to change pin numbering
- -Add: some tunings for connector sequence=zigzag to do something usable with etrunc=1
-
- [hid]
- -Add: dynamic menus: create_menu(), menu paths, runtime insertion of menus in core
- -Add: dynamic menus in gtk
- -Add: dynamic menus in lesstif
- -Fix: more const correctness in dialog box code
-
- [scconfig]
- -Add: ./configure --help
- -Add: print configuration summary at the end
- -Add: autodetect HOST (use sys/sysid)
- -Add: src/3rd for central hosting of 3rd party software libs
- -Add: support "buildins": plugins built into the code
- -Change: move genht to src/3rd; policy: prefer genht over glib hash
- -Fix: tests try to run pcb-rnd, not pcb
- -Fix: central LDFLAGS and CFLAGS should contain the ldflags/cflags detected for generic use
-
- [pcb-mincut]
- -Merge: pcb-mincut is imported in pcb-rnd, the extern repo will be removed
-
- [core]
- -Add: event subsystem
- -Add: gui_init event
- -Add: generic plugin support: track plugins loaded, have a menu for managing them
- -Add: more accessors to query unit details - for the gpmi scripts
- -Add: pcb-printf %mI prints coordinate in internal coord format
- -Add: calls for removing actions
- -Add: calls for removing a hid (useful for removing exporter hids registered by scripts)
- -Add: path resolution: support ~ in paths
- -Add: real regex search and real string list search (in search by name actions)
- -Change: switch over actions from bsearch() to a genht hash - simpler code, potentially also faster
- -Fix: don't allow the registration of an action with a name that's already registered
-
-
- [fp2anim]
- -Add: optional dimension lines
- -Add: more fine grained annotation control
- -Change: switch over to vector fonts for better scaling
- -Fix: draw rounded pads (new pad syntax only)
- -Fix: make sure to generate sane arcs
-
- [doc-rnd]
- -Add: official central key list
-
-pcb-rnd 1.0.2
-~~~~~~~~~~~~~
- [pcblib-param]
- -Fix: central bool handling (connector() etrunc), values: on/off, true/false, 1/0
- -Fix: typo in so() parameter descriptions
- -Fix: connector() typo in error()
- -Add: more elaborate help syntax: easier to read with scripts
-
- [fp2anim]
- -Fix: read multiline directives properly - a newline after each directive is still needed, tho
- -Fix: allow whitepsace between directive name and opening bracket
- -Fix: create all layers in advance - this fixes the case when the fp doesn't draw on some layers (the macro still exists)
- -Fix: rline() is extended by width/2 if there are no rounding; it seems this how pcb defines lines
- -Fix: leave extra margin in photo mode for the 3d edges
- -Add: support for old-style pad()
- -Add: support for Mark() (relocate the diamond)
- -Add: options to turn off the grid and annotation - useful for thumbnails
-
- [scconfig]
- -Fix: always have config.h, don't ifdef it
- -Fix: glib is a core dependency that should be added even if the gtk hid is not used
- -Fix: make clean removes pcb-rnd, not pcb (executable file name typo)
- -Add: make clean in util/
- -Add: options to disable gd and/or jpeg or png or gif
- -Add: be able to detect and configure lesstif
- -Add: --disable-gtk and --disable-lesstif; --disable-xinerama and --disable-xrender for lesstif
- -Add: use detected -rdynamic so that plugins can link against the executable
- -Change: detect both gtk and lesstif as optional dependencies
- -Cleanup: generate hidlist.h from tmpasm instead of shell to remove shell dependency
- -Del: a bunch of obsolete #defines inherited from auto*
-
- [core]
- -Add: --gui explicitly selects a gui hid
- -Add: don't leave preferred order of GUIs to the chance, make it explicit
-
-
-pcb-rnd 1.0.1
-~~~~~~~~~~~~~
- [core]
- -Fix: don't read beyond the common part of the struct in IsPointInPad (since it's called for lines too, and those have much less fields)
- -Fix: where stdarg is avaialble, also print messages to stderr - useful if things go wrong before a GUI is working
-
- [gtk]
- -Fix: don't crash but write error message and exit if gpcb-menu.res is empty
-
- [square]
- -Fix: 90 deg rotation rotates shape style
- -Add: action.c and change.c code to get shaped vias
- -Fix: don't change pin shape for square and octagon in rotation
-
- [mincut]
- -Add: command line setting --enable-mincut (0 or 1) as mincut can be slow
- it is a global disbale setting and make a local, per pcb setting
- for enabling mincut; also add a per pcb setting/flag
- -Fix: disable debug draw by default
- -Fix: fall back to the old short warn method when mincut fails
- -Fix: avoid segfaults by detecting broken graph early
- -Workaround: if mincut sees a graph with multiple unconnected components, doesn't try to solve but falls back to randomly highlight something
-
- [intconn]
- -Workaround: find intconn pads only on the same layer
-
- [nonetlist]
- -Workaround: ignore nonetlist pads even if the flag is in the element name
-
- [scconfig]
- -Add: scconfig/ - switch over from autotools to scconfig
-
- [pcblib]
- -Cleanup: new, trimmed back pcblib/ with essential footprints only
-
- [pcblib-param]
- -Add: new parametric footprints - no more m4-hardwiring, use your
- preferred language!
- -Add: acy(), alf(), rcy(), connector(), dip()
- -Add: so(), tssop(), msop(), ssop()
-
- [pcb-fp]
- -Add: central lib for footprint search and load in pcb and gsch2pcb
-
- [util]
- -Add: gsch2pcb fork to support [nonetlist] and [pcblib-param]
-
- [fp2anim]
- -Add: fp to animator script for fast preview
-
- [polygrid]
- -Add: ps output: draw grid in polys instead of fill (doesn't fully work)
- -Fix: set proper max value so the control is enabled
-
-
- [debian]
- -Update: build the package with scconfig and footprint changes
-
-
-pcb-rnd 1.0.0
-~~~~~~~~~~~~~
- [square] -Add: initial implementation
- [intconn] -Add: initial implementation
- [nonetlist] -Add: initial implementation
- [flagcomp] -Add: initial implementation
- [mincut] -Add: initial implementation
Index: 1.1.4/src/set.h
===================================================================
--- 1.1.4/src/set.h (revision 10776)
+++ 1.1.4/src/set.h (nonexistent)
@@ -1,50 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996 Thomas Nau
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau@rz.uni-ulm.de
- *
- */
-
-/* prototypes for update routines */
-
-#ifndef PCB_SET_H
-#define PCB_SET_H
-
-#include "global.h"
-
-void SetTextScale(int);
-void SetGrid(Coord, pcb_bool);
-void SetZoom(double);
-void SetLineSize(Coord);
-void SetViaSize(Coord, pcb_bool);
-void SetViaDrillingHole(Coord, pcb_bool);
-void SetClearanceWidth(Coord);
-void SetChangedFlag(pcb_bool);
-void SetBufferNumber(int);
-void SetMode(int);
-void SetCrosshairRangeToBuffer(void);
-void SetLocalRef(Coord, Coord, pcb_bool);
-void RedrawZoom(Coord, Coord);
-void SaveMode(void);
-void RestoreMode(void);
-
-#endif
Index: 1.1.4/src/plug_footprint_act.c
===================================================================
--- 1.1.4/src/plug_footprint_act.c (revision 10776)
+++ 1.1.4/src/plug_footprint_act.c (nonexistent)
@@ -1,45 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This module, was written and is Copyright (C) 2016 by Tibor Palinkas
- * this module is also subject to the GNU GPL as described below
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "config.h"
-#include "global.h"
-#include "hid.h"
-#include "plug_footprint.h"
-
-static const char fp_rehash_syntax[] = "fp_rehash()" ;
-static const char fp_rehash_help[] = "Flush the library index; rescan all library search paths and rebuild the library index. Useful if there are changes in the library during a pcb-rnd session.";
-static int Action_fp_rehash(int argc, const char **argv, Coord x, Coord y)
-{
- fp_rehash();
- return 0;
-}
-
-
-HID_Action conf_plug_footprint_list[] = {
- {"fp_rehash", 0, Action_fp_rehash,
- fp_rehash_help, fp_rehash_syntax}
-};
-
-REGISTER_ACTIONS(conf_plug_footprint_list, NULL)
Index: 1.1.4/src/hid_color.c
===================================================================
--- 1.1.4/src/hid_color.c (revision 10776)
+++ 1.1.4/src/hid_color.c (nonexistent)
@@ -1,41 +0,0 @@
-#include "config.h"
-#include "global.h"
-#include "hid_color.h"
-#include
-#include "compat_misc.h"
-
-static hidval invalid_color = { 0 };
-
-#define HT_HAS_CONST_KEY
-typedef char *htsh_key_t;
-typedef const char *htsh_const_key_t;
-typedef hidval htsh_value_t;
-#define HT_INVALID_VALUE invalid_color
-#define HT(x) htsh_ ## x
-#include
-#include
-#undef HT
-
-
-int hid_cache_color(int set, const char *name, hidval * val, void **vcache)
-{
- htsh_t *cache;
- htsh_entry_t *e;
-
- cache = (htsh_t *) * vcache;
- if (cache == 0) {
- cache = htsh_alloc(strhash, strkeyeq);
- *vcache = cache;
- }
-
- if (!set) { /* read */
- e = htsh_getentry(cache, (char *)name);
- if (e == NULL) /* not found */
- return 0;
- memcpy(val, &e->value, sizeof(hidval));
- }
- else
- htsh_set(cache, pcb_strdup(name), *val); /* write */
-
- return 1;
-}
Index: 1.1.4/src/hid_color.h
===================================================================
--- 1.1.4/src/hid_color.h (revision 10776)
+++ 1.1.4/src/hid_color.h (nonexistent)
@@ -1,13 +0,0 @@
-#ifndef PCB_HID_COLOR_H
-#define PCB_HID_COLOR_H
-
-/* HID internal interfaces. These may ONLY be called from the HID
- modules, not from the common PCB code. */
-
-/* Used to cache color lookups. If set is zero, it looks up the name
- and if found sets val and returns nonzero. If not found, it
- returns zero. If set is nonzero, name/val is added to the
- cache. */
-int hid_cache_color(int set, const char *name, hidval * val, void **cache);
-
-#endif
Index: 1.1.4/src/rats.c
===================================================================
--- 1.1.4/src/rats.c (revision 10776)
+++ 1.1.4/src/rats.c (nonexistent)
@@ -1,921 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996 Thomas Nau
- *
- * This module, rats.c, was written and is Copyright (C) 1997 by harry eaton
- * this module is also subject to the GNU GPL as described below
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/* rats nest routines */
-
-#include "config.h"
-#include "conf_core.h"
-
-#include
-#include
-#include
-
-#include "create.h"
-#include "data.h"
-#include "draw.h"
-#include "error.h"
-#include "find.h"
-#include "misc.h"
-#include "layer.h"
-#include "polygon.h"
-#include "rats.h"
-#include "search.h"
-#include "undo.h"
-#include "stub_mincut.h"
-#include "route_style.h"
-#include "compat_misc.h"
-#include "netlist.h"
-
-#define TRIEDFIRST 0x1
-#define BESTFOUND 0x2
-
-/* ---------------------------------------------------------------------------
- * some forward declarations
- */
-static pcb_bool FindPad(const char *, const char *, ConnectionType *, pcb_bool);
-static pcb_bool ParseConnection(const char *, char *, char *);
-static pcb_bool DrawShortestRats(NetListTypePtr,
- void (*)(register ConnectionTypePtr, register ConnectionTypePtr, register RouteStyleTypePtr));
-static pcb_bool GatherSubnets(NetListTypePtr, pcb_bool, pcb_bool);
-static pcb_bool CheckShorts(LibraryMenuTypePtr);
-static void TransferNet(NetListTypePtr, NetTypePtr, NetTypePtr);
-
-/* ---------------------------------------------------------------------------
- * some local identifiers
- */
-static pcb_bool badnet = pcb_false;
-static pcb_cardinal_t SLayer, CLayer; /* layer group holding solder/component side */
-
-/* ---------------------------------------------------------------------------
- * parse a connection description from a string
- * puts the element name in the string and the pin number in
- * the number. If a valid connection is found, it returns the
- * number of characters processed from the string, otherwise
- * it returns 0
- */
-static pcb_bool ParseConnection(const char *InString, char *ElementName, char *PinNum)
-{
- int i, j;
-
- /* copy element name portion */
- for (j = 0; InString[j] != '\0' && InString[j] != '-'; j++)
- ElementName[j] = InString[j];
- if (InString[j] == '-') {
- for (i = j; i > 0 && ElementName[i - 1] >= 'a'; i--);
- ElementName[i] = '\0';
- for (i = 0, j++; InString[j] != '\0'; i++, j++)
- PinNum[i] = InString[j];
- PinNum[i] = '\0';
- return (pcb_false);
- }
- else {
- ElementName[j] = '\0';
- Message(PCB_MSG_DEFAULT, _("Bad net-list format encountered near: \"%s\"\n"), ElementName);
- return (pcb_true);
- }
-}
-
-/* ---------------------------------------------------------------------------
- * Find a particular pad from an element name and pin number
- */
-static pcb_bool FindPad(const char *ElementName, const char *PinNum, ConnectionType * conn, pcb_bool Same)
-{
- ElementTypePtr element;
- gdl_iterator_t it;
- PadType *pad;
- PinType *pin;
-
- if ((element = SearchElementByName(PCB->Data, ElementName)) == NULL)
- return pcb_false;
-
- padlist_foreach(&element->Pad, &it, pad) {
- if (NSTRCMP(PinNum, pad->Number) == 0 && (!Same || !TEST_FLAG(PCB_FLAG_DRC, pad))) {
- conn->type = PCB_TYPE_PAD;
- conn->ptr1 = element;
- conn->ptr2 = pad;
- conn->group = TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SLayer : CLayer;
-
- if (TEST_FLAG(PCB_FLAG_EDGE2, pad)) {
- conn->X = pad->Point2.X;
- conn->Y = pad->Point2.Y;
- }
- else {
- conn->X = pad->Point1.X;
- conn->Y = pad->Point1.Y;
- }
- return pcb_true;
- }
- }
-
- padlist_foreach(&element->Pin, &it, pin) {
- if (!TEST_FLAG(PCB_FLAG_HOLE, pin) && pin->Number && NSTRCMP(PinNum, pin->Number) == 0 && (!Same || !TEST_FLAG(PCB_FLAG_DRC, pin))) {
- conn->type = PCB_TYPE_PIN;
- conn->ptr1 = element;
- conn->ptr2 = pin;
- conn->group = SLayer; /* any layer will do */
- conn->X = pin->X;
- conn->Y = pin->Y;
- return pcb_true;
- }
- }
-
- return pcb_false;
-}
-
-/*--------------------------------------------------------------------------
- * parse a netlist menu entry and locate the corresponding pad
- * returns pcb_true if found, and fills in Connection information
- */
-pcb_bool SeekPad(LibraryEntryType * entry, ConnectionType * conn, pcb_bool Same)
-{
- int j;
- char ElementName[256];
- char PinNum[256];
-
- if (ParseConnection(entry->ListEntry, ElementName, PinNum))
- return (pcb_false);
- for (j = 0; PinNum[j] != '\0'; j++);
- if (j == 0) {
- Message(PCB_MSG_DEFAULT, _("Error! Netlist file is missing pin!\n" "white space after \"%s-\"\n"), ElementName);
- badnet = pcb_true;
- }
- else {
- if (FindPad(ElementName, PinNum, conn, Same))
- return (pcb_true);
- if (Same)
- return (pcb_false);
- if (PinNum[j - 1] < '0' || PinNum[j - 1] > '9') {
- Message(PCB_MSG_DEFAULT, "WARNING! Pin number ending with '%c'"
- " encountered in netlist file\n" "Probably a bad netlist file format\n", PinNum[j - 1]);
- }
- }
- Message(PCB_MSG_DEFAULT, _("Can't find %s pin %s called for in netlist.\n"), ElementName, PinNum);
- return (pcb_false);
-}
-
-/* ---------------------------------------------------------------------------
- * Read the library-netlist build a pcb_true Netlist structure
- */
-
-NetListTypePtr ProcNetlist(LibraryTypePtr net_menu)
-{
- ConnectionTypePtr connection;
- ConnectionType LastPoint;
- NetTypePtr net;
- static NetListTypePtr Wantlist = NULL;
-
- if (!net_menu->MenuN)
- return (NULL);
- FreeNetListMemory(Wantlist);
- free(Wantlist);
- badnet = pcb_false;
-
- /* find layer groups of the component side and solder side */
- SLayer = GetLayerGroupNumberByNumber(solder_silk_layer);
- CLayer = GetLayerGroupNumberByNumber(component_silk_layer);
-
- Wantlist = (NetListTypePtr) calloc(1, sizeof(NetListType));
- if (Wantlist) {
- ALLPIN_LOOP(PCB->Data);
- {
- pin->Spare = NULL;
- CLEAR_FLAG(PCB_FLAG_DRC, pin);
- }
- ENDALL_LOOP;
- ALLPAD_LOOP(PCB->Data);
- {
- pad->Spare = NULL;
- CLEAR_FLAG(PCB_FLAG_DRC, pad);
- }
- ENDALL_LOOP;
- MENU_LOOP(net_menu);
- {
- if (menu->Name[0] == '*' || menu->flag == 0) {
- badnet = pcb_true;
- continue;
- }
- net = GetNetMemory(Wantlist);
- if (menu->Style) {
- int idx = pcb_route_style_lookup(&PCB->RouteStyle, 0, 0, 0, 0, menu->Style);
- if (idx >= 0)
- net->Style = PCB->RouteStyle.array+idx;
- }
- else /* default to NULL if none found */
- net->Style = NULL;
- ENTRY_LOOP(menu);
- {
- if (SeekPad(entry, &LastPoint, pcb_false)) {
- if (TEST_FLAG(PCB_FLAG_DRC, (PinTypePtr) LastPoint.ptr2))
- Message(PCB_MSG_DEFAULT, _
- ("Error! Element %s pin %s appears multiple times in the netlist file.\n"),
- NAMEONPCB_NAME((ElementTypePtr) LastPoint.ptr1),
- (LastPoint.type ==
- PCB_TYPE_PIN) ? ((PinTypePtr) LastPoint.ptr2)->Number : ((PadTypePtr) LastPoint.ptr2)->Number);
- else {
- connection = GetConnectionMemory(net);
- *connection = LastPoint;
- /* indicate expect net */
- connection->menu = menu;
- /* mark as visited */
- SET_FLAG(PCB_FLAG_DRC, (PinTypePtr) LastPoint.ptr2);
- if (LastPoint.type == PCB_TYPE_PIN)
- ((PinTypePtr) LastPoint.ptr2)->Spare = (void *) menu;
- else
- ((PadTypePtr) LastPoint.ptr2)->Spare = (void *) menu;
- }
- }
- else
- badnet = pcb_true;
- /* check for more pins with the same number */
- for (; SeekPad(entry, &LastPoint, pcb_true);) {
- connection = GetConnectionMemory(net);
- *connection = LastPoint;
- /* indicate expect net */
- connection->menu = menu;
- /* mark as visited */
- SET_FLAG(PCB_FLAG_DRC, (PinTypePtr) LastPoint.ptr2);
- if (LastPoint.type == PCB_TYPE_PIN)
- ((PinTypePtr) LastPoint.ptr2)->Spare = (void *) menu;
- else
- ((PadTypePtr) LastPoint.ptr2)->Spare = (void *) menu;
- }
- }
- END_LOOP;
- }
- END_LOOP;
- }
- /* clear all visit marks */
- ALLPIN_LOOP(PCB->Data);
- {
- CLEAR_FLAG(PCB_FLAG_DRC, pin);
- }
- ENDALL_LOOP;
- ALLPAD_LOOP(PCB->Data);
- {
- CLEAR_FLAG(PCB_FLAG_DRC, pad);
- }
- ENDALL_LOOP;
- return (Wantlist);
-}
-
-/*
- * copy all connections from one net into another
- * and then remove the first net from its netlist
- */
-static void TransferNet(NetListTypePtr Netl, NetTypePtr SourceNet, NetTypePtr DestNet)
-{
- ConnectionTypePtr conn;
-
- /* It would be worth checking if SourceNet is NULL here to avoid a segfault. Seb James. */
- CONNECTION_LOOP(SourceNet);
- {
- conn = GetConnectionMemory(DestNet);
- *conn = *connection;
- }
- END_LOOP;
- DestNet->Style = SourceNet->Style;
- /* free the connection memory */
- FreeNetMemory(SourceNet);
- /* remove SourceNet from its netlist */
- *SourceNet = Netl->Net[--(Netl->NetN)];
- /* zero out old garbage */
- memset(&Netl->Net[Netl->NetN], 0, sizeof(NetType));
-}
-
-static pcb_bool CheckShorts(LibraryMenuTypePtr theNet)
-{
- pcb_bool newone, warn = pcb_false;
- PointerListTypePtr generic = (PointerListTypePtr) calloc(1, sizeof(PointerListType));
- /* the first connection was starting point so
- * the menu is always non-null
- */
- void **menu = GetPointerMemory(generic);
-
- *menu = theNet;
- ALLPIN_LOOP(PCB->Data);
- {
- ElementType *e = pin->Element;
-/* TODO: should be: !TEST_FLAG(PCB_FLAG_NONETLIST, (ElementType *)pin->Element)*/
- if ((TEST_FLAG(PCB_FLAG_DRC, pin)) && (!(e->Flags.f & PCB_FLAG_NONETLIST))) {
- warn = pcb_true;
- if (!pin->Spare) {
- Message(PCB_MSG_DEFAULT, _("Warning! Net \"%s\" is shorted to %s pin %s\n"),
- &theNet->Name[2], UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(pin->Number));
- stub_rat_found_short(pin, NULL, &theNet->Name[2]);
- continue;
- }
- newone = pcb_true;
- POINTER_LOOP(generic);
- {
- if (*ptr == pin->Spare) {
- newone = pcb_false;
- break;
- }
- }
- END_LOOP;
- if (newone) {
- menu = GetPointerMemory(generic);
- *menu = pin->Spare;
- Message(PCB_MSG_DEFAULT, _("Warning! Net \"%s\" is shorted to net \"%s\"\n"),
- &theNet->Name[2], &((LibraryMenuTypePtr) (pin->Spare))->Name[2]);
- stub_rat_found_short(pin, NULL, &theNet->Name[2]);
- }
- }
- }
- ENDALL_LOOP;
- ALLPAD_LOOP(PCB->Data);
- {
- ElementType *e = pad->Element;
-/* TODO: should be: !TEST_FLAG(PCB_FLAG_NONETLIST, (ElementType *)pad->Element)*/
- if ((TEST_FLAG(PCB_FLAG_DRC, pad)) && (!(e->Flags.f & PCB_FLAG_NONETLIST)) && (!(e->Name->Flags.f & PCB_FLAG_NONETLIST))) {
- warn = pcb_true;
- if (!pad->Spare) {
- Message(PCB_MSG_DEFAULT, _("Warning! Net \"%s\" is shorted to %s pad %s\n"),
- &theNet->Name[2], UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(pad->Number));
- stub_rat_found_short(NULL, pad, &theNet->Name[2]);
- continue;
- }
- newone = pcb_true;
- POINTER_LOOP(generic);
- {
- if (*ptr == pad->Spare) {
- newone = pcb_false;
- break;
- }
- }
- END_LOOP;
- if (newone) {
- menu = GetPointerMemory(generic);
- *menu = pad->Spare;
- Message(PCB_MSG_DEFAULT, _("Warning! Net \"%s\" is shorted to net \"%s\"\n"),
- &theNet->Name[2], &((LibraryMenuTypePtr) (pad->Spare))->Name[2]);
- stub_rat_found_short(NULL, pad, &theNet->Name[2]);
- }
- }
- }
- ENDALL_LOOP;
- FreePointerListMemory(generic);
- free(generic);
- return (warn);
-}
-
-
-/* ---------------------------------------------------------------------------
- * Determine existing interconnections of the net and gather into sub-nets
- *
- * initially the netlist has each connection in its own individual net
- * afterwards there can be many fewer nets with multiple connections each
- */
-static pcb_bool GatherSubnets(NetListTypePtr Netl, pcb_bool NoWarn, pcb_bool AndRats)
-{
- NetTypePtr a, b;
- ConnectionTypePtr conn;
- pcb_cardinal_t m, n;
- pcb_bool Warned = pcb_false;
-
- for (m = 0; Netl->NetN > 0 && m < Netl->NetN; m++) {
- a = &Netl->Net[m];
- ResetConnections(pcb_false);
- RatFindHook(a->Connection[0].type, a->Connection[0].ptr1, a->Connection[0].ptr2, a->Connection[0].ptr2, pcb_false, AndRats);
- /* now anybody connected to the first point has PCB_FLAG_DRC set */
- /* so move those to this subnet */
- CLEAR_FLAG(PCB_FLAG_DRC, (PinTypePtr) a->Connection[0].ptr2);
- for (n = m + 1; n < Netl->NetN; n++) {
- b = &Netl->Net[n];
- /* There can be only one connection in net b */
- if (TEST_FLAG(PCB_FLAG_DRC, (PinTypePtr) b->Connection[0].ptr2)) {
- CLEAR_FLAG(PCB_FLAG_DRC, (PinTypePtr) b->Connection[0].ptr2);
- TransferNet(Netl, b, a);
- /* back up since new subnet is now at old index */
- n--;
- }
- }
- /* now add other possible attachment points to the subnet */
- /* e.g. line end-points and vias */
- /* don't add non-manhattan lines, the auto-router can't route to them */
- ALLLINE_LOOP(PCB->Data);
- {
- if (TEST_FLAG(PCB_FLAG_DRC, line)
- && ((line->Point1.X == line->Point2.X)
- || (line->Point1.Y == line->Point2.Y))) {
- conn = GetConnectionMemory(a);
- conn->X = line->Point1.X;
- conn->Y = line->Point1.Y;
- conn->type = PCB_TYPE_LINE;
- conn->ptr1 = layer;
- conn->ptr2 = line;
- conn->group = GetLayerGroupNumberByPointer(layer);
- conn->menu = NULL; /* agnostic view of where it belongs */
- conn = GetConnectionMemory(a);
- conn->X = line->Point2.X;
- conn->Y = line->Point2.Y;
- conn->type = PCB_TYPE_LINE;
- conn->ptr1 = layer;
- conn->ptr2 = line;
- conn->group = GetLayerGroupNumberByPointer(layer);
- conn->menu = NULL;
- }
- }
- ENDALL_LOOP;
- /* add polygons so the auto-router can see them as targets */
- ALLPOLYGON_LOOP(PCB->Data);
- {
- if (TEST_FLAG(PCB_FLAG_DRC, polygon)) {
- conn = GetConnectionMemory(a);
- /* make point on a vertex */
- conn->X = polygon->Clipped->contours->head.point[0];
- conn->Y = polygon->Clipped->contours->head.point[1];
- conn->type = PCB_TYPE_POLYGON;
- conn->ptr1 = layer;
- conn->ptr2 = polygon;
- conn->group = GetLayerGroupNumberByPointer(layer);
- conn->menu = NULL; /* agnostic view of where it belongs */
- }
- }
- ENDALL_LOOP;
- VIA_LOOP(PCB->Data);
- {
- if (TEST_FLAG(PCB_FLAG_DRC, via)) {
- conn = GetConnectionMemory(a);
- conn->X = via->X;
- conn->Y = via->Y;
- conn->type = PCB_TYPE_VIA;
- conn->ptr1 = via;
- conn->ptr2 = via;
- conn->group = SLayer;
- }
- }
- END_LOOP;
- if (!NoWarn)
- Warned |= CheckShorts(a->Connection[0].menu);
- }
- ResetConnections(pcb_false);
- return (Warned);
-}
-
-/* ---------------------------------------------------------------------------
- * Draw a rat net (tree) having the shortest lines
- * this also frees the subnet memory as they are consumed
- *
- * Note that the Netl we are passed is NOT the main netlist - it's the
- * connectivity for ONE net. It represents the CURRENT connectivity
- * state for the net, with each Netl->Net[N] representing one
- * copper-connected subset of the net.
- */
-
-static pcb_bool
-DrawShortestRats(NetListTypePtr Netl,
- void (*funcp) (register ConnectionTypePtr, register ConnectionTypePtr, register RouteStyleTypePtr))
-{
- RatTypePtr line;
- register float distance, temp;
- register ConnectionTypePtr conn1, conn2, firstpoint, secondpoint;
- PolygonTypePtr polygon;
- pcb_bool changed = pcb_false;
- pcb_bool havepoints;
- pcb_cardinal_t n, m, j;
- NetTypePtr next, subnet, theSubnet = NULL;
-
- /* This is just a sanity check, to make sure we're passed
- * *something*.
- */
- if (!Netl || Netl->NetN < 1)
- return pcb_false;
-
- /*
- * Everything inside the NetList Netl should be connected together.
- * Each Net in Netl is a group of Connections which are already
- * connected together somehow, either by real wires or by rats we've
- * already drawn. Each Connection is a vertex within that blob of
- * connected items. This loop finds the closest vertex pairs between
- * each blob and draws rats that merge the blobs until there's just
- * one big blob.
- *
- * Just to clarify, with some examples:
- *
- * Each Netl is one full net from a netlist, like from gnetlist.
- * Each Netl->Net[N] is a subset of that net that's already
- * physically connected on the pcb.
- *
- * So a new design with no traces yet, would have a huge list of Net[N],
- * each with one pin in it.
- *
- * A fully routed design would have one Net[N] with all the pins
- * (for that net) in it.
- */
-
- /*
- * We keep doing this do/while loop until everything's connected.
- * I.e. once per rat we add.
- */
- distance = 0.0;
- havepoints = pcb_true; /* so we run the loop at least once */
- while (Netl->NetN > 1 && havepoints) {
- /* This is the top of the "find one rat" logic. */
- havepoints = pcb_false;
- firstpoint = secondpoint = NULL;
-
- /* Test Net[0] vs Net[N] for N=1..max. Find the shortest
- distance between any two points in different blobs. */
- subnet = &Netl->Net[0];
- for (j = 1; j < Netl->NetN; j++) {
- /*
- * Scan between Net[0] blob (subnet) and Net[N] blob (next).
- * Note the shortest distance we find.
- */
- next = &Netl->Net[j];
- for (n = subnet->ConnectionN - 1; n != -1; n--) {
- conn1 = &subnet->Connection[n];
- for (m = next->ConnectionN - 1; m != -1; m--) {
- conn2 = &next->Connection[m];
- /*
- * At this point, conn1 and conn2 are two pins in
- * different blobs of the same net. See how far
- * apart they are, and if they're "closer" than what
- * we already have.
- */
-
- /*
- * Prefer to connect Connections over polygons to the
- * polygons (ie assume the user wants a via to a plane,
- * not a daisy chain). Further prefer to pick an existing
- * via in the Net to make that connection.
- */
- if (conn1->type == PCB_TYPE_POLYGON &&
- (polygon = (PolygonTypePtr) conn1->ptr2) &&
- !(distance == 0 &&
- firstpoint && firstpoint->type == PCB_TYPE_VIA) && IsPointInPolygonIgnoreHoles(conn2->X, conn2->Y, polygon)) {
- distance = 0;
- firstpoint = conn2;
- secondpoint = conn1;
- theSubnet = next;
- havepoints = pcb_true;
- }
- else if (conn2->type == PCB_TYPE_POLYGON &&
- (polygon = (PolygonTypePtr) conn2->ptr2) &&
- !(distance == 0 &&
- firstpoint && firstpoint->type == PCB_TYPE_VIA) && IsPointInPolygonIgnoreHoles(conn1->X, conn1->Y, polygon)) {
- distance = 0;
- firstpoint = conn1;
- secondpoint = conn2;
- theSubnet = next;
- havepoints = pcb_true;
- }
- else if ((temp = SQUARE(conn1->X - conn2->X) + SQUARE(conn1->Y - conn2->Y)) < distance || !firstpoint) {
- distance = temp;
- firstpoint = conn1;
- secondpoint = conn2;
- theSubnet = next;
- havepoints = pcb_true;
- }
- }
- }
- }
-
- /*
- * If HAVEPOINTS is pcb_true, we've found a pair of points in two
- * separate blobs of the net, and need to connect them together.
- */
- if (havepoints) {
- if (funcp) {
- (*funcp) (firstpoint, secondpoint, subnet->Style);
- }
- else {
- /* found the shortest distance subnet, draw the rat */
- if ((line = CreateNewRat(PCB->Data,
- firstpoint->X, firstpoint->Y,
- secondpoint->X, secondpoint->Y,
- firstpoint->group, secondpoint->group, conf_core.appearance.rat_thickness, NoFlags())) != NULL) {
- if (distance == 0)
- SET_FLAG(PCB_FLAG_VIA, line);
- AddObjectToCreateUndoList(PCB_TYPE_RATLINE, line, line, line);
- DrawRat(line);
- changed = pcb_true;
- }
- }
-
- /* copy theSubnet into the current subnet */
- TransferNet(Netl, theSubnet, subnet);
- }
- }
-
- /* presently nothing to do with the new subnet */
- /* so we throw it away and free the space */
- FreeNetMemory(&Netl->Net[--(Netl->NetN)]);
- /* Sadly adding a rat line messes up the sorted arrays in connection finder */
- /* hace: perhaps not necessarily now that they aren't stored in normal layers */
- if (changed) {
- FreeConnectionLookupMemory();
- InitConnectionLookup();
- }
- return (changed);
-}
-
-
-/* ---------------------------------------------------------------------------
- * AddAllRats puts the rats nest into the layout from the loaded netlist
- * if SelectedOnly is pcb_true, it will only draw rats to selected pins and pads
- */
-pcb_bool
-AddAllRats(pcb_bool SelectedOnly,
- void (*funcp) (register ConnectionTypePtr, register ConnectionTypePtr, register RouteStyleTypePtr))
-{
- NetListTypePtr Nets, Wantlist;
- NetTypePtr lonesome;
- ConnectionTypePtr onepin;
- pcb_bool changed, Warned = pcb_false;
-
- /* the netlist library has the text form
- * ProcNetlist fills in the Netlist
- * structure the way the final routing
- * is supposed to look
- */
- Wantlist = ProcNetlist(&(PCB->NetlistLib[NETLIST_EDITED]));
- if (!Wantlist) {
- Message(PCB_MSG_DEFAULT, _("Can't add rat lines because no netlist is loaded.\n"));
- return (pcb_false);
- }
- changed = pcb_false;
- /* initialize finding engine */
- InitConnectionLookup();
- SaveFindFlag(PCB_FLAG_DRC);
- Nets = (NetListTypePtr) calloc(1, sizeof(NetListType));
- /* now we build another netlist (Nets) for each
- * net in Wantlist that shows how it actually looks now,
- * then fill in any missing connections with rat lines.
- *
- * we first assume each connection is separate
- * (no routing), then gather them into groups
- * if the net is all routed, the new netlist (Nets)
- * will have only one net entry.
- * Note that DrawShortestRats consumes all nets
- * from Nets, so *Nets is empty after the
- * DrawShortestRats call
- */
- NET_LOOP(Wantlist);
- {
- CONNECTION_LOOP(net);
- {
- if (!SelectedOnly || TEST_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) connection->ptr2)) {
- lonesome = GetNetMemory(Nets);
- onepin = GetConnectionMemory(lonesome);
- *onepin = *connection;
- lonesome->Style = net->Style;
- }
- }
- END_LOOP;
- Warned |= GatherSubnets(Nets, SelectedOnly, pcb_true);
- if (Nets->NetN > 0)
- changed |= DrawShortestRats(Nets, funcp);
- }
- END_LOOP;
- FreeNetListMemory(Nets);
- free(Nets);
- FreeConnectionLookupMemory();
- RestoreFindFlag();
- if (funcp)
- return (pcb_true);
-
- if (Warned || changed) {
- stub_rat_proc_shorts();
- Draw();
- }
-
- if (Warned)
- conf_core.temp.rat_warn = pcb_true;
-
- if (changed) {
- IncrementUndoSerialNumber();
- if (ratlist_length(&PCB->Data->Rat) > 0) {
- Message(PCB_MSG_DEFAULT, "%d rat line%s remaining\n", ratlist_length(&PCB->Data->Rat), ratlist_length(&PCB->Data->Rat) > 1 ? "s" : "");
- }
- return (pcb_true);
- }
- if (!SelectedOnly && !Warned) {
- if (!ratlist_length(&PCB->Data->Rat) && !badnet)
- Message(PCB_MSG_DEFAULT, _("Congratulations!!\n" "The layout is complete and has no shorted nets.\n"));
- else
- Message(PCB_MSG_DEFAULT, _("Nothing more to add, but there are\n"
- "either rat-lines in the layout, disabled nets\n" "in the net-list, or missing components\n"));
- }
- return (pcb_false);
-}
-
-/* XXX: This is copied in large part from AddAllRats above; for
- * maintainability, AddAllRats probably wants to be tweaked to use this
- * version of the code so that we don't have duplication. */
-NetListListType CollectSubnets(pcb_bool SelectedOnly)
-{
- NetListListType result = { 0, 0, NULL };
- NetListTypePtr Nets, Wantlist;
- NetTypePtr lonesome;
- ConnectionTypePtr onepin;
-
- /* the netlist library has the text form
- * ProcNetlist fills in the Netlist
- * structure the way the final routing
- * is supposed to look
- */
- Wantlist = ProcNetlist(&(PCB->NetlistLib[NETLIST_EDITED]));
- if (!Wantlist) {
- Message(PCB_MSG_DEFAULT, _("Can't add rat lines because no netlist is loaded.\n"));
- return result;
- }
- /* initialize finding engine */
- InitConnectionLookup();
- SaveFindFlag(PCB_FLAG_DRC);
- /* now we build another netlist (Nets) for each
- * net in Wantlist that shows how it actually looks now,
- * then fill in any missing connections with rat lines.
- *
- * we first assume each connection is separate
- * (no routing), then gather them into groups
- * if the net is all routed, the new netlist (Nets)
- * will have only one net entry.
- * Note that DrawShortestRats consumes all nets
- * from Nets, so *Nets is empty after the
- * DrawShortestRats call
- */
- NET_LOOP(Wantlist);
- {
- Nets = GetNetListMemory(&result);
- CONNECTION_LOOP(net);
- {
- if (!SelectedOnly || TEST_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) connection->ptr2)) {
- lonesome = GetNetMemory(Nets);
- onepin = GetConnectionMemory(lonesome);
- *onepin = *connection;
- lonesome->Style = net->Style;
- }
- }
- END_LOOP;
- /* Note that AndRats is *FALSE* here! */
- GatherSubnets(Nets, SelectedOnly, pcb_false);
- }
- END_LOOP;
- FreeConnectionLookupMemory();
- RestoreFindFlag();
- return result;
-}
-
-/*
- * Check to see if a particular name is the name of an already existing rats
- * line
- */
-static int rat_used(char *name)
-{
- if (name == NULL)
- return -1;
-
- MENU_LOOP(&(PCB->NetlistLib[NETLIST_EDITED]));
- {
- if (menu->Name && (strcmp(menu->Name, name) == 0))
- return 1;
- }
- END_LOOP;
-
- return 0;
-}
-
- /* These next two functions moved from the original netlist.c as part of the
- | gui code separation for the Gtk port.
- */
-RatTypePtr AddNet(void)
-{
- static int ratDrawn = 0;
- char name1[256], *name2;
- pcb_cardinal_t group1, group2;
- char ratname[20];
- int found;
- void *ptr1, *ptr2, *ptr3;
- LibraryMenuTypePtr menu;
- LibraryEntryTypePtr entry;
-
- if (Crosshair.AttachedLine.Point1.X == Crosshair.AttachedLine.Point2.X
- && Crosshair.AttachedLine.Point1.Y == Crosshair.AttachedLine.Point2.Y)
- return (NULL);
-
- found = SearchObjectByLocation(PCB_TYPE_PAD | PCB_TYPE_PIN, &ptr1, &ptr2, &ptr3,
- Crosshair.AttachedLine.Point1.X, Crosshair.AttachedLine.Point1.Y, 5);
- if (found == PCB_TYPE_NONE) {
- Message(PCB_MSG_DEFAULT, _("No pad/pin under rat line\n"));
- return (NULL);
- }
- if (NAMEONPCB_NAME((ElementTypePtr) ptr1) == NULL || *NAMEONPCB_NAME((ElementTypePtr) ptr1) == 0) {
- Message(PCB_MSG_DEFAULT, _("You must name the starting element first\n"));
- return (NULL);
- }
-
- /* will work for pins to since the FLAG is common */
- group1 = (TEST_FLAG(PCB_FLAG_ONSOLDER, (PadTypePtr) ptr2) ?
- GetLayerGroupNumberByNumber(solder_silk_layer) : GetLayerGroupNumberByNumber(component_silk_layer));
- strcpy(name1, ConnectionName(found, ptr1, ptr2));
- found = SearchObjectByLocation(PCB_TYPE_PAD | PCB_TYPE_PIN, &ptr1, &ptr2, &ptr3,
- Crosshair.AttachedLine.Point2.X, Crosshair.AttachedLine.Point2.Y, 5);
- if (found == PCB_TYPE_NONE) {
- Message(PCB_MSG_DEFAULT, _("No pad/pin under rat line\n"));
- return (NULL);
- }
- if (NAMEONPCB_NAME((ElementTypePtr) ptr1) == NULL || *NAMEONPCB_NAME((ElementTypePtr) ptr1) == 0) {
- Message(PCB_MSG_DEFAULT, _("You must name the ending element first\n"));
- return (NULL);
- }
- group2 = (TEST_FLAG(PCB_FLAG_ONSOLDER, (PadTypePtr) ptr2) ?
- GetLayerGroupNumberByNumber(solder_silk_layer) : GetLayerGroupNumberByNumber(component_silk_layer));
- name2 = ConnectionName(found, ptr1, ptr2);
-
- menu = pcb_netnode_to_netname(name1);
- if (menu) {
- if (pcb_netnode_to_netname(name2)) {
- Message(PCB_MSG_DEFAULT, _("Both connections already in netlist - cannot merge nets\n"));
- return (NULL);
- }
- entry = GetLibraryEntryMemory(menu);
- entry->ListEntry = pcb_strdup(name2);
- entry->ListEntry_dontfree = 0;
- pcb_netnode_to_netname(name2);
- goto ratIt;
- }
- /* ok, the first name did not belong to a net */
- menu = pcb_netnode_to_netname(name2);
- if (menu) {
- entry = GetLibraryEntryMemory(menu);
- entry->ListEntry = pcb_strdup(name1);
- entry->ListEntry_dontfree = 0;
- pcb_netnode_to_netname(name1);
- goto ratIt;
- }
-
- /*
- * neither belong to a net, so create a new one.
- *
- * before creating a new rats here, we need to search
- * for a unique name.
- */
- sprintf(ratname, " ratDrawn%i", ++ratDrawn);
- while (rat_used(ratname)) {
- sprintf(ratname, " ratDrawn%i", ++ratDrawn);
- }
-
- menu = GetLibraryMenuMemory(&(PCB->NetlistLib[NETLIST_EDITED]), NULL);
- menu->Name = pcb_strdup(ratname);
- entry = GetLibraryEntryMemory(menu);
- entry->ListEntry = pcb_strdup(name1);
- entry->ListEntry_dontfree = 0;
-
- entry = GetLibraryEntryMemory(menu);
- entry->ListEntry = pcb_strdup(name2);
- entry->ListEntry_dontfree = 0;
- menu->flag = 1;
-
-ratIt:
- pcb_netlist_changed(0);
- return (CreateNewRat(PCB->Data, Crosshair.AttachedLine.Point1.X,
- Crosshair.AttachedLine.Point1.Y,
- Crosshair.AttachedLine.Point2.X,
- Crosshair.AttachedLine.Point2.Y, group1, group2, conf_core.appearance.rat_thickness, NoFlags()));
-}
-
-
-char *ConnectionName(int type, void *ptr1, void *ptr2)
-{
- static char name[256];
- char *num;
-
- switch (type) {
- case PCB_TYPE_PIN:
- num = ((PinTypePtr) ptr2)->Number;
- break;
- case PCB_TYPE_PAD:
- num = ((PadTypePtr) ptr2)->Number;
- break;
- default:
- return (NULL);
- }
- strcpy(name, UNKNOWN(NAMEONPCB_NAME((ElementTypePtr) ptr1)));
- strcat(name, "-");
- strcat(name, UNKNOWN(num));
- return (name);
-}
Index: 1.1.4/src/find_geo.c
===================================================================
--- 1.1.4/src/find_geo.c (revision 10776)
+++ 1.1.4/src/find_geo.c (nonexistent)
@@ -1,696 +0,0 @@
-/*
- *
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996, 2005 Thomas Nau
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau@rz.uni-ulm.de
- *
- */
-
-/* Generic geometric functions used by find.c lookup */
-
-/*
- * Intersection of line <--> circle:
- * - calculate the signed distance from the line to the center,
- * return false if abs(distance) > R
- * - get the distance from the line <--> distancevector intersection to
- * (X1,Y1) in range [0,1], return pcb_true if 0 <= distance <= 1
- * - depending on (r > 1.0 or r < 0.0) check the distance of X2,Y2 or X1,Y1
- * to X,Y
- *
- * Intersection of line <--> line:
- * - see the description of 'LineLineIntersect()'
- */
-
-#define EXPAND_BOUNDS(p) if (Bloat > 0) {\
- (p)->BoundingBox.X1 -= Bloat; \
- (p)->BoundingBox.X2 += Bloat; \
- (p)->BoundingBox.Y1 -= Bloat; \
- (p)->BoundingBox.Y2 += Bloat;}
-
-#define IS_PV_ON_RAT(PV, Rat) \
- (IsPointOnLineEnd((PV)->X,(PV)->Y, (Rat)))
-
-#define IS_PV_ON_ARC(PV, Arc) \
- (TEST_FLAG(PCB_FLAG_SQUARE, (PV)) ? \
- IsArcInRectangle( \
- (PV)->X -MAX(((PV)->Thickness+1)/2 +Bloat,0), (PV)->Y -MAX(((PV)->Thickness+1)/2 +Bloat,0), \
- (PV)->X +MAX(((PV)->Thickness+1)/2 +Bloat,0), (PV)->Y +MAX(((PV)->Thickness+1)/2 +Bloat,0), \
- (Arc)) : \
- IsPointOnArc((PV)->X,(PV)->Y,MAX((PV)->Thickness/2.0 + Bloat,0.0), (Arc)))
-
-#define IS_PV_ON_PAD(PV,Pad) \
- ( IsPointInPad((PV)->X, (PV)->Y, MAX((PV)->Thickness/2 +Bloat,0), (Pad)))
-
-/* reduce arc start angle and delta to 0..360 */
-static void normalize_angles(Angle * sa, Angle * d)
-{
- if (*d < 0) {
- *sa += *d;
- *d = -*d;
- }
- if (*d > 360) /* full circle */
- *d = 360;
- *sa = NormalizeAngle(*sa);
-}
-
-static int radius_crosses_arc(double x, double y, ArcTypePtr arc)
-{
- double alpha = atan2(y - arc->Y, -x + arc->X) * PCB_RAD_TO_DEG;
- Angle sa = arc->StartAngle, d = arc->Delta;
-
- normalize_angles(&sa, &d);
- if (alpha < 0)
- alpha += 360;
- if (sa <= alpha)
- return (sa + d) >= alpha;
- return (sa + d - 360) >= alpha;
-}
-
-static void get_arc_ends(Coord * box, ArcTypePtr arc)
-{
- box[0] = arc->X - arc->Width * cos(PCB_M180 * arc->StartAngle);
- box[1] = arc->Y + arc->Height * sin(PCB_M180 * arc->StartAngle);
- box[2] = arc->X - arc->Width * cos(PCB_M180 * (arc->StartAngle + arc->Delta));
- box[3] = arc->Y + arc->Height * sin(PCB_M180 * (arc->StartAngle + arc->Delta));
-}
-
-/* ---------------------------------------------------------------------------
- * check if two arcs intersect
- * first we check for circle intersections,
- * then find the actual points of intersection
- * and test them to see if they are on arcs
- *
- * consider a, the distance from the center of arc 1
- * to the point perpendicular to the intersecting points.
- *
- * a = (r1^2 - r2^2 + l^2)/(2l)
- *
- * the perpendicular distance to the point of intersection
- * is then
- *
- * d = sqrt(r1^2 - a^2)
- *
- * the points of intersection would then be
- *
- * x = X1 + a/l dx +- d/l dy
- * y = Y1 + a/l dy -+ d/l dx
- *
- * where dx = X2 - X1 and dy = Y2 - Y1
- *
- *
- */
-static pcb_bool ArcArcIntersect(ArcTypePtr Arc1, ArcTypePtr Arc2)
-{
- double x, y, dx, dy, r1, r2, a, d, l, t, t1, t2, dl;
- Coord pdx, pdy;
- Coord box[8];
-
- t = 0.5 * Arc1->Thickness + Bloat;
- t2 = 0.5 * Arc2->Thickness;
- t1 = t2 + Bloat;
-
- /* too thin arc */
- if (t < 0 || t1 < 0)
- return pcb_false;
-
- /* try the end points first */
- get_arc_ends(&box[0], Arc1);
- get_arc_ends(&box[4], Arc2);
- if (IsPointOnArc(box[0], box[1], t, Arc2)
- || IsPointOnArc(box[2], box[3], t, Arc2)
- || IsPointOnArc(box[4], box[5], t, Arc1)
- || IsPointOnArc(box[6], box[7], t, Arc1))
- return pcb_true;
-
- pdx = Arc2->X - Arc1->X;
- pdy = Arc2->Y - Arc1->Y;
- dl = Distance(Arc1->X, Arc1->Y, Arc2->X, Arc2->Y);
- /* concentric arcs, simpler intersection conditions */
- if (dl < 0.5) {
- if ((Arc1->Width - t >= Arc2->Width - t2 && Arc1->Width - t <= Arc2->Width + t2)
- || (Arc1->Width + t >= Arc2->Width - t2 && Arc1->Width + t <= Arc2->Width + t2)) {
- Angle sa1 = Arc1->StartAngle, d1 = Arc1->Delta;
- Angle sa2 = Arc2->StartAngle, d2 = Arc2->Delta;
- /* NB the endpoints have already been checked,
- so we just compare the angles */
-
- normalize_angles(&sa1, &d1);
- normalize_angles(&sa2, &d2);
- /* sa1 == sa2 was caught when checking endpoints */
- if (sa1 > sa2)
- if (sa1 < sa2 + d2 || sa1 + d1 - 360 > sa2)
- return pcb_true;
- if (sa2 > sa1)
- if (sa2 < sa1 + d1 || sa2 + d2 - 360 > sa1)
- return pcb_true;
- }
- return pcb_false;
- }
- r1 = Arc1->Width;
- r2 = Arc2->Width;
- /* arcs centerlines are too far or too near */
- if (dl > r1 + r2 || dl + r1 < r2 || dl + r2 < r1) {
- /* check the nearest to the other arc's center point */
- dx = pdx * r1 / dl;
- dy = pdy * r1 / dl;
- if (dl + r1 < r2) { /* Arc1 inside Arc2 */
- dx = -dx;
- dy = -dy;
- }
-
- if (radius_crosses_arc(Arc1->X + dx, Arc1->Y + dy, Arc1)
- && IsPointOnArc(Arc1->X + dx, Arc1->Y + dy, t, Arc2))
- return pcb_true;
-
- dx = -pdx * r2 / dl;
- dy = -pdy * r2 / dl;
- if (dl + r2 < r1) { /* Arc2 inside Arc1 */
- dx = -dx;
- dy = -dy;
- }
-
- if (radius_crosses_arc(Arc2->X + dx, Arc2->Y + dy, Arc2)
- && IsPointOnArc(Arc2->X + dx, Arc2->Y + dy, t1, Arc1))
- return pcb_true;
- return pcb_false;
- }
-
- l = dl * dl;
- r1 *= r1;
- r2 *= r2;
- a = 0.5 * (r1 - r2 + l) / l;
- r1 = r1 / l;
- d = r1 - a * a;
- /* the circles are too far apart to touch or probably just touch:
- check the nearest point */
- if (d < 0)
- d = 0;
- else
- d = sqrt(d);
- x = Arc1->X + a * pdx;
- y = Arc1->Y + a * pdy;
- dx = d * pdx;
- dy = d * pdy;
- if (radius_crosses_arc(x + dy, y - dx, Arc1)
- && IsPointOnArc(x + dy, y - dx, t, Arc2))
- return pcb_true;
- if (radius_crosses_arc(x + dy, y - dx, Arc2)
- && IsPointOnArc(x + dy, y - dx, t1, Arc1))
- return pcb_true;
-
- if (radius_crosses_arc(x - dy, y + dx, Arc1)
- && IsPointOnArc(x - dy, y + dx, t, Arc2))
- return pcb_true;
- if (radius_crosses_arc(x - dy, y + dx, Arc2)
- && IsPointOnArc(x - dy, y + dx, t1, Arc1))
- return pcb_true;
- return pcb_false;
-}
-
-/* ---------------------------------------------------------------------------
- * Tests if point is same as line end point
- */
-static pcb_bool IsRatPointOnLineEnd(PointTypePtr Point, LineTypePtr Line)
-{
- if ((Point->X == Line->Point1.X && Point->Y == Line->Point1.Y)
- || (Point->X == Line->Point2.X && Point->Y == Line->Point2.Y))
- return (pcb_true);
- return (pcb_false);
-}
-
-static void form_slanted_rectangle(PointType p[4], LineTypePtr l)
-/* writes vertices of a squared line */
-{
- double dwx = 0, dwy = 0;
- if (l->Point1.Y == l->Point2.Y)
- dwx = l->Thickness / 2.0;
- else if (l->Point1.X == l->Point2.X)
- dwy = l->Thickness / 2.0;
- else {
- Coord dX = l->Point2.X - l->Point1.X;
- Coord dY = l->Point2.Y - l->Point1.Y;
- double r = Distance(l->Point1.X, l->Point1.Y, l->Point2.X, l->Point2.Y);
- dwx = l->Thickness / 2.0 / r * dX;
- dwy = l->Thickness / 2.0 / r * dY;
- }
- p[0].X = l->Point1.X - dwx + dwy;
- p[0].Y = l->Point1.Y - dwy - dwx;
- p[1].X = l->Point1.X - dwx - dwy;
- p[1].Y = l->Point1.Y - dwy + dwx;
- p[2].X = l->Point2.X + dwx - dwy;
- p[2].Y = l->Point2.Y + dwy + dwx;
- p[3].X = l->Point2.X + dwx + dwy;
- p[3].Y = l->Point2.Y + dwy - dwx;
-}
-
-/* ---------------------------------------------------------------------------
- * checks if two lines intersect
- * from news FAQ:
- *
- * Let A,B,C,D be 2-space position vectors. Then the directed line
- * segments AB & CD are given by:
- *
- * AB=A+r(B-A), r in [0,1]
- * CD=C+s(D-C), s in [0,1]
- *
- * If AB & CD intersect, then
- *
- * A+r(B-A)=C+s(D-C), or
- *
- * XA+r(XB-XA)=XC+s(XD-XC)
- * YA+r(YB-YA)=YC+s(YD-YC) for some r,s in [0,1]
- *
- * Solving the above for r and s yields
- *
- * (YA-YC)(XD-XC)-(XA-XC)(YD-YC)
- * r = ----------------------------- (eqn 1)
- * (XB-XA)(YD-YC)-(YB-YA)(XD-XC)
- *
- * (YA-YC)(XB-XA)-(XA-XC)(YB-YA)
- * s = ----------------------------- (eqn 2)
- * (XB-XA)(YD-YC)-(YB-YA)(XD-XC)
- *
- * Let I be the position vector of the intersection point, then
- *
- * I=A+r(B-A) or
- *
- * XI=XA+r(XB-XA)
- * YI=YA+r(YB-YA)
- *
- * By examining the values of r & s, you can also determine some
- * other limiting conditions:
- *
- * If 0<=r<=1 & 0<=s<=1, intersection exists
- * r<0 or r>1 or s<0 or s>1 line segments do not intersect
- *
- * If the denominator in eqn 1 is zero, AB & CD are parallel
- * If the numerator in eqn 1 is also zero, AB & CD are coincident
- *
- * If the intersection point of the 2 lines are needed (lines in this
- * context mean infinite lines) regardless whether the two line
- * segments intersect, then
- *
- * If r>1, I is located on extension of AB
- * If r<0, I is located on extension of BA
- * If s>1, I is located on extension of CD
- * If s<0, I is located on extension of DC
- *
- * Also note that the denominators of eqn 1 & 2 are identical.
- *
- */
-pcb_bool LineLineIntersect(LineTypePtr Line1, LineTypePtr Line2)
-{
- double s, r;
- double line1_dx, line1_dy, line2_dx, line2_dy, point1_dx, point1_dy;
- if (TEST_FLAG(PCB_FLAG_SQUARE, Line1)) { /* pretty reckless recursion */
- PointType p[4];
- form_slanted_rectangle(p, Line1);
- return IsLineInQuadrangle(p, Line2);
- }
- /* here come only round Line1 because IsLineInQuadrangle()
- calls LineLineIntersect() with first argument rounded */
- if (TEST_FLAG(PCB_FLAG_SQUARE, Line2)) {
- PointType p[4];
- form_slanted_rectangle(p, Line2);
- return IsLineInQuadrangle(p, Line1);
- }
- /* now all lines are round */
-
- /* Check endpoints: this provides a quick exit, catches
- * cases where the "real" lines don't intersect but the
- * thick lines touch, and ensures that the dx/dy business
- * below does not cause a divide-by-zero. */
- if (IsPointInPad(Line2->Point1.X, Line2->Point1.Y, MAX(Line2->Thickness / 2 + Bloat, 0), (PadTypePtr) Line1)
- || IsPointInPad(Line2->Point2.X, Line2->Point2.Y, MAX(Line2->Thickness / 2 + Bloat, 0), (PadTypePtr) Line1)
- || IsPointInPad(Line1->Point1.X, Line1->Point1.Y, MAX(Line1->Thickness / 2 + Bloat, 0), (PadTypePtr) Line2)
- || IsPointInPad(Line1->Point2.X, Line1->Point2.Y, MAX(Line1->Thickness / 2 + Bloat, 0), (PadTypePtr) Line2))
- return pcb_true;
-
- /* setup some constants */
- line1_dx = Line1->Point2.X - Line1->Point1.X;
- line1_dy = Line1->Point2.Y - Line1->Point1.Y;
- line2_dx = Line2->Point2.X - Line2->Point1.X;
- line2_dy = Line2->Point2.Y - Line2->Point1.Y;
- point1_dx = Line1->Point1.X - Line2->Point1.X;
- point1_dy = Line1->Point1.Y - Line2->Point1.Y;
-
- /* If either line is a point, we have failed already, since the
- * endpoint check above will have caught an "intersection". */
- if ((line1_dx == 0 && line1_dy == 0)
- || (line2_dx == 0 && line2_dy == 0))
- return pcb_false;
-
- /* set s to cross product of Line1 and the line
- * Line1.Point1--Line2.Point1 (as vectors) */
- s = point1_dy * line1_dx - point1_dx * line1_dy;
-
- /* set r to cross product of both lines (as vectors) */
- r = line1_dx * line2_dy - line1_dy * line2_dx;
-
- /* No cross product means parallel lines, or maybe Line2 is
- * zero-length. In either case, since we did a bounding-box
- * check before getting here, the above IsPointInPad() checks
- * will have caught any intersections. */
- if (r == 0.0)
- return pcb_false;
-
- s /= r;
- r = (point1_dy * line2_dx - point1_dx * line2_dy) / r;
-
- /* intersection is at least on AB */
- if (r >= 0.0 && r <= 1.0)
- return (s >= 0.0 && s <= 1.0);
-
- /* intersection is at least on CD */
- /* [removed this case since it always returns pcb_false --asp] */
- return pcb_false;
-}
-
-/*---------------------------------------------------
- *
- * Check for line intersection with an arc
- *
- * Mostly this is like the circle/line intersection
- * found in IsPointOnLine (search.c) see the detailed
- * discussion for the basics there.
- *
- * Since this is only an arc, not a full circle we need
- * to find the actual points of intersection with the
- * circle, and see if they are on the arc.
- *
- * To do this, we translate along the line from the point Q
- * plus or minus a distance delta = sqrt(Radius^2 - d^2)
- * but it's handy to normalize with respect to l, the line
- * length so a single projection is done (e.g. we don't first
- * find the point Q
- *
- * The projection is now of the form
- *
- * Px = X1 + (r +- r2)(X2 - X1)
- * Py = Y1 + (r +- r2)(Y2 - Y1)
- *
- * Where r2 sqrt(Radius^2 l^2 - d^2)/l^2
- * note that this is the variable d, not the symbol d described in IsPointOnLine
- * (variable d = symbol d * l)
- *
- * The end points are hell so they are checked individually
- */
-pcb_bool LineArcIntersect(LineTypePtr Line, ArcTypePtr Arc)
-{
- double dx, dy, dx1, dy1, l, d, r, r2, Radius;
- BoxTypePtr box;
-
- dx = Line->Point2.X - Line->Point1.X;
- dy = Line->Point2.Y - Line->Point1.Y;
- dx1 = Line->Point1.X - Arc->X;
- dy1 = Line->Point1.Y - Arc->Y;
- l = dx * dx + dy * dy;
- d = dx * dy1 - dy * dx1;
- d *= d;
-
- /* use the larger diameter circle first */
- Radius = Arc->Width + MAX(0.5 * (Arc->Thickness + Line->Thickness) + Bloat, 0.0);
- Radius *= Radius;
- r2 = Radius * l - d;
- /* projection doesn't even intersect circle when r2 < 0 */
- if (r2 < 0)
- return (pcb_false);
- /* check the ends of the line in case the projected point */
- /* of intersection is beyond the line end */
- if (IsPointOnArc(Line->Point1.X, Line->Point1.Y, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
- return (pcb_true);
- if (IsPointOnArc(Line->Point2.X, Line->Point2.Y, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
- return (pcb_true);
- if (l == 0.0)
- return (pcb_false);
- r2 = sqrt(r2);
- Radius = -(dx * dx1 + dy * dy1);
- r = (Radius + r2) / l;
- if (r >= 0 && r <= 1
- && IsPointOnArc(Line->Point1.X + r * dx, Line->Point1.Y + r * dy, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
- return (pcb_true);
- r = (Radius - r2) / l;
- if (r >= 0 && r <= 1
- && IsPointOnArc(Line->Point1.X + r * dx, Line->Point1.Y + r * dy, MAX(0.5 * Line->Thickness + Bloat, 0.0), Arc))
- return (pcb_true);
- /* check arc end points */
- box = GetArcEnds(Arc);
- if (IsPointInPad(box->X1, box->Y1, Arc->Thickness * 0.5 + Bloat, (PadTypePtr) Line))
- return pcb_true;
- if (IsPointInPad(box->X2, box->Y2, Arc->Thickness * 0.5 + Bloat, (PadTypePtr) Line))
- return pcb_true;
- return pcb_false;
-}
-
-/* ---------------------------------------------------------------------------
- * checks if an arc has a connection to a polygon
- *
- * - first check if the arc can intersect with the polygon by
- * evaluating the bounding boxes
- * - check the two end points of the arc. If none of them matches
- * - check all segments of the polygon against the arc.
- */
-pcb_bool IsArcInPolygon(ArcTypePtr Arc, PolygonTypePtr Polygon)
-{
- BoxTypePtr Box = (BoxType *) Arc;
-
- /* arcs with clearance never touch polys */
- if (TEST_FLAG(PCB_FLAG_CLEARPOLY, Polygon) && TEST_FLAG(PCB_FLAG_CLEARLINE, Arc))
- return pcb_false;
- if (!Polygon->Clipped)
- return pcb_false;
- if (Box->X1 <= Polygon->Clipped->contours->xmax + Bloat
- && Box->X2 >= Polygon->Clipped->contours->xmin - Bloat
- && Box->Y1 <= Polygon->Clipped->contours->ymax + Bloat && Box->Y2 >= Polygon->Clipped->contours->ymin - Bloat) {
- POLYAREA *ap;
-
- if (!(ap = ArcPoly(Arc, Arc->Thickness + Bloat)))
- return pcb_false; /* error */
- return isects(ap, Polygon, pcb_true);
- }
- return pcb_false;
-}
-
-/* ---------------------------------------------------------------------------
- * checks if a line has a connection to a polygon
- *
- * - first check if the line can intersect with the polygon by
- * evaluating the bounding boxes
- * - check the two end points of the line. If none of them matches
- * - check all segments of the polygon against the line.
- */
-pcb_bool IsLineInPolygon(LineTypePtr Line, PolygonTypePtr Polygon)
-{
- BoxTypePtr Box = (BoxType *) Line;
- POLYAREA *lp;
-
- /* lines with clearance never touch polygons */
- if (TEST_FLAG(PCB_FLAG_CLEARPOLY, Polygon) && TEST_FLAG(PCB_FLAG_CLEARLINE, Line))
- return pcb_false;
- if (!Polygon->Clipped)
- return pcb_false;
- if (TEST_FLAG(PCB_FLAG_SQUARE, Line) && (Line->Point1.X == Line->Point2.X || Line->Point1.Y == Line->Point2.Y)) {
- Coord wid = (Line->Thickness + Bloat + 1) / 2;
- Coord x1, x2, y1, y2;
-
- x1 = MIN(Line->Point1.X, Line->Point2.X) - wid;
- y1 = MIN(Line->Point1.Y, Line->Point2.Y) - wid;
- x2 = MAX(Line->Point1.X, Line->Point2.X) + wid;
- y2 = MAX(Line->Point1.Y, Line->Point2.Y) + wid;
- return IsRectangleInPolygon(x1, y1, x2, y2, Polygon);
- }
- if (Box->X1 <= Polygon->Clipped->contours->xmax + Bloat
- && Box->X2 >= Polygon->Clipped->contours->xmin - Bloat
- && Box->Y1 <= Polygon->Clipped->contours->ymax + Bloat && Box->Y2 >= Polygon->Clipped->contours->ymin - Bloat) {
- if (!(lp = LinePoly(Line, Line->Thickness + Bloat)))
- return FALSE; /* error */
- return isects(lp, Polygon, pcb_true);
- }
- return pcb_false;
-}
-
-/* ---------------------------------------------------------------------------
- * checks if a pad connects to a non-clearing polygon
- *
- * The polygon is assumed to already have been proven non-clearing
- */
-pcb_bool IsPadInPolygon(PadTypePtr pad, PolygonTypePtr polygon)
-{
- return IsLineInPolygon((LineTypePtr) pad, polygon);
-}
-
-/* ---------------------------------------------------------------------------
- * checks if a polygon has a connection to a second one
- *
- * First check all points out of P1 against P2 and vice versa.
- * If both fail check all lines of P1 against the ones of P2
- */
-pcb_bool IsPolygonInPolygon(PolygonTypePtr P1, PolygonTypePtr P2)
-{
- if (!P1->Clipped || !P2->Clipped)
- return pcb_false;
- assert(P1->Clipped->contours);
- assert(P2->Clipped->contours);
-
- /* first check if both bounding boxes intersect. If not, return quickly */
- if (P1->Clipped->contours->xmin - Bloat > P2->Clipped->contours->xmax ||
- P1->Clipped->contours->xmax + Bloat < P2->Clipped->contours->xmin ||
- P1->Clipped->contours->ymin - Bloat > P2->Clipped->contours->ymax ||
- P1->Clipped->contours->ymax + Bloat < P2->Clipped->contours->ymin)
- return pcb_false;
-
- /* first check un-bloated case */
- if (isects(P1->Clipped, P2, pcb_false))
- return TRUE;
-
- /* now the difficult case of bloated */
- if (Bloat > 0) {
- PLINE *c;
- for (c = P1->Clipped->contours; c; c = c->next) {
- LineType line;
- VNODE *v = &c->head;
- if (c->xmin - Bloat <= P2->Clipped->contours->xmax &&
- c->xmax + Bloat >= P2->Clipped->contours->xmin &&
- c->ymin - Bloat <= P2->Clipped->contours->ymax && c->ymax + Bloat >= P2->Clipped->contours->ymin) {
-
- line.Point1.X = v->point[0];
- line.Point1.Y = v->point[1];
- line.Thickness = 2 * Bloat;
- line.Clearance = 0;
- line.Flags = NoFlags();
- for (v = v->next; v != &c->head; v = v->next) {
- line.Point2.X = v->point[0];
- line.Point2.Y = v->point[1];
- SetLineBoundingBox(&line);
- if (IsLineInPolygon(&line, P2))
- return (pcb_true);
- line.Point1.X = line.Point2.X;
- line.Point1.Y = line.Point2.Y;
- }
- }
- }
- }
-
- return (pcb_false);
-}
-
-/* ---------------------------------------------------------------------------
- * some of the 'pad' routines are the same as for lines because the 'pad'
- * struct starts with a line struct. See global.h for details
- */
-pcb_bool LinePadIntersect(LineTypePtr Line, PadTypePtr Pad)
-{
- return LineLineIntersect((Line), (LineTypePtr) Pad);
-}
-
-pcb_bool ArcPadIntersect(ArcTypePtr Arc, PadTypePtr Pad)
-{
- return LineArcIntersect((LineTypePtr) (Pad), (Arc));
-}
-
-pcb_bool BoxBoxIntersection(BoxTypePtr b1, BoxTypePtr b2)
-{
- if (b2->X2 < b1->X1 || b2->X1 > b1->X2)
- return pcb_false;
- if (b2->Y2 < b1->Y1 || b2->Y1 > b1->Y2)
- return pcb_false;
- return pcb_true;
-}
-
-static pcb_bool PadPadIntersect(PadTypePtr p1, PadTypePtr p2)
-{
- return LinePadIntersect((LineTypePtr) p1, p2);
-}
-
-static inline pcb_bool PV_TOUCH_PV(PinTypePtr PV1, PinTypePtr PV2)
-{
- double t1, t2;
- BoxType b1, b2;
- int shape1, shape2;
-
- shape1 = GET_SQUARE(PV1);
- shape2 = GET_SQUARE(PV2);
-
- if ((shape1 > 1) || (shape2 > 1)) {
- POLYAREA *pl1, *pl2;
- int ret;
-
- pl1 = PinPoly(PV1, PIN_SIZE(PV1) + Bloat, 0);
- pl2 = PinPoly(PV2, PIN_SIZE(PV2) + Bloat, 0);
- ret = Touching(pl1, pl2);
- poly_Free(&pl1);
- poly_Free(&pl2);
- return ret;
- }
-
-
- t1 = MAX(PV1->Thickness / 2.0 + Bloat, 0);
- t2 = MAX(PV2->Thickness / 2.0 + Bloat, 0);
- if (IsPointOnPin(PV1->X, PV1->Y, t1, PV2)
- || IsPointOnPin(PV2->X, PV2->Y, t2, PV1))
- return pcb_true;
- if (!TEST_FLAG(PCB_FLAG_SQUARE, PV1) || !TEST_FLAG(PCB_FLAG_SQUARE, PV2))
- return pcb_false;
- /* check for square/square overlap */
- b1.X1 = PV1->X - t1;
- b1.X2 = PV1->X + t1;
- b1.Y1 = PV1->Y - t1;
- b1.Y2 = PV1->Y + t1;
- t2 = PV2->Thickness / 2.0;
- b2.X1 = PV2->X - t2;
- b2.X2 = PV2->X + t2;
- b2.Y1 = PV2->Y - t2;
- b2.Y2 = PV2->Y + t2;
- return BoxBoxIntersection(&b1, &b2);
-}
-
-pcb_bool PinLineIntersect(PinTypePtr PV, LineTypePtr Line)
-{
- if (TEST_FLAG(PCB_FLAG_SQUARE, PV)) {
- int shape = GET_SQUARE(PV);
- if (shape <= 1) {
- /* the original square case */
- /* IsLineInRectangle already has Bloat factor */
- return IsLineInRectangle(PV->X - (PIN_SIZE(PV) + 1) / 2,
- PV->Y - (PIN_SIZE(PV) + 1) / 2,
- PV->X + (PIN_SIZE(PV) + 1) / 2, PV->Y + (PIN_SIZE(PV) + 1) / 2, Line);
- }
-
- {
- /* shaped pin case */
- POLYAREA *pl, *lp;
- int ret;
-
- pl = PinPoly(PV, PIN_SIZE(PV), 0);
- lp = LinePoly(Line, Line->Thickness + Bloat);
- ret = Touching(lp, pl);
- poly_Free(&pl);
- poly_Free(&lp);
- return ret;
- }
-
- }
-
-
- /* the original round pin version */
- return IsPointInPad(PV->X, PV->Y, MAX(PIN_SIZE(PV) / 2.0 + Bloat, 0.0), (PadTypePtr) Line);
-}
Index: 1.1.4/src/rats.h
===================================================================
--- 1.1.4/src/rats.h (revision 10776)
+++ 1.1.4/src/rats.h (nonexistent)
@@ -1,45 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996 Thomas Nau
- *
- * rats.c, rats.h Copyright (C) 1997, harry eaton
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau@rz.uni-ulm.de
- *
- */
-
-/* prototypes for rats routines */
-
-#ifndef PCB_RATS_H
-#define PCB_RATS_H
-
-#include "global.h"
-
-RatTypePtr AddNet(void);
-char *ConnectionName(int, void *, void *);
-
-pcb_bool AddAllRats(pcb_bool, void (*)(register ConnectionTypePtr, register ConnectionTypePtr, register RouteStyleTypePtr));
-pcb_bool SeekPad(LibraryEntryTypePtr, ConnectionTypePtr, pcb_bool);
-
-NetListTypePtr ProcNetlist(LibraryTypePtr);
-NetListListType CollectSubnets(pcb_bool);
-
-#endif
Index: 1.1.4/src/compat_lrealpath.c
===================================================================
--- 1.1.4/src/compat_lrealpath.c (revision 10776)
+++ 1.1.4/src/compat_lrealpath.c (nonexistent)
@@ -1,156 +0,0 @@
-/* Libiberty realpath. Like realpath, but more consistent behavior.
- Based on gdb_realpath from GDB.
-
- Copyright 2003 Free Software Foundation, Inc.
-
- This file is part of the libiberty library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street - Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-/*
-
-@deftypefn Replacement {const char*} lrealpath (const char *@var{name})
-
-Given a pointer to a string containing a pathname, returns a canonical
-version of the filename. Symlinks will be resolved, and ``.'' and ``..''
-components will be simplified. The returned value will be allocated using
-@code{malloc}, or @code{NULL} will be returned on a memory allocation error.
-
-@end deftypefn
-
-*/
-
-#include "config.h"
-#include "compat_lrealpath.h"
-#include
-#include
-#ifdef HAVE_UNISTD_H
-#include
-#endif
-#include
-#include "compat_misc.h"
-
-/* On GNU libc systems the declaration is only visible with _GNU_SOURCE. */
-#if defined(HAVE_CANONICALIZE_FILE_NAME) \
- && defined(NEED_DECLARATION_CANONICALIZE_FILE_NAME)
-extern char *canonicalize_file_name(const char *);
-#endif
-
-#if defined(HAVE_REALPATH)
-#if defined (PATH_MAX)
-#define REALPATH_LIMIT PATH_MAX
-#else
-#if defined (MAXPATHLEN)
-#define REALPATH_LIMIT MAXPATHLEN
-#endif
-#endif
-#else
- /* cygwin has realpath, so it won't get here. */
-#if defined (_WIN32)
-#define WIN32_LEAN_AND_MEAN
-#include /* for GetFullPathName */
-#endif
-#endif
-
-char *lrealpath(const char *filename)
-{
- /* Method 1: The system has a compile time upper bound on a filename
- path. Use that and realpath() to canonicalize the name. This is
- the most common case. Note that, if there isn't a compile time
- upper bound, you want to avoid realpath() at all costs. */
-#if defined(REALPATH_LIMIT)
- {
- char buf[REALPATH_LIMIT];
- const char *rp = realpath(filename, buf);
- if (rp == NULL)
- rp = filename;
- return pcb_strdup(rp);
- }
- /* REALPATH_LIMIT */
-
- /* Method 2: The host system (i.e., GNU) has the function
- canonicalize_file_name() which malloc's a chunk of memory and
- returns that, use that. */
-#elif defined(HAVE_CANONICALIZE_FILE_NAME)
- {
- char *rp = canonicalize_file_name(filename);
- if (rp == NULL)
- return pcb_strdup(filename);
- else
- return rp;
- }
- /* HAVE_CANONICALIZE_FILE_NAME */
-
- /* Method 3: Now we're getting desperate! The system doesn't have a
- compile time buffer size and no alternative function. Query the
- OS, using pathconf(), for the buffer limit. Care is needed
- though, some systems do not limit PATH_MAX (return -1 for
- pathconf()) making it impossible to pass a correctly sized buffer
- to realpath() (it could always overflow). On those systems, we
- skip this. */
-#elif defined (HAVE_REALPATH) && defined (HAVE_UNISTD_H)
- {
-#ifdef inline
- /* Suppress compiler warnings; -Dinline means we are compiling in
- --debug with -ansi -pedantic; we do know that realpath exists on the system,
- because of the the ifdefs. */
- char *realpath(const char *path, char *resolved_path);
-#endif
-
- /* Find out the max path size. */
- long path_max = pathconf("/", _PC_PATH_MAX);
- if (path_max > 0) {
- /* PATH_MAX is bounded. */
- char *buf, *rp, *ret;
- buf = (char *) malloc(path_max);
- if (buf == NULL)
- return NULL;
- rp = realpath(filename, buf);
- ret = pcb_strdup(rp ? rp : filename);
- free(buf);
- return ret;
- }
- return NULL;
- }
- /* HAVE_REALPATH && HAVE_UNISTD_H */
-
- /* The MS Windows method. If we don't have realpath, we assume we
- don't have symlinks and just canonicalize to a Windows absolute
- path. GetFullPath converts ../ and ./ in relative paths to
- absolute paths, filling in current drive if one is not given
- or using the current directory of a specified drive (eg, "E:foo").
- It also converts all forward slashes to back slashes. */
-#elif defined (_WIN32)
- {
- char buf[MAX_PATH];
- char *basename;
- DWORD len = GetFullPathName(filename, MAX_PATH, buf, &basename);
- if (len == 0 || len > MAX_PATH - 1)
- return pcb_strdup(filename);
- else {
- /* The file system is case-preserving but case-insensitive,
- Canonicalize to lowercase, using the codepage associated
- with the process locale. */
- CharLowerBuff(buf, len);
- return pcb_strdup(buf);
- }
- }
-#else
-
- /* This system is a lost cause, just duplicate the filename. */
- return pcb_strdup(filename);
-#endif
-}
Index: 1.1.4/src/list_text.c
===================================================================
--- 1.1.4/src/list_text.c (revision 10776)
+++ 1.1.4/src/list_text.c (nonexistent)
@@ -1,26 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#define TDL_DONT_UNDEF
-#include "global_objs.h"
-#include "list_text.h"
-#include
Index: 1.1.4/src/list_conf.c
===================================================================
--- 1.1.4/src/list_conf.c (revision 10776)
+++ 1.1.4/src/list_conf.c (nonexistent)
@@ -1,26 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#define FROM_CONF_C
-#include "conf.h"
-#include "list_conf.h"
-#include
Index: 1.1.4/src/hid_flags.c
===================================================================
--- 1.1.4/src/hid_flags.c (revision 10776)
+++ 1.1.4/src/hid_flags.c (nonexistent)
@@ -1,104 +0,0 @@
-#include "config.h"
-
-#include
-#include
-#include
-
-#include "data.h"
-#include "misc.h"
-#include "conf.h"
-
-#include "hid.h"
-#include "hid_flags.h"
-#include "genht/hash.h"
-#include "genht/htsp.h"
-#include "error.h"
-#include "hid_actions.h"
-
-int hid_get_flag(const char *name)
-{
- const char *cp;
-
- if (name == NULL)
- return -1;
-
- cp = strchr(name, '(');
- if (cp == NULL) {
- conf_native_t *n = conf_get_field(name);
- if (n == NULL)
- return -1;
- if ((n->type != CFN_BOOLEAN) || (n->used != 1))
- return -1;
- return n->val.boolean[0];
- }
- else {
- const char *end, *s;
- const char *argv[2];
- if (cp != NULL) {
- const HID_Action *a;
- char buff[256];
- int len, multiarg;
- len = cp - name;
- if (len > sizeof(buff)-1) {
- Message(PCB_MSG_DEFAULT, "hid_get_flag: action name too long: %s()\n", name);
- return -1;
- }
- memcpy(buff, name, len);
- buff[len] = '\0';
- a = hid_find_action(buff);
- if (!a) {
- Message(PCB_MSG_DEFAULT, "hid_get_flag: no action %s\n", name);
- return -1;
- }
- cp++;
- len = strlen(cp);
- end = NULL;
- multiarg = 0;
- for(s = cp; *s != '\0'; s++) {
- if (*s == ')') {
- end = s;
- break;
- }
- if (*s == ',')
- multiarg = 1;
- }
- if (!multiarg) {
- /* faster but limited way for a single arg */
- if ((len > sizeof(buff)-1) || (end == NULL)) {
- Message(PCB_MSG_DEFAULT, "hid_get_flag: action arg too long or unterminated: %s\n", name);
- return -1;
- }
- len = end - cp;
- memcpy(buff, cp, len);
- buff[len] = '\0';
- argv[0] = buff;
- argv[1] = NULL;
- return hid_actionv_(a, len > 0, argv);
- }
- else {
- /* slower but more generic way */
- return hid_parse_command(name);
- }
- }
- else {
- fprintf(stderr, "ERROR: hid_get_flag(%s) - not a path or an action\n", name);
- }
- }
- return -1;
-}
-
-void hid_save_and_show_layer_ons(int *save_array)
-{
- int i;
- for (i = 0; i < max_copper_layer + 2; i++) {
- save_array[i] = PCB->Data->Layer[i].On;
- PCB->Data->Layer[i].On = 1;
- }
-}
-
-void hid_restore_layer_ons(int *save_array)
-{
- int i;
- for (i = 0; i < max_copper_layer + 2; i++)
- PCB->Data->Layer[i].On = save_array[i];
-}
Index: 1.1.4/src/list_pin.c
===================================================================
--- 1.1.4/src/list_pin.c (revision 10776)
+++ 1.1.4/src/list_pin.c (nonexistent)
@@ -1,26 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#define TDL_DONT_UNDEF
-#include "global_objs.h"
-#include "list_pin.h"
-#include
Index: 1.1.4/src/pcb-menu-lesstif.lht
===================================================================
--- 1.1.4/src/pcb-menu-lesstif.lht (revision 10776)
+++ 1.1.4/src/pcb-menu-lesstif.lht (nonexistent)
@@ -1,499 +0,0 @@
-ha:{
- li:mouse {
- li:left {
- li:press = { Mode(Notify) }
- li:press-shift = { Mode(Notify) }
- li:release = { Mode(Release) }
- li:release-shift = { Mode(Release) }
- }
- li:right {
- li:press = { Mode(Save); Mode(Rotate); Mode(Notify); Mode(Release); Mode(Restore); }
- li:press-ctrl = { Display(CycleCrosshair) }
- }
- li:middle {
- li:press = { Pan(1) }
- li:release = { Pan(0) }
- li:press-ctrl = { Pan(thumb,1) }
- li:release-ctrl = { Pan(thumb,0) }
- }
- li:scroll-up {
- li:press = { Zoom(0.8) }
- }
- li:scroll-down {
- li:press = { Zoom(1.25) }
- }
- #If you want zoom to center, do this instead.
- #in scroll-up:
- #li:press = {Zoom(0.8); Center()}
- #in scroll-down:
- #li:perss = {Zoom(1.25); Center()}
- }
-
- li:main_menu {
- ha:File = {
- li:submenu {
- ha:About... = { action=About() }
- ha:Save layout = { m=S; a=Ctrls; action=Save(Layout) }
- ha:Save layout as... = { m=A; a=Shift Ctrls; action=Save(LayoutAs) }
- ha:Revert = { action=Load(Revert,none) }
- ha:Import Schematics = { action=Import() }
- ha:Load layout = { action=Load(Layout) }
- ha:Load element data to paste-buffer = { li:action={PasteBuffer(Clear); Load(ElementTobuffer)} }
- ha:Load layout data to paste-buffer = { li:action={PasteBuffer(Clear); Load(LayoutTobuffer)} }
- ha:Load netlist file = { action=Load(Netlist) }
- ha:Load vendor resource file = { action=LoadVendor() }
- ha:Print layout... = { action=Print() }
- ha:Export layout... = { action=Export() }
- ha:Maintenance {
- li:submenu {
- ha:Calibrate Printer... = { action=PrintCalibrate() }
- ha:Re-scan the footprint library = { action=fp_rehash() }
- }
- }
- -
- ha:Save connection data of... = { foreground=grey50; sensitive=false }
- ha: a single element = { li:action={GetXY(Click to set the element mark <>); Save(ElementConnections)} }
- ha: all elements = { action=Save(AllConnections) }
- ha: unused pins = { action=Save(AllUnusedPins) }
- -
- ha:Start new layout = { a=Ctrln; action=New() }
- -
- ha:Quit Program = { m=Q; a=Ctrlq; action=Quit() }
- }
- } # File
-
- ha:View {
- li:submenu {
- ha:Flip up/down = { checked=editor/view/flip_y; a=Tab; action=SwapSides(V) }
- ha:Flip left/right = { checked=editor/view/flip_x; a=ShiftTab; action=SwapSides(H) }
- ha:Spin 180° = { a=CtrlTab; action=SwapSides(R) }
- ha:Swap Sides = { a=Ctrl ShiftTab; action=SwapSides() }
- ha:Center cursor = { a=c; action=Center() }
- ha:Show soldermask = { checked=showmask; action=Display(ToggleMask) }
- -
- ha:Displayed element-name... = { foreground=grey50; sensitive=false }
- ha:Description = { checked=ChkElementName(1); action=Display(Description) }
- ha:Reference Designator = { checked=ChkElementName(2); action=Display(NameOnPCB) }
- ha:Value = { checked=ChkElementName(3); action=Display(Value) }
- ha:Lock Names = { checked=editor/lock_names; action=conf(toggle, editor/lock_names, design) }
- ha:Only Names = { checked=editor/only_names; action=conf(toggle, editor/only_names, design) }
- ha:Hide Names = { checked=editor/hide_names; action=conf(toggle, editor/hide_names, design) }
- ha:Mincut on shorts = { checked=plugins/mincut/enable; action=conf(toggle, plugins/mincut/enable, design) }
- -
- ha:Pinout shows number = { checked=editor/show_number; action=conf(toggle, editor/show_number, design) }
- ha:Open pinout menu = { a=Shiftd; action=Display(Pinout) }
- ha:Zoom {
- li:submenu {
- ha:Zoom In 2X = { action=Zoom(-2) }
- ha:Zoom In 20% = { m=Z; a=z; action=Zoom(-1.2) }
- ha:Zoom Out 20% = { m=O; a=Shiftz; action=Zoom(+1.2); }
- ha:Zoom Out 2X = { action=Zoom(+2) }
- ha:Zoom Max = { m=M; a=v; action=Zoom() }
- ha:Zoom Toggle = { a=`; action=Zoom(Toggle) }
- -
- ha:Zoom to 0.1mil\/px = { action={Zoom(=0.1mil)} }
- ha:Zoom to 0.01mm\/px = { action={Zoom(=0.01mil)} }
- ha:Zoom to 1mil\/px = { action={Zoom(=1mil)} }
- ha:Zoom to 0.05mm\/px = { action={Zoom(=0.05mm)} }
- ha:Zoom to 2.5mil\/px = { action={Zoom(=2.5mil)} }
- ha:Zoom to 0.1mm\/px = { action={Zoom(=0.1mm)} }
- ha:Zoom to 10mil\/px = { action={Zoom(=10mil)} }
- }
- }
- ha:Grid {
- li:submenu {
- ha:mil = { checked=ChkGridUnits(mil); action=SetUnits(mil) }
- ha:mm = { checked=ChkGridUnits(mm); action=SetUnits(mm) }
- ha:Display grid = { checked=editor/draw_grid; action=conf(toggle, editor/draw_grid, design) }
- ha:Realign grid = { li:action={GetXY(Click to set the grid origin); Display(ToggleGrid)} }
- ha:No Grid = { checked=ChkGridSize(none); action=SetValue(Grid,1) }
- -
- ha:0.1 mil = { checked=ChkGridSize(0.1mil); li:action={SetUnits(mil); SetValue(Grid,0.1mil)} }
- ha:1 mil = { checked=ChkGridSize(1mil); li:action={SetUnits(mil); SetValue(Grid,1mil)} }
- ha:5 mil = { checked=ChkGridSize(5mil); li:action={SetUnits(mil); SetValue(Grid,5mil)} }
- ha:10 mil = { checked=ChkGridSize(10mil); li:action={SetUnits(mil); SetValue(Grid,10mil)} }
- ha:25 mil = { checked=ChkGridSize(25mil); li:action={SetUnits(mil); SetValue(Grid,25mil)} }
- ha:50 mil = { checked=ChkGridSize(50mil); li:action={SetUnits(mil); SetValue(Grid,50mil)} }
- ha:100 mil = { checked=ChkGridSize(100mil); li:action={SetUnits(mil); SetValue(Grid,100mil)} }
- -
- ha:0.01 mm = { checked=ChkGridSize(0.01mm); li:action={SetUnits(mm); SetValue(Grid,0.01mm)} }
- ha:0.05 mm = { checked=ChkGridSize(0.05mm); li:action={SetUnits(mm); SetValue(Grid,0.05mm)} }
- ha:0.1 mm = { checked=ChkGridSize(0.10mm); li:action={SetUnits(mm); SetValue(Grid,0.1mm)} }
- ha:0.25 mm = { checked=ChkGridSize(0.25mm); li:action={SetUnits(mm); SetValue(Grid,0.25mm)} }
- ha:0.5 mm = { checked=ChkGridSize(0.50mm); li:action={SetUnits(mm); SetValue(Grid,0.5mm)} }
- ha:1 mm = { checked=ChkGridSize(1mm); li:action={SetUnits(mm); SetValue(Grid,1mm)} }
- -
- ha:Grid -5mil = { a=Shiftg; action=SetValue(Grid,-5,mil) }
- ha:Grid +5mil = { a=g; action=SetValue(Grid,+5,mil) }
- ha:Grid -0.05mm = { a=Shift Ctrlg; action=SetValue(Grid,-0.05,mm) }
- ha:Grid +0.05mm = { a=Ctrlg; action=SetValue(Grid,+0.05,mm) }
- }
- }
- -
- ha:Shown Layers {
- li:submenu {
- @layerview
- -
- ha:Edit Layer Groups = { action=EditLayerGroups() }
- }
- }
- ha:Current Layer {
- li:submenu {
- @layerpick
- -
- ha:Delete current layer = { action=MoveLayer(c,-1) }
- ha:Add new layer = { action=MoveLayer(-1,c) }
- ha:Move current layer up = { action=MoveLayer(c,up) }
- ha:Move current layer down = { action=MoveLayer(c,down) }
- }
- }
- }
- } # View
-
- ha:Edit {
- li:submenu {
- ha:Undo last operation = { a=u; action=Undo() }
- ha:Redo last undone operation = { a=Shiftr; action=Redo() }
- ha:Clear undo-buffer = { a=Shift Ctrlu; action=Undo(ClearList); }
- -
- ha:Cut selection to buffer = { a=Ctrlx; li:action={GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); RemoveSelected(); Mode(PasteBuffer)} }
- ha:Copy selection to buffer = { a=Ctrlc; li:action={GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Mode(PasteBuffer)} }
- ha:Paste buffer to layout = { a=Ctrlv; action=Mode(PasteBuffer) }
- -
- ha:Unselect all = { a=Shift Alta; action=Unselect(All) }
- ha:Select all visible = { a=Alta; action=Select(All) }
- -
- ha:Edit Names... = { foreground=grey50; sensitive=false }
- ha: Change text on layout = { a=n; action=ChangeName(Object) }
- ha: Change text on layout = { a=Shift Ctrln; action=ChangeName(Object, Number) }
- ha: Edit name of layout = { action=ChangeName(Layout) }
- ha: Edit name of active layer = { action=ChangeName(Layer) }
- ha:Edit Attributes... = { foreground=grey50; sensitive=false }
- ha: Layout = { action=Attributes(Layout) }
- ha: CurrentLayer = { action=Attributes(Layer) }
- ha: Element = { action=Attributes(Element) }
- -
- ha:Board Sizes = { action=AdjustSizes() }
- ha:Route Styles {
- li:submenu {
- @routestyles
- -
- ha:Edit... = { action=AdjustStyle(0) }
- }
- }
- }
- } # Edit
-
- ha:Tools {
- li:submenu {
- ha:None = { checked=ChkMode(none); action=Mode(None) }
- ha:Via = { checked=ChkMode(via); a=F1; action=Mode(Via) }
- ha:Line = { checked=ChkMode(line); a=F2; action=Mode(Line) }
- ha:Arc = { checked=ChkMode(arc); a=F3; action=Mode(Arc) }
- ha:Text = { checked=ChkMode(text); a=F4; action=Mode(Text) }
- ha:Rectangle = { checked=ChkMode(rectangle); a=F5; action=Mode(Rectangle) }
- ha:Polygon = { checked=ChkMode(polygon); a=F6; action=Mode(Polygon) }
- ha:Polygon Hole = { checked=ChkMode(polygonhole); action=Mode(PolygonHole); }
- ha:Buffer = { checked=ChkMode(pastebuffer); a=F7; action=Mode(PasteBuffer) }
- ha:Remove = { checked=ChkMode(remove); a=F8; action=Mode(Remove) }
- ha:Rotate = { checked=ChkMode(rotate); a=F9; action=Mode(Rotate) }
- ha:Thermal = { checked=ChkMode(thermal); a=F10; action=Mode(Thermal) }
- ha:Arrow = { checked=ChkMode(arrow); a=F11; action=Mode(Arrow) }
- ha:Insert Point = { checked=ChkMode(insertpoint); a=Insert; action=Mode(InsertPoint) }
- ha:Move = { checked=ChkMode(move); action=Mode(Move) }
- ha:Copy = { checked=ChkMode(copy); action=Mode(Copy) }
- ha:Lock = { checked=ChkMode(lock); a=F12; action=Mode(Lock) }
- ha:Cancel = { a=Escape; action=Mode(Cancel) }
- -
- ha:Command = { a={:}; action=Command() }
- }
- } # Tools
-
- ha:Settings {
- li:submenu {
- ha:Layer groups = { foreground=grey50; sensitive=false }
- ha:Edit layer groupings = { action=EditLayerGroups() }
- -
- ha:'All-direction' lines = { checked=editor/all_direction_lines; a=.; action=conf(toggle, editor/all_direction_lines, design) }
- ha:Auto swap line start angle = { checked=editor/swap_start_direction; action=conf(toggle, editor/swap_start_direction, design) }
- ha:Orthogonal moves = { checked=editor/orthogonal_moves; action=conf(toggle, editor/orthogonal_moves, design) }
- ha:Crosshair snaps to pins and pads = { checked=editor/snap_pin; action=conf(toggle, editor/snap_pin, design) }
- ha:Crosshair snaps to off-grid points on lines = { checked=editor/snap_offgrid_line; action=conf(toggle, editor/snap_offgrid_line, design) }
- ha:Crosshair shows DRC clearance = { checked=editor/show_drc; action=conf(toggle, editor/show_drc, design) }
- ha:Auto enforce DRC clearance = { checked=editor/auto_drc; action=conf(toggle, editor/auto_drc, design) }
- -
- ha:Rubber band mode = { checked=editor/rubber_band_mode; action=conf(toggle, editor/rubber_band_mode, design) }
- ha:Require unique element names = { checked=editor/unique_names; action=conf(toggle, editor/unique_names, design) }
- ha:Auto-zero delta measurements = { checked=editor/local_ref; action=conf(toggle, editor/local_ref, design) }
- ha:New lines, arcs clear polygons = { checked=editor/clear_line; action=conf(toggle, editor/clear_line, design) }
- ha:New polygons are full ones = { checked=editor/full_poly; action=conf(toggle, editor/full_poly, design) }
- ha:Show autorouter trials = { checked=editor/live_routing; action=conf(toggle, editor/live_routing, design) }
- ha:Highlighting on line, arc points = { checked=editor/highlight_on_point; action=conf(toggle, editor/highlight_on_point, design) }
- ha:Thin draw = { checked=editor/thin_draw; a=|; action=conf(toggle, editor/thin_draw, design) }
- ha:Thin draw poly = { checked=editor/thin_drawpoly; a=Ctrl Shiftp; action=conf(toggle, editor/thin_draw_poly, design) }
- ha:Check polygons = { checked=editor/check_planes; action=conf(toggle, editor/check_planes, design) }
- -
- ha:Pinout shows number = { checked=editor/show_number; action=conf(toggle, editor/show_number, design) }
- ha:Pins/Via show Name/Number = { a=d; action=Display(PinOrPadName) }
- ha:Enable vendor drill mapping = { checked=plugins/vendor/enable; action=conf(toggle, plugins/vendor/enable, design) }
- ha:Import Settings {
- li:submenu {
- ha:New elements added at... = { foreground=grey50; sensitive=false }
- ha: Center = { action=Import(setnewpoint,center) }
- ha: Mark = { action=Import(setnewpoint,mark) }
- ha: Crosshair = { action=Import(setnewpoint) }
- -
- ha:Set Dispersion = { action=Import(setdisperse) }
- }
- }
- }
- } # Settings
-
- ha:Select {
- li:submenu {
- ha:Select all visible objects = { action=Select(All) }
- ha:Select all connected objects = { action=Select(Connection) }
- -
- ha:Unselect all objects = { action=Unselect(All) }
- ha:unselect all connected objects = { action=Unselect(Connection) }
- -
- ha:Select by name = { foreground=grey50; sensitive=false }
- ha:All objects = { active=rc/have_regex; action=Select(ObjectByName) }
- ha:Elements = { active=rc/have_regex; action=Select(ElementByName) }
- ha:Pads = { active=rc/have_regex; action=Select(PadByName) }
- ha:Pins = { active=rc/have_regex; action=Select(PinByName) }
- ha:Text Objects = { active=rc/have_regex; action=Select(TextByName) }
- ha:Vias = { active=rc/have_regex; action=Select(ViaByName) }
- -
- ha:Auto-place selected elements = { a=Ctrlp; action=AutoPlaceSelected() }
- ha:Disperse all elements = { action=DisperseElements(All) }
- ha:Move selected elements to other side = { a=Shiftb; action=Flip(SelectedElements) }
- ha:Move selected to current layer = { a=Shiftm; action=MoveToCurrentLayer(Selected) }
- ha:Delete selected objects = { a=Delete; action=Delete(Selected) }
- ha:Convert selection to element = { action=Select(Convert) }
- -
- ha:Optimize selected rats = { li:action={DeleteRats(SelectedRats); AddRats(SelectedRats)} }
- ha:Auto-route selected rats = { a=Altr; action=AutoRoute(SelectedRats) }
- ha:Rip up selected auto-routed tracks = { action=RipUp(Selected) }
- -
- ha:Change size of selected objects = { foreground=grey50; sensitive=false }
- ha:ChangeSizes to Route style = { a=Shifty; action=ChangeSizes(Object,style,mil); }
- ha:Lines -10 mil = { li:action={ChangeSize(SelectedLines,-10,mil); ChangeSize(SelectedArcs,-10,mil)} }
- ha:Lines +10 mil = { li:action={ChangeSize(SelectedLines,+10,mil); ChangeSize(SelectedArcs,+10,mil)} }
- ha:Pads -10 mil = { action=ChangeSize(SelectedPads,-10,mil) }
- ha:Pads +10 mil = { action=ChangeSize(SelectedPads,+10,mil) }
- ha:Pins -10 mil = { action=ChangeSize(SelectedPins,-10,mil) }
- ha:Pins +10 mil = { action=ChangeSize(SelectedPins,+10,mil) }
- ha:Texts -10 mil = { action=ChangeSize(SelectedTexts,-10,mil) }
- ha:Texts +10 mil = { action=ChangeSize(SelectedTexts,+10,mil) }
- ha:Vias -10 mil = { action=ChangeSize(SelectedVias,-10,mil) }
- ha:Vias +10 mil = { action=ChangeSize(SelectedVias,+10,mil) }
- -
- ha:Change drilling hole of selected objects = { foreground=grey50; sensitive=false }
- ha:Vias -10 mil = { action=ChangeDrillSize(SelectedVias,-10,mil) }
- ha:Vias +10 mil = { action=ChangeDrillSize(SelectedVias,+10,mil) }
- ha:Pins -10 mil = { action=ChangeDrillSize(SelectedPins,-10,mil) }
- ha:Pins +10 mil = { action=ChangeDrillSize(SelectedPins,+10,mil) }
- -
- ha:Change square-flag of selected objects = { foreground=grey50; sensitive=false }
- ha:Elements = { action=ChangeSquare(SelectedElements) }
- ha:Pins = { action=ChangeSquare(SelectedPins) }
- }
- } # Select
-
-
- ha:Buffer {
- li:submenu {
- ha:Copy selection to buffer = { li:action={GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); Mode(PasteBuffer)} }
- ha:Cut selection to buffer = { li:action={GetXY(Click to set the snap point for this buffer); PasteBuffer(Clear); PasteBuffer(AddSelected); RemoveSelected(); Mode(PasteBuffer)} }
- ha:Paste buffer to layout = { action=Mode(PasteBuffer) }
- -
- ha:Rotate buffer 90 deg CCW = { a=ShiftF7; li:action={Mode(PasteBuffer); PasteBuffer(Rotate,1)} }
- ha:Rotate buffer 90 deg CW = { li:action={Mode(PasteBuffer); PasteBuffer(Rotate,3)} }
- ha:Arbitrarily Rotate Buffer = { li:action={Mode(PasteBuffer); FreeRotateBuffer()} }
- ha:Mirror buffer (up/down) = { li:action={Mode(PasteBuffer); PasteBuffer(Mirror)} }
- ha:Mirror buffer (left/right) = { li:action={Mode(PasteBuffer); PasteBuffer(Rotate,1); PasteBuffer(Mirror); PasteBuffer(Rotate,3)} }
- -
- ha:Clear buffer = { action=PasteBuffer(Clear) }
- ha:Convert buffer to element = { action=PasteBuffer(Convert) }
- ha:Break buffer elements to pieces = { action=PasteBuffer(Restore) }
- ha:Save buffer elements to file = { action=Save(PasteBuffer) }
- -
- ha:Select current buffer = { foreground=grey50; sensitive=false }
- ha:\#1 = { checked=ChkBuffer(1); a=Shift1; action=PasteBuffer(1) }
- ha:\#2 = { checked=ChkBuffer(2); a=Shift2; action=PasteBuffer(2) }
- ha:\#3 = { checked=ChkBuffer(3); a=Shift3; action=PasteBuffer(3) }
- ha:\#4 = { checked=ChkBuffer(4); a=Shift4; action=PasteBuffer(4) }
- ha:\#5 = { checked=ChkBuffer(5); a=Shift5; action=PasteBuffer(5) }
- }
- } # Buffer
-
-
- ha:Connects {
- li:submenu {
- ha:Lookup connection to object = { a=Ctrlf; li:action={GetXY(Click on the object); Connection(Find)} }
- ha:Reset scanned pads/pins/vias = { li:action={Connection(ResetPinsViasAndPads); Display(Redraw)} }
- ha:Reset scanned lines/polygons = { li:action={Connection(ResetLinesAndPolygons); Display(Redraw)} }
- ha:Reset all connections = { a=Shiftf; li:action={Connection(Reset); Display(Redraw)} }
- -
- ha:Optimize rats-nest = { a=o; li:action={Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(AllRats); Atomic(Block)} }
- ha:Erase rats-nest = { a=e; action=DeleteRats(AllRats) }
- ha:Erase selected rats = { a=Shifte; action=DeleteRats(SelectedRats) }
- -
- ha:Auto-route selected rats = { action=AutoRoute(Selected) }
- ha:Auto-route all rats = { action=AutoRoute(AllRats) }
- ha:Rip up all auto-routed tracks = { action=RipUp(All) }
- -
- ha:Auto-Optimize = { a={Shift=}; action=djopt(auto) }
- ha:Debumpify = { action=djopt(debumpify) }
- ha:Unjaggy = { action=djopt(unjaggy) }
- ha:Vianudge = { action=djopt(vianudge) }
- ha:Viatrim = { action=djopt(viatrim) }
- ha:Orthopull = { action=djopt(orthopull) }
- ha:SimpleOpts = { a={=}; action=djopt(simple) }
- ha:Miter = { action=djopt(miter) }
- ha:Puller = { a=y; action=Puller() }
- ha:Global Puller = {
- li:submenu {
- ha:Selected = { action=GlobalPuller(selected) }
- ha:Found = { action=GlobalPuller(found) }
- ha:All = { action=GlobalPuller() }
- }
- }
- ha:Only autorouted nets = { checked=plugins/djopt/auto_only; action=conf(toggle, plugins/djopt/auto_only, design) }
- -
- ha:Design Rule Checker = { action=DRC() }
- -
- ha:Apply vendor drill mapping = { action=ApplyVendor() }
- }
- } # Connects
-
- ha:Plugins = {
- li:submenu {
- ha:Manage plugins... = { a=Altp; action=ManagePlugins() }
- }
- } # Plugins
-
-
- ha:Info {
- li:submenu {
- ha:Generate object report = { a=Ctrlr; action=ReportObject() }
- ha:Generate drill summary = { action=Report(DrillReport) }
- ha:Report found pins/pads = { action=Report(FoundPins) }
- ha:Report net length = { a=r; action=Report(NetLength) }
- ha:Key Bindings {
- li:submenu {
- ha:Remove = { a=BackSpace; action=Delete(Selected) }
- ha:Remove Connected = { a=ShiftBackSpace; li:action={Atomic(Save); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Restore); Connection(Find); Atomic(Restore); Select(Connection); Atomic(Restore); RemoveSelected(); Atomic(Restore); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Block)} }
- ha:Remove Connected = { a=ShiftDelete; li:action={Atomic(Save); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Restore); Connection(Find); Atomic(Restore); Select(Connection); Atomic(Restore); RemoveSelected(); Atomic(Restore); Connection(Reset); Atomic(Restore); Unselect(All); Atomic(Block)} }
- ha:Set Same = { a=a; action=SetSame() }
- ha:Flip Object = { a=b; action=Flip(Object) }
- ha:Find Connections = { a=f; li:action={Connection(Reset); Connection(Find)} }
- ha:ToggleHideName Object = { a=h; action=ToggleHideName(Object) }
- ha:ToggleHideName SelectedElement = { a=Shifth; action=ToggleHideName(SelectedElements) }
- ha:ChangeHole Object = { a=Ctrlh; action=ChangeHole(Object) }
- ha:ChangeJoin Object = { a=j; action=ChangeJoin(Object) }
- ha:ChangeJoin SelectedObject = { a=Shiftj; action=ChangeJoin(SelectedObjects) }
- ha:Clear Object +2 mil = { a=k; action=ChangeClearSize(Object,+2,mil) }
- ha:Clear Object -2 mil = { a=Shiftk; action=ChangeClearSize(Object,-2,mil) }
- ha:Clear Selected +2 mil = { a=Ctrlk; action=ChangeClearSize(SelectedObjects,+2,mil) }
- ha:Clear Selected -2 mil = { a=Shift Ctrlk; action=ChangeClearSize(SelectedObjects,-2,mil) }
- ha:Line Tool size +5 mil = { a=l; action=SetValue(LineSize,+5,mil) }
- ha:Line Tool size -5 mil = { a=Shiftl; action=SetValue(LineSize,-5,mil) }
- ha:Move Object to current layer = { a=m; action=MoveToCurrentLayer(Object) }
- ha:MarkCrosshair = { a=Ctrlm; action=MarkCrosshair() }
- ha:Select shortest rat = { a=Shiftn; action=AddRats(Close) }
- ha:AddRats to selected pins = { a=Shifto; li:action={Atomic(Save); DeleteRats(AllRats); Atomic(Restore); AddRats(SelectedRats); Atomic(Block)} }
- ha:ChangeOctagon Object = { a=Ctrlo; action=ChangeOctagon(Object) }
- ha:Polygon PreviousPoint = { a=p; action=Polygon(PreviousPoint) }
- ha:Polygon Close = { a=Shiftp; action=Polygon(Close) }
- ha:ChangeSquare Object = { a=q; action=ChangeSquare(Object) }
- ha:ChangeSize +5 mil = { a=s; action=ChangeSize(Object,+5,mil) }
- ha:ChangeSize -5 mil = { a=Shifts; action=ChangeSize(Object,-5,mil) }
- ha:ChangeDrill +5 mil = { a=Alts; action=ChangeDrillSize(Object,+5,mil) }
- ha:ChangeDrill -5 mil = { a=Alt Shifts; action=ChangeDrillSize(Object,-5,mil) }
- ha:Text Tool scale +10 mil = { a=t; action=SetValue(TextScale,+10,mil) }
- ha:Text Tool scale -10 mil = { a=Shiftt; action=SetValue(TextScale,-10,mil) }
- ha:Via Tool size +5 mil = { a=Shiftv; action=SetValue(ViaSize,+5,mil) }
- ha:Via Tool size -5 mil = { a=Shift Ctrlv; action=SetValue(ViaSize,-5,mil) }
- ha:Via Tool drill +5 mil = { a=Altv; action=SetValue(ViaDrillingHole,+5,mil) }
- ha:Via Tool drill -5 mil = { a=Alt Shiftv; action=SetValue(ViaDrillingHole,-5,mil) }
- ha:AddRats Selected = { a=Shiftw; action=AddRats(SelectedRats) }
- ha:Add All Rats = { a=w; action=AddRats(AllRats) }
- ha:Undo = { a=Altz; action=Undo() }
- ha:Cycle Clip = { a=/; action=Display(CycleClip) }
- ha:Arrow = { a=space; checked=ChkMode(arrow); action=Mode(Arrow) }
- ha:Temp Arrow ON = { a=[; li:action={Mode(Save); Mode(Arrow); Mode(Notify)} }
- ha:Temp Arrow OFF = { a=]; li:action={Mode(Release); Mode(Restore)} }
- ha:Step Up = { a=Up; action=Cursor(Warp,0,1,grid) }
- ha:Step Down = { a=Down; action=Cursor(Warp,0,-1,grid) }
- ha:Step Left = { a=Left; action=Cursor(Warp,-1,0,grid) }
- ha:Step Right = { a=Right; action=Cursor(Warp,1,0,grid) }
- ha:Step +Up = { a=ShiftUp; action=Cursor(Pan,0,50,view) }
- ha:Step +Down = { a=ShiftDown; action=Cursor(Pan,0,-50,view) }
- ha:Step +Left = { a=ShiftLeft; action=Cursor(Pan,-50,0,view) }
- ha:Step +Right = { a=ShiftRight; action=Cursor(Pan,50,0,view) }
- ha:"Click" = { a=Enter; li:action={Mode(Notify); Mode(Release)} }
- -
- ha:layer keys {
- li:submenu {
- ha:Select Layer 1 = { a=1; action=SelectLayer(1) }
- ha:Select Layer 2 = { a=2; action=SelectLayer(2) }
- ha:Select Layer 3 = { a=3; action=SelectLayer(3) }
- ha:Select Layer 4 = { a=4; action=SelectLayer(4) }
- ha:Select Layer 5 = { a=5; action=SelectLayer(5) }
- ha:Select Layer 6 = { a=6; action=SelectLayer(6) }
- ha:Select Layer 7 = { a=7; action=SelectLayer(7) }
- ha:Select Layer 8 = { a=8; action=SelectLayer(8) }
- ha:Select Layer 9 = { a=9; action=SelectLayer(9) }
- ha:Select Layer 10 = { a=0; action=SelectLayer(10) }
- ha:Select Layer 11 = { a=Alt1; action=SelectLayer(11) }
- ha:Select Layer 12 = { a=Alt2; action=SelectLayer(12) }
- ha:Select Layer 13 = { a=Alt3; action=SelectLayer(13) }
- ha:Select Layer 14 = { a=Alt4; action=SelectLayer(14) }
- ha:Select Layer 15 = { a=Alt5; action=SelectLayer(15) }
- ha:Select Layer 16 = { a=Alt6; action=SelectLayer(16) }
- ha:Select Layer 17 = { a=Alt7; action=SelectLayer(17) }
- ha:Select Layer 18 = { a=Alt8; action=SelectLayer(18) }
- ha:Select Layer 19 = { a=Alt9; action=SelectLayer(19) }
- ha:Select Layer 20 = { a=Alt0; action=SelectLayer(20) }
- -
- ha:Toggle Layer 1 = { a=Ctrl1; action=ToggleView(1) }
- ha:Toggle Layer 2 = { a=Ctrl2; action=ToggleView(2) }
- ha:Toggle Layer 3 = { a=Ctrl3; action=ToggleView(3) }
- ha:Toggle Layer 4 = { a=Ctrl4; action=ToggleView(4) }
- ha:Toggle Layer 5 = { a=Ctrl5; action=ToggleView(5) }
- ha:Toggle Layer 6 = { a=Ctrl6; action=ToggleView(6) }
- ha:Toggle Layer 7 = { a=Ctrl7; action=ToggleView(7) }
- ha:Toggle Layer 8 = { a=Ctrl8; action=ToggleView(8) }
- ha:Toggle Layer 9 = { a=Ctrl9; action=ToggleView(9) }
- ha:Toggle Layer 10 = { a=Ctrl0; action=ToggleView(10) }
- ha:Toggle Layer 11 = { a=Ctrl-Alt1; action=ToggleView(11) }
- ha:Toggle Layer 12 = { a=Ctrl-Alt2; action=ToggleView(12) }
- ha:Toggle Layer 13 = { a=Ctrl-Alt3; action=ToggleView(13) }
- ha:Toggle Layer 14 = { a=Ctrl-Alt4; action=ToggleView(14) }
- ha:Toggle Layer 15 = { a=Ctrl-Alt5; action=ToggleView(15) }
- ha:Toggle Layer 16 = { a=Ctrl-Alt6; action=ToggleView(16) }
- ha:Toggle Layer 17 = { a=Ctrl-Alt7; action=ToggleView(17) }
- ha:Toggle Layer 18 = { a=Ctrl-Alt8; action=ToggleView(18) }
- ha:Toggle Layer 19 = { a=Ctrl-Alt9; action=ToggleView(19) }
- ha:Toggle Layer 20 = { a=Ctrl-Alt0; action=ToggleView(20) }
- }
- } # layer keys
- }
- } # Key Bindings
- }
- } # Info
-
- ha:Window {
- li:submenu {
- ha:Board Layout = { action=DoWindows(Layout) }
- ha:Library = { action=DoWindows(Library) }
- ha:Message Log = { action=DoWindows(Log) }
- ha:Netlist = { action=DoWindows(Netlist) }
- ha:Pinout = { a=Shiftd; action=Display(Pinout) }
- }
- } # Window
-
- } # main_menu
-} #root
Index: 1.1.4/src/compat_lrealpath.h
===================================================================
--- 1.1.4/src/compat_lrealpath.h (revision 10776)
+++ 1.1.4/src/compat_lrealpath.h (nonexistent)
@@ -1,7 +0,0 @@
-#ifndef PCB_LREALPATH_H
-#define PCB_LREALPATH_H
-
-/* A well-defined realpath () that is always compiled in. */
-char *lrealpath(const char *);
-
-#endif /* PCB_LREALPATH_H */
Index: 1.1.4/src/list_text.h
===================================================================
--- 1.1.4/src/list_text.h (revision 10776)
+++ 1.1.4/src/list_text.h (nonexistent)
@@ -1,41 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef LIST_TEXT_H
-#define LIST_TEXT_H
-
-/* List of Text */
-#define TDL(x) textlist_ ## x
-#define TDL_LIST_T textlist_t
-#define TDL_ITEM_T TextType
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define textlist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-
-#include
-#include
-
-#endif
Index: 1.1.4/src/remove_act.c
===================================================================
--- 1.1.4/src/remove_act.c (revision 10776)
+++ 1.1.4/src/remove_act.c (nonexistent)
@@ -1,107 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996 Thomas Nau
- * Copyright (C) 1997, 1998, 1999, 2000, 2001 Harry Eaton
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Contact addresses for paper mail and Email:
- * Harry Eaton, 6697 Buttonhole Ct, Columbia, MD 21044, USA
- * haceaton@aplcomm.jhuapl.edu
- *
- */
-#include "config.h"
-#include "data.h"
-#include "action_helper.h"
-#include "set.h"
-#include "remove.h"
-#include "funchash_core.h"
-
-/* --------------------------------------------------------------------------- */
-
-static const char delete_syntax[] = "Delete(Object|Selected)\n" "Delete(AllRats|SelectedRats)";
-
-static const char delete_help[] = "Delete stuff.";
-
-/* %start-doc actions Delete
-
-%end-doc */
-
-static int ActionDelete(int argc, const char **argv, Coord x, Coord y)
-{
- const char *function = ACTION_ARG(0);
- int id = funchash_get(function, NULL);
-
- Note.X = Crosshair.X;
- Note.Y = Crosshair.Y;
-
- if (id == -1) { /* no arg */
- if (RemoveSelected() == pcb_false)
- id = F_Object;
- }
-
- switch (id) {
- case F_Object:
- SaveMode();
- SetMode(PCB_MODE_REMOVE);
- NotifyMode();
- RestoreMode();
- break;
- case F_Selected:
- RemoveSelected();
- break;
- case F_AllRats:
- if (DeleteRats(pcb_false))
- SetChangedFlag(pcb_true);
- break;
- case F_SelectedRats:
- if (DeleteRats(pcb_true))
- SetChangedFlag(pcb_true);
- break;
- }
-
- return 0;
-}
-
-/* --------------------------------------------------------------------------- */
-
-static const char removeselected_syntax[] = "RemoveSelected()";
-
-static const char removeselected_help[] = "Removes any selected objects.";
-
-/* %start-doc actions RemoveSelected
-
-%end-doc */
-
-static int ActionRemoveSelected(int argc, const char **argv, Coord x, Coord y)
-{
- if (RemoveSelected())
- SetChangedFlag(pcb_true);
- return 0;
-}
-
-
-HID_Action remove_action_list[] = {
- {"Delete", 0, ActionDelete,
- delete_help, delete_syntax}
- ,
- {"RemoveSelected", 0, ActionRemoveSelected,
- removeselected_help, removeselected_syntax}
- ,
-};
-
-REGISTER_ACTIONS(remove_action_list, NULL)
Index: 1.1.4/src/conf.c
===================================================================
--- 1.1.4/src/conf.c (revision 10776)
+++ 1.1.4/src/conf.c (nonexistent)
@@ -1,1810 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include
-#include
-#include
-#include
-#include "conf.h"
-#include "conf_core.h"
-#include "conf_hid.h"
-#include "hid_cfg.h"
-#include "hid_init.h"
-#include "hid_attrib.h"
-#include "misc_util.h"
-#include "error.h"
-#include "paths.h"
-#include "compat_fs.h"
-#include "compat_misc.h"
-#include "error.h"
-
-/* conf list node's name */
-const char *conf_list_name = "pcb-rnd-conf-v1";
-static const char *conf_user_fn = "~/" DOT_PCB_RND "/pcb-conf.lht";
-
-lht_doc_t *conf_root[CFR_max_alloc];
-int conf_root_lock[CFR_max_alloc];
-int conf_lht_dirty[CFR_max_alloc];
-
-htsp_t *conf_fields = NULL;
-const int conf_default_prio[] = {
-/* CFR_INTERNAL */ 100,
-/* CFR_SYSTEM */ 200,
-/* CFR_DEFAULTPCB */ 300,
-/* CFR_USER */ 400,
-/* CFR_ENV */ 500,
-/* CFR_PROJECT */ 600,
-/* CFR_DESIGN */ 700,
-/* CFR_CLI */ 800,
-0, 0, 0, 0, 0, 0, 0, 0, 0 /* make sure the array is addressable until CFR_max_alloc */
-};
-
-extern const char *conf_internal;
-
-/*static lht_doc_t *conf_plugin;*/
-
-static lht_node_t *conf_lht_get_confroot(lht_node_t *cwd)
-{
- if (cwd == NULL)
- return NULL;
-
- /* if it's a list with a matching name, we found it */
- if ((cwd->type == LHT_LIST) && (strcmp(cwd->name, conf_list_name) == 0))
- return cwd;
-
- /* else it may be the parent-hash of the list */
- if (cwd->type != LHT_HASH)
- return NULL;
-
- return lht_dom_hash_get(cwd, conf_list_name);
-}
-
-
-int conf_load_as(conf_role_t role, const char *fn, int fn_is_text)
-{
- lht_doc_t *d;
- if (conf_root_lock[role])
- return -1;
- if (conf_root[role] != NULL) {
- lht_dom_uninit(conf_root[role]);
- conf_root[role] = NULL;
- }
- if (fn_is_text)
- d = hid_cfg_load_str(fn);
- else
- d = hid_cfg_load_lht(fn);
- if (d == NULL) {
- FILE *f;
- char *efn;
- resolve_path(fn, &efn, 0);
- f = fopen(efn, "r");
- if (f != NULL) { /* warn only if the file is there - missing file is normal */
- Message(PCB_MSG_DEFAULT, "error: failed to load lht config: %s\n", efn);
- fclose(f);
- }
- free(efn);
- return -1;
- }
-
- if ((d->root->type == LHT_LIST) && (strcmp(d->root->name, "pcb-rnd-conf-v1") == 0)) {
- conf_root[role] = d;
- return 0;
- }
-
- if ((d->root->type == LHT_HASH) && (strcmp(d->root->name, "geda-project-v1") == 0)) {
- lht_node_t *confroot;
- confroot = lht_tree_path_(d, d->root, "pcb-rnd-conf-v1", 1, 0, NULL);
- if ((confroot != NULL) && (confroot->type == LHT_LIST) && (strcmp(confroot->name, "li:pcb-rnd-conf-v1") == 0)) {
- conf_root[role] = d;
- return 0;
- }
-
- /* project file with no config root */
- confroot = lht_dom_node_alloc(LHT_LIST, "pcb-rnd-conf-v1");
- lht_dom_hash_put(d->root, confroot);
- conf_root[role] = d;
- return 0;
- }
-
- hid_cfg_error(d->root, "Root node must be either li:pcb-rnd-conf-v1 or ha:geda-project-v1\n");
-
- if (d != NULL)
- lht_dom_uninit(d);
- return -1;
-}
-
-conf_policy_t conf_policy_parse(const char *s)
-{
- if (strcasecmp(s, "overwrite") == 0) return POL_OVERWRITE;
- if (strcasecmp(s, "prepend") == 0) return POL_PREPEND;
- if (strcasecmp(s, "append") == 0) return POL_APPEND;
- if (strcasecmp(s, "disable") == 0) return POL_DISABLE;
- return POL_invalid;
-}
-
-const char *conf_policy_name(conf_policy_t p)
-{
- switch(p) {
- case POL_OVERWRITE: return "overwrite";
- case POL_PREPEND: return "prepend";
- case POL_APPEND: return "append";
- case POL_DISABLE: return "disable";
- case POL_invalid: return "(invalid)";
- }
- return "(unknown)";
-}
-
-conf_role_t conf_role_parse(const char *s)
-{
- if (strcasecmp(s, "internal") == 0) return CFR_INTERNAL;
- if (strcasecmp(s, "system") == 0) return CFR_SYSTEM;
- if (strcasecmp(s, "defaultpcb") == 0) return CFR_DEFAULTPCB;
- if (strcasecmp(s, "user") == 0) return CFR_USER;
- if (strcasecmp(s, "env") == 0) return CFR_ENV;
- if (strcasecmp(s, "project") == 0) return CFR_PROJECT;
- if (strcasecmp(s, "design") == 0) return CFR_DESIGN;
- if (strcasecmp(s, "cli") == 0) return CFR_CLI;
- return CFR_invalid;
-}
-
-const char *conf_role_name(conf_role_t r)
-{
- switch(r) {
- case CFR_INTERNAL: return "internal";
- case CFR_SYSTEM: return "system";
- case CFR_DEFAULTPCB: return "defaultpcb";
- case CFR_USER: return "user";
- case CFR_ENV: return "env";
- case CFR_PROJECT: return "project";
- case CFR_DESIGN: return "design";
- case CFR_CLI: return "cli";
- case CFR_file: return "(file)";
- case CFR_binary: return "(binary)";
-
- case CFR_max_alloc:
- case CFR_max_real:
- case CFR_invalid: return "(invalid role)";
- }
- return "(unknown role)";
-}
-
-
-void conf_extract_poliprio(lht_node_t *root, conf_policy_t *gpolicy, long *gprio)
-{
- long len = strlen(root->name), p = -1;
- char tmp[128];
- char *sprio, *end;
- conf_policy_t pol;
-
- if (len >= sizeof(tmp)) {
- hid_cfg_error(root, "Invalid policy-prio '%s', subtree is ignored\n", root->name);
- return;
- }
-
- memcpy(tmp, root->name, len+1);
-
- /* split and convert prio */
- sprio = strchr(tmp, '-');
- if (sprio != NULL) {
- *sprio = '\0';
- sprio++;
- p = strtol(sprio, &end, 10);
- if ((*end != '\0') || (p < 0)) {
- hid_cfg_error(root, "Invalid prio in '%s', subtree is ignored\n", root->name);
- return;
- }
- }
-
- /* convert policy */
- pol = conf_policy_parse(tmp);
- if (pol == POL_invalid) {
- hid_cfg_error(root, "Invalid policy in '%s', subtree is ignored\n", root->name);
- return;
- }
-
- /* by now the syntax is checked; save the output */
- *gpolicy = pol;
- if (p >= 0)
- *gprio = p;
-}
-
-
-int conf_get_policy_prio(lht_node_t *node, conf_policy_t *gpolicy, long *gprio)
-{
- for(;;node = node->parent) {
- if (node->parent == node->doc->root) {
- conf_extract_poliprio(node, gpolicy, gprio);
- return 0;
- }
- if (node->parent == NULL)
- return -1;
- }
-}
-
-static int conf_parse_increments(Increments *inc, lht_node_t *node)
-{
- lht_node_t *val;
-
- if (node->type != LHT_HASH) {
- hid_cfg_error(node, "Increments need to be a hash\n");
- return -1;
- }
-
-#define incload(field) \
- val = lht_dom_hash_get(node, #field); \
- if (val != NULL) {\
- if (val->type == LHT_TEXT) {\
- pcb_bool succ; \
- inc->field = GetValue(val->data.text.value, NULL, NULL, &succ); \
- if (!succ) \
- hid_cfg_error(node, "invalid numeric value in increment field " #field ": %s\n", val->data.text.value); \
- } \
- else\
- hid_cfg_error(node, "increment field " #field " needs to be a text node\n"); \
- }
-
- incload(grid);
- incload(grid_min);
- incload(grid_max);
- incload(size);
- incload(size_min);
- incload(size_max);
- incload(line);
- incload(line_min);
- incload(line_max);
- incload(clear);
- incload(clear_min);
- incload(clear_max);
-
-#undef incload
- return 0;
-}
-
-const char *conf_get_project_conf_name(const char *project_fn, const char *pcb_fn, const char **try)
-{
- static char res[MAXPATHLEN];
- static const char *project_name = "project.lht";
- FILE *f;
-
- if (project_fn != NULL) {
- strncpy(res, project_fn, sizeof(res)-1);
- res[sizeof(res)-1] = '\0';
- goto check;
- }
-
- if (pcb_fn != NULL) {
- char *end;
- /* replace pcb name with project_name and test */
- strncpy(res, pcb_fn, sizeof(res)-1);
- res[sizeof(res)-1] = '\0';
- end = strrchr(res, PCB_DIR_SEPARATOR_C);
- if (end != NULL) {
- if (end+1+sizeof(project_name) >= res + sizeof(res))
- return NULL;
- strcpy(end+1, project_name);
- goto check;
- }
- /* no path in pcb, try cwd */
- strcpy(res, project_name);
- goto check;
- }
-
- /* no pcb - no project */
- *try = "";
- return NULL;
-
- check:;
- *try = res;
- f = fopen(res, "r");
- if (f != NULL) {
- fclose(f);
- return res;
- }
-
- return NULL;
-}
-
-int conf_parse_text(confitem_t *dst, int idx, conf_native_type_t type, const char *text, lht_node_t *err_node)
-{
- const char *strue[] = {"true", "yes", "on", "1", NULL};
- const char *sfalse[] = {"false", "no", "off", "0", NULL};
- const char **s;
- char *end;
- long l;
- int base = 10;
- double d;
- const Unit *u;
-
- switch(type) {
- case CFN_STRING:
- dst->string[idx] = text;
- break;
- case CFN_BOOLEAN:
- while(isspace(*text)) text++;
- for(s = strue; *s != NULL; s++)
- if (strncasecmp(*s, text, strlen(*s)) == 0) {
- dst->boolean[idx] = 1;
- return 0;
- }
- for(s = sfalse; *s != NULL; s++)
- if (strncasecmp(*s, text, strlen(*s)) == 0) {
- dst->boolean[idx] = 0;
- return 0;
- }
- hid_cfg_error(err_node, "Invalid boolean value: %s\n", text);
- return -1;
- case CFN_INTEGER:
- if ((text[0] == '0') && (text[1] == 'x')) {
- text += 2;
- base = 16;
- }
- l = strtol(text, &end, base);
- while(isspace(*end))
- end++;
- if (*end == '\0') {
- dst->integer[idx] = l;
- return 0;
- }
- hid_cfg_error(err_node, "Invalid integer value: %s\n", text);
- return -1;
- case CFN_REAL:
- d = strtod(text, &end);
- if (*end == '\0') {
- dst->real[idx] = d;
- return 0;
- }
- hid_cfg_error(err_node, "Invalid numeric value: %s\n", text);
- return -1;
- case CFN_COORD:
- {
- pcb_bool succ;
- dst->coord[idx] = GetValue(text, NULL, NULL, &succ);
- if (!succ)
- hid_cfg_error(err_node, "Invalid numeric value (coordinate): %s\n", text);
- }
- break;
- case CFN_UNIT:
- u = get_unit_struct(text);
- if (u == NULL)
- hid_cfg_error(err_node, "Invalid unit: %s\n", text);
- else
- dst->unit[idx] = u;
- break;
- case CFN_INCREMENTS:
- return conf_parse_increments(&(dst->increments[idx]), err_node);
- case CFN_COLOR:
- dst->color[idx] = text; /* let the HID check validity to support flexibility of the format */
- break;
- default:
- /* unknown field type registered in the fields hash: internal error */
- return -1;
- }
- return 0;
-}
-
-int conf_merge_patch_text(conf_native_t *dest, lht_node_t *src, int prio, conf_policy_t pol)
-{
- if ((pol == POL_DISABLE) || (dest->prop[0].prio > prio))
- return 0;
-
- if (dest->random_flags.read_only) {
- hid_cfg_error(src, "WARNING: not going to overwrite read-only value %s from a config file\n", dest->hash_path);
- return 0;
- }
-
- if (conf_parse_text(&dest->val, 0, dest->type, src->data.text.value, src) == 0) {
- dest->prop[0].prio = prio;
- dest->prop[0].src = src;
- dest->used = 1;
- dest->conf_rev = conf_rev;
- }
- return 0;
-}
-
-static void conf_insert_arr(conf_native_t *dest, int offs)
-{
-#define CASE_MOVE(typ, fld) \
- case typ: memmove(dest->val.fld+offs, dest->val.fld, dest->used * sizeof(dest->val.fld[0])); return
-
- memmove(dest->prop+offs, dest->prop, dest->used * sizeof(dest->prop[0]));
- if (dest->used > 0) {
- switch(dest->type) {
- CASE_MOVE(CFN_STRING, string);
- CASE_MOVE(CFN_BOOLEAN, boolean);
- CASE_MOVE(CFN_INTEGER, integer);
- CASE_MOVE(CFN_REAL, real);
- CASE_MOVE(CFN_COORD, coord);
- CASE_MOVE(CFN_UNIT, unit);
- CASE_MOVE(CFN_COLOR, color);
- CASE_MOVE(CFN_LIST, list);
- CASE_MOVE(CFN_INCREMENTS, increments);
- }
- }
-#undef CASE_MOVE
- abort(); /* unhandled type */
-}
-
-int conf_merge_patch_array(conf_native_t *dest, lht_node_t *src_lst, int prio, conf_policy_t pol)
-{
- lht_node_t *s;
- int res, idx, didx, maxpr;
-
- if ((pol == POL_DISABLE) || (pol == POL_invalid))
- return 0;
-
- if (pol == POL_PREPEND) {
- for(s = src_lst->data.list.first, maxpr = 0; s != NULL; s = s->next, maxpr++) ;
-
- if (dest->used+maxpr >= dest->array_size)
- maxpr = dest->array_size - dest->used - 1;
-
- conf_insert_arr(dest, maxpr);
- dest->used += maxpr;
- }
-/*printf("arr merge prio: %d\n", prio);*/
- for(s = src_lst->data.list.first, idx = 0; s != NULL; s = s->next, idx++) {
- if (s->type == LHT_TEXT) {
- switch(pol) {
- case POL_PREPEND:
- if (idx < maxpr)
- didx = idx;
- else
- didx = dest->array_size+1; /* indicate array full */
- break;
- case POL_APPEND:
- didx = dest->used++;
- break;
- case POL_OVERWRITE:
- didx = idx;
- break;
- case POL_DISABLE: case POL_invalid: return 0; /* compiler warning */
- }
-/*printf(" didx: %d / %d '%s'\n", didx, dest->array_size, s->data.text.value);*/
- if (didx >= dest->array_size) {
- hid_cfg_error(s, "Array is already full [%d] of [%d] ignored value: '%s' policy=%d\n", dest->used, dest->array_size, s->data.text.value, pol);
- res = -1;
- break;
- }
-
- if (conf_parse_text(&dest->val, didx, dest->type, s->data.text.value, s) == 0) {
- dest->prop[didx].prio = prio;
- dest->prop[didx].src = s;
- if (didx >= dest->used)
- dest->used = didx+1;
- }
- }
- else {
- hid_cfg_error(s, "List item must be text\n");
- res = -1;
- }
- }
-
- return res;
-}
-
-int conf_merge_patch_list(conf_native_t *dest, lht_node_t *src_lst, int prio, conf_policy_t pol)
-{
- lht_node_t *s;
- int res = 0;
- conf_listitem_t *i;
-
- if ((pol == POL_DISABLE) || (pol == POL_invalid))
- return 0;
-
- if (pol == POL_OVERWRITE) {
- /* overwrite the whole list: make it empty then append new elements */
- while((i = conflist_first(dest->val.list)) != NULL)
- conflist_remove(i);
- }
-
- for(s = src_lst->data.list.first; s != NULL; s = s->next) {
- if (s->type == LHT_TEXT) {
- i = calloc(sizeof(conf_listitem_t), 1);
- i->val.string = &i->payload;
- i->prop.prio = prio;
- i->prop.src = s;
- if (conf_parse_text(&i->val, 0, CFN_STRING, s->data.text.value, s) != 0) {
- free(i);
- continue;
- }
-
- switch(pol) {
- case POL_PREPEND:
- conflist_insert(dest->val.list, i);
- dest->used |= 1;
- break;
- case POL_APPEND:
- case POL_OVERWRITE:
- conflist_append(dest->val.list, i);
- dest->used |= 1;
- break;
- case POL_DISABLE: case POL_invalid: return 0; /* compiler warning */
- }
- }
- else {
- hid_cfg_error(s, "List item must be text\n");
- res = -1;
- }
- }
- return res;
-}
-
-int conf_merge_patch_recurse(lht_node_t *sect, int default_prio, conf_policy_t default_policy, const char *path_prefix);
-
-int conf_merge_patch_item(const char *path, lht_node_t *n, int default_prio, conf_policy_t default_policy)
-{
- conf_native_t *target = conf_get_field(path);
- int res = 0;
- switch(n->type) {
- case LHT_TEXT:
- if (target == NULL) {
- if ((strncmp(path, "plugins/", 8) != 0) && (strncmp(path, "utils/", 6) != 0))/* it is normal to have configuration for plugins and utils not loaded - ignore these */
- hid_cfg_error(n, "conf error: lht->bin conversion: can't find path '%s' - check your lht!\n", path);
- break;
- }
- conf_merge_patch_text(target, n, default_prio, default_policy);
- break;
- case LHT_HASH:
- if (target == NULL) /* no leaf: another level of structs */
- res |= conf_merge_patch_recurse(n, default_prio, default_policy, path);
- else /* leaf: pretend it's text so it gets parsed */
- conf_merge_patch_text(target, n, default_prio, default_policy);
- break;
- case LHT_LIST:
- if (target == NULL)
- hid_cfg_error(n, "conf error: lht->bin conversion: can't find path '%s' - check your lht; may it be that it should be a hash instead of a list?\n", path);
- else if (target->type == CFN_LIST)
- res |= conf_merge_patch_list(target, n, default_prio, default_policy);
- else if (target->array_size > 1)
- res |= conf_merge_patch_array(target, n, default_prio, default_policy);
- else
- hid_cfg_error(n, "Attempt to initialize a scalar with a list - this node should be a text node\n");
- break;
- case LHT_SYMLINK:
-#warning TODO
- break;
- case LHT_INVALID_TYPE:
- case LHT_TABLE:
- /* intentionally unhandled types */
- break;
- }
- return res;
-}
-
-
-/* merge main subtree of a patch */
-int conf_merge_patch_recurse(lht_node_t *sect, int default_prio, conf_policy_t default_policy, const char *path_prefix)
-{
- lht_dom_iterator_t it;
- lht_node_t *n;
- char path[256], *pathe;
- char *namee;
- int nl, ppl = strlen(path_prefix), res = 0;
-
- memcpy(path, path_prefix, ppl);
- path[ppl] = '/';
- pathe = path + ppl + 1;
-
- for(n = lht_dom_first(&it, sect); n != NULL; n = lht_dom_next(&it)) {
- nl = strlen(n->name);
- memcpy(pathe, n->name, nl);
- namee = pathe+nl;
- *namee = '\0';
- res |= conf_merge_patch_item(path, n, default_prio, default_policy);
- }
- return res;
-}
-
-int conf_merge_patch(lht_node_t *root, long gprio)
-{
- conf_policy_t gpolicy;
- lht_node_t *n;
- lht_dom_iterator_t it;
-
- if (root->type != LHT_HASH) {
- hid_cfg_error(root, "patch root should be a hash\n");
- return -1;
- }
-
- conf_extract_poliprio(root, &gpolicy, &gprio);
-
- /* iterate over all hashes and insert them recursively */
- for(n = lht_dom_first(&it, root); n != NULL; n = lht_dom_next(&it))
- if (n->type == LHT_HASH)
- conf_merge_patch_recurse(n, gprio, gpolicy, n->name);
-
- return 0;
-}
-
-typedef struct {
- long prio;
- conf_policy_t policy;
- lht_node_t *subtree;
-} merge_subtree_t;
-
-#define GVT(x) vmst_ ## x
-#define GVT_ELEM_TYPE merge_subtree_t
-#define GVT_SIZE_TYPE size_t
-#define GVT_DOUBLING_THRS 64
-#define GVT_START_SIZE 32
-#define GVT_FUNC
-#define GVT_REALLOC(vect, ptr, size) realloc(ptr, size)
-#define GVT_FREE(vect, ptr) free(ptr)
-#include
-#include
-#include
-
-vmst_t merge_subtree; /* automatically initialized to all-zero */
-
-static void add_subtree(int role, lht_node_t *subtree_parent_root, lht_node_t *subtree_root)
-{
- merge_subtree_t *m;
-
- m = vmst_alloc_append(&merge_subtree, 1);
- m->prio = conf_default_prio[role];
- m->policy = POL_invalid;
-
- conf_extract_poliprio(subtree_parent_root, &m->policy, &m->prio);
- m->subtree = subtree_root;
-}
-
-static int mst_prio_cmp(const void *a, const void *b)
-{
- const merge_subtree_t *s1 = a, *s2 = b;
- if (s1->prio > s2->prio)
- return 1;
- return -1;
-}
-
-int conf_merge_all(const char *path)
-{
- int n, ret = 0;
- vmst_truncate(&merge_subtree, 0);
-
- for(n = 0; n < CFR_max_real; n++) {
- lht_node_t *cr, *r, *r2;
- if (conf_root[n] == NULL)
- continue;
-
- cr = conf_lht_get_confroot(conf_root[n]->root);
- if (cr == NULL)
- continue;
-
- for(r = cr->data.list.first; r != NULL; r = r->next) {
- if (path != NULL) {
- r2 = lht_tree_path_(r->doc, r, path, 1, 0, NULL);
- if (r2 != NULL)
- add_subtree(n, r, r2);
- }
- else
- add_subtree(n, r, r);
- }
- }
-
- qsort(merge_subtree.array, vmst_len(&merge_subtree), sizeof(merge_subtree_t), mst_prio_cmp);
- for(n = 0; n < vmst_len(&merge_subtree); n++) {
- if (path != NULL)
- ret |= conf_merge_patch_item(path, merge_subtree.array[n].subtree, merge_subtree.array[n].prio, merge_subtree.array[n].policy);
- else
- ret |= conf_merge_patch(merge_subtree.array[n].subtree, merge_subtree.array[n].prio);
- }
- return ret;
-}
-
-static void conf_field_clear(conf_native_t *f)
-{
- if (strncmp(f->hash_path, "temp", 4) == 0)
- return;
- if (f->used > 0) {
-#define clr(field) memset(f->val.field, 0, sizeof(*(f->val.field)) * f->used)
- switch(f->type) {
- case CFN_STRING: clr(string); break;
- case CFN_BOOLEAN: clr(boolean); break;
- case CFN_INTEGER: clr(integer); break;
- case CFN_REAL: clr(real); break;
- case CFN_COORD: clr(coord); break;
- case CFN_UNIT: clr(unit); break;
- case CFN_COLOR: clr(color); break;
- case CFN_INCREMENTS: clr(increments); break;
- case CFN_LIST:
- while(conflist_first(f->val.list)) { /* need to free all items of a list before clearing the main struct */
- conf_listitem_t *i = conflist_first(f->val.list);
- conflist_remove(i);
- free(i);
- }
- clr(list);
- break;
- }
- memset(f->prop, 0, sizeof(confprop_t) * f->used);
-#undef clr
- }
-
- f->used = 0;
- f->conf_rev = conf_rev;
-}
-
-int conf_rev = 0;
-void conf_update(const char *path)
-{
- conf_native_t *n;
-
- /* clear memory-bin data first */
- if (path == NULL) {
- htsp_entry_t *e;
- conf_fields_foreach(e) {
- conf_hid_global_cb((conf_native_t *)e->value, val_change_pre);
- conf_hid_local_cb((conf_native_t *)e->value, val_change_pre);
- conf_field_clear(e->value);
- }
- }
- else {
- n = conf_get_field(path);
- if (n == NULL) {
- char *path_, *field;
- path_ = pcb_strdup(path);
-
- /* It might be an array element - truncate */
- field = strrchr(path_, '[');
- if (field != NULL) {
- *field = '\0';
- n = conf_get_field(path_);
- }
-
- /* It may be a field of an increment, truncate last portion */
- if (n == NULL) {
- field = strrchr(path_, '/');
- if (field == NULL) {
- free(path_);
- return;
- }
- *field = '\0';
- n = conf_get_field(path_);
- if (n->type != CFN_INCREMENTS)
- n = NULL;
- }
-
- /* if a valid node is found, update it */
- if (n != NULL)
- conf_update(path_);
-
- free(path_);
- return;
- }
- conf_field_clear(n);
- conf_hid_global_cb(n, val_change_pre);
- conf_hid_local_cb(n, val_change_pre);
- }
-
- /* merge all memory-lht data to memory-bin */
- conf_merge_all(path);
- conf_core_postproc();
-
- if (path == NULL) {
- htsp_entry_t *e;
- conf_fields_foreach(e) {
- conf_hid_local_cb((conf_native_t *)e->value, val_change_post);
- conf_hid_global_cb((conf_native_t *)e->value, val_change_post);
- }
- }
- else {
- conf_hid_local_cb(n, val_change_post);
- conf_hid_global_cb(n, val_change_post);
- }
- conf_rev++;
-}
-
-static lht_node_t *conf_lht_get_first_(lht_node_t *cwd)
-{
- /* assume root is a li and add to the first hash */
- cwd = conf_lht_get_confroot(cwd);
- if (cwd == NULL)
- return NULL;
- cwd = cwd->data.list.first;
- if ((cwd == NULL) || (cwd->type != LHT_HASH))
- return NULL;
- return cwd;
-}
-
-lht_node_t *conf_lht_get_first(conf_role_t target)
-{
- assert(target != CFR_invalid);
- assert(target >= 0);
- assert(target < CFR_max_alloc);
- if (conf_root[target] == NULL)
- return NULL;
- return conf_lht_get_first_(conf_root[target]->root);
-}
-
-static lht_node_t *conf_lht_get_at_(conf_role_t target, const char *conf_path, const char *lht_path, int create)
-{
- lht_node_t *n, *r;
- n = conf_lht_get_first(target);
- if (n == NULL)
- return NULL;
- r = lht_tree_path_(n->doc, n, lht_path, 1, 0, NULL);
- if ((r == NULL) && (create)) {
- conf_set_dry(target, conf_path, -1, "", POL_OVERWRITE);
- r = lht_tree_path_(n->doc, n, lht_path, 1, 0, NULL);
- }
- return r;
-}
-
-lht_node_t *conf_lht_get_at(conf_role_t target, const char *path, int create)
-{
- lht_node_t *r;
- char *pc, *end;
- if (conf_root[target] == NULL) {
- if (!create)
- return NULL;
- conf_reset(target, "");
- }
- end = strchr(path, '[');
- if (end == NULL) {
- r = conf_lht_get_at_(target, path, path, create);
- }
- else {
- /* lihata syntax differs from conf syntax in array indexing */
- pc = pcb_strdup(path);
- pc[end-path] = '/';
- end = strchr(pc+(end-path), ']');
- if (end != NULL)
- *end = '\0';
- r = conf_lht_get_at_(target, path, pc, create);
- free(pc);
- }
- return r;
-}
-
-
-void conf_load_all(const char *project_fn, const char *pcb_fn)
-{
- int i;
- lht_node_t *dln;
- const char *pc, *try;
-
- /* get the lihata node for design/default_layer_name */
- conf_load_as(CFR_INTERNAL, conf_internal, 1);
- dln = conf_lht_get_at(CFR_INTERNAL, "design/default_layer_name", 1);
- assert(dln != NULL);
- assert(dln->type == LHT_LIST);
- dln = dln->data.list.first;
-
- /* Set up default layer names - make sure there are enough layers (over the hardwired ones, if any) */
- for (i = 0; i < MAX_LAYER; i++) {
- char buf[20];
- if (dln == NULL) {
- sprintf(buf, "signal%d", i + 1);
- if (conf_set_dry(CFR_INTERNAL, "design/default_layer_name", i, buf, POL_OVERWRITE) != 0)
- printf("Can't set layer name\n");
- }
- else
- dln = dln->next;
- }
-
- /* load config files */
- conf_load_as(CFR_SYSTEM, PCBSHAREDIR "/pcb-conf.lht", 0);
- conf_load_as(CFR_USER, conf_user_fn, 0);
- pc = conf_get_project_conf_name(project_fn, pcb_fn, &try);
- if (pc != NULL)
- conf_load_as(CFR_PROJECT, pc, 0);
- conf_merge_all(NULL);
-
- /* create the user config (in-memory-lht) if it does not exist on disk;
- this is needed so if the user makes config changes from the GUI things
- get saved. */
- if (conf_root[CFR_USER] == NULL)
- conf_reset(CFR_USER, conf_user_fn);
-}
-
-void conf_load_project(const char *project_fn, const char *pcb_fn)
-{
- const char *pc, *try;
-
- assert((project_fn != NULL) || (pcb_fn != NULL));
-
- pc = conf_get_project_conf_name(project_fn, pcb_fn, &try);
- if (pc != NULL)
- if (conf_load_as(CFR_PROJECT, pc, 0) != 0)
- pc = NULL;
- if (pc == NULL)
- conf_reset(CFR_PROJECT, "");
- conf_update(NULL);
-}
-
-void conf_reg_field_(void *value, int array_size, conf_native_type_t type, const char *path, const char *desc, conf_flag_t flags)
-{
- conf_native_t *node;
-
- if (conf_fields == NULL) {
- conf_fields = htsp_alloc(strhash, strkeyeq);
- assert(conf_fields != NULL);
- }
- assert(array_size >= 1);
-
- assert(htsp_get(conf_fields, path) == NULL);
-
- node = calloc(sizeof(conf_native_t), 1);
- node->array_size = array_size;
- node->type = type;
- node->val.any = value;
- node->prop = calloc(sizeof(confprop_t), array_size);
- node->description = desc;
- node->hash_path = path;
- node->flags = flags;
- vtp0_init(&(node->hid_data));
-
- htsp_set(conf_fields, (char *)path, node);
-}
-
-void conf_free_native(conf_native_t *node)
-{
- if (node->type == CFN_LIST) {
- while(conflist_first(node->val.list) != NULL) {
- conf_listitem_t *first = conflist_first(node->val.list);
- conflist_remove(first);
- free(first);
- }
- }
-
- vtp0_uninit(&(node->hid_data));
- free(node->prop);
- free(node);
-}
-
-void conf_unreg_fields(const char *prefix)
-{
- int len = strlen(prefix);
- htsp_entry_t *e;
-
- assert(prefix[len-1] == '/');
-
- conf_fields_foreach(e) {
- if (strncmp(e->key, prefix, len) == 0) {
- conf_free_native(e->value);
- htsp_delentry(conf_fields, e);
- }
- }
-}
-
-conf_native_t *conf_get_field(const char *path)
-{
- return htsp_get(conf_fields, path);
-}
-
-int conf_set_dry(conf_role_t target, const char *path_, int arr_idx, const char *new_val, conf_policy_t pol)
-{
- char *path, *basename, *next, *last, *sidx, *increment_field = NULL;
- conf_native_t *nat;
- lht_node_t *cwd, *nn;
- lht_node_type_t ty;
- int idx = -1;
-
- /* Remove in overwrite only */
- if ((new_val == NULL) && (pol != POL_OVERWRITE))
- return -1;
-
- path = pcb_strdup(path_);
- sidx = strrchr(path, '[');
- if (sidx != NULL) {
- char *end;
- *sidx = '\0';
- sidx++;
- idx = strtol(sidx, &end, 10);
- if ((*end != ']') || (strchr(sidx, '/') != NULL)) {
- free(path);
- return -1;
- }
- if ((arr_idx >= 0) && (arr_idx != idx)) {
- free(path);
- return -1;
- }
- }
- else if (arr_idx >= 0)
- idx = arr_idx;
-
- nat = conf_get_field(path);
- if (nat == NULL) {
- /* might be increments */
- increment_field = strrchr(path, '/');
- if (increment_field == NULL) {
- free(path);
- return -1;
- }
- *increment_field = '\0';
- nat = conf_get_field(path);
- if ((nat == NULL) || (nat->type != CFN_INCREMENTS)) {
- free(path);
- return -1;
- }
- *increment_field = '/';
- increment_field++;
- }
-
-
- if (conf_root[target] == NULL) {
- free(path);
- return -1;
- }
- if (pol == POL_DISABLE) {
- free(path);
- return 0;
- }
- if ((pol != POL_OVERWRITE) && (idx >= 0)) {
- free(path);
- return -1;
- }
-
- cwd = conf_lht_get_first(target);
- if (cwd == NULL) {
- free(path);
- return -1;
- }
-
- if (idx >= nat->array_size) {
- Message(PCB_MSG_DEFAULT, "Error: can't conf_set() %s[%d]: %d is beyond the end of the array (%d)\n", path, idx, idx, nat->array_size);
- free(path);
- return -1;
- }
-
- basename = strrchr(path, '/');
- if (basename == NULL) {
- free(path);
- return -1;
- }
- *basename = '\0';
- basename++;
-
- /* create parents if they do not exist */
- last = next = path;
- do {
- next = strchr(last, '/');
- if (next != NULL)
- *next = '\0';
-
- nn = lht_tree_path_(conf_root[target], cwd, last, 1, 0, NULL);
- if (nn == NULL) {
- if (new_val == NULL) {
- free(path);
- return 0;
- }
- if (conf_root_lock[target]) {
- Message(PCB_MSG_DEFAULT, "WARNING: can't set config item %s because target in-memory lihata does not have the node and is tree-locked\n", path_);
- free(path);
- return -1;
- }
- /* create a new hash node */
- nn = lht_dom_node_alloc(LHT_HASH, last);
- if (lht_dom_hash_put(cwd, nn) != LHTE_SUCCESS) {
- lht_dom_node_free(nn);
- free(path);
- return -1;
- }
- }
- cwd = nn;
- if (next != NULL)
- last = next+1;
- } while(next != NULL);
-
- /* add the last part of the path, which is either a list or a text node */
- if ((nat->array_size > 1) || (nat->type == CFN_LIST))
- ty = LHT_LIST;
- else
- ty = LHT_TEXT;
-
- nn = lht_tree_path_(conf_root[target], cwd, basename, 1, 0, NULL);
- if (nn == NULL) {
- if (conf_root_lock[target]) {
- free(path);
- return -1;
- }
- nn = lht_dom_node_alloc(ty, basename);
- if (lht_dom_hash_put(cwd, nn) != LHTE_SUCCESS) {
- lht_dom_node_free(nn);
- free(path);
- return -1;
- }
- }
- cwd = nn;
-
- /* set value */
- if (ty == LHT_LIST) {
- lht_err_t err = 0;
-
- if (new_val != NULL)
- nn = lht_dom_node_alloc(LHT_TEXT, "");
-
- if (pol == POL_OVERWRITE) {
- if (idx == -1) {
- /* empty the list so that we insert to an empty list which is overwriting the list */
- while(cwd->data.list.first != NULL)
- lht_tree_del(cwd->data.list.first);
- if (new_val != NULL)
- lht_dom_list_append(cwd, nn);
- }
- else {
- lht_node_t *old = lht_tree_list_nth(cwd, idx);
- if (old != NULL) {
- /* the list is large enough already: overwrite the element at idx */
- if (new_val == NULL) {
- err = lht_tree_del(old);
- free(path);
- return 0;
- }
- else
- err = lht_tree_list_replace_child(cwd, old, nn);
- }
- else if (new_val == NULL) {
- free(path);
- return 0;
- }
- else {
- int n;
- lht_node_t *i;
- /* count members */
- for (n = 0, i = cwd->data.list.first; i != NULL; i = i->next) n++;
- /* append just enough elements to get one less than needed */
- err = 0;
- for(n = idx - n; n > 0; n--) {
- lht_node_t *dummy = lht_dom_node_alloc(LHT_TEXT, "");
- err |= lht_dom_list_append(cwd, dummy);
- }
- /* append the new node */
- err |= lht_dom_list_append(cwd, nn);
- }
- }
- }
- else if ((pol == POL_PREPEND) || (pol == POL_OVERWRITE))
- err = lht_dom_list_insert(cwd, nn);
- else if (pol == POL_APPEND)
- err = lht_dom_list_append(cwd, nn);
- if (err != LHTE_SUCCESS) {
- lht_dom_node_free(nn);
- free(path);
- return -1;
- }
- cwd = nn;
- }
- else {
- if (idx > 0) {
- free(path);
- return -1; /* only lists/array path should have index larger than 0 */
- }
- cwd = nn;
- }
-
- /* by now cwd is the text node we need to load with the new value; it is
- either a text config value under a hash or a list item already allocated */
- if (cwd->type != LHT_TEXT) {
- free(path);
- return -1;
- }
-
- if (new_val != NULL) {
- if (cwd->data.text.value != NULL)
- free(cwd->data.text.value);
-
- cwd->data.text.value = pcb_strdup(new_val);
- cwd->file_name = conf_root[target]->active_file;
- }
- else
- lht_tree_del(cwd);
-
- conf_lht_dirty[target]++;
-
- free(path);
- return 0;
-}
-
-int conf_set(conf_role_t target, const char *path, int arr_idx, const char *new_val, conf_policy_t pol)
-{
- int res;
- res = conf_set_dry(target, path, arr_idx, new_val, pol);
- if (res < 0)
- return res;
- conf_update(path);
- return 0;
-}
-
-int conf_del(conf_role_t target, const char *path, int arr_idx)
-{
- int res;
- res = conf_set_dry(target, path, arr_idx, NULL, POL_OVERWRITE);
- if (res < 0)
- return res;
- conf_update(path);
- return 0;
-}
-
-
-int conf_set_native(conf_native_t *field, int arr_idx, const char *new_val)
-{
- lht_node_t *node;
-
- if (arr_idx >= field->used)
- return -1;
-
- node = field->prop[arr_idx].src;
-
- if (node->data.text.value != NULL)
- free(node->data.text.value);
-
- node->data.text.value = pcb_strdup(new_val);
- return 0;
-}
-
-
-int conf_set_from_cli(const char *prefix, const char *arg_, const char *val, const char **why)
-{
- char *arg = NULL, *op, *s;
- const char *sc;
- conf_policy_t pol = POL_OVERWRITE;
- int ret;
-
- if (prefix != NULL) {
- for(sc = arg_; (*sc != '=') && (*sc != '\0'); sc++)
- if (*sc == '/')
- arg = pcb_strdup(arg_); /* full path, don't use prefix */
-
- if (arg == NULL) { /* insert prefix */
- int pl = strlen(prefix), al = strlen(arg_);
- while((pl > 0) && (prefix[pl-1] == '/')) pl--;
- arg = malloc(pl+al+2);
- memcpy(arg, prefix, pl);
- arg[pl] = '/';
- strcpy(arg+pl+1, arg_);
- }
- }
- else
- arg = pcb_strdup(arg_);
-
- /* replace any - with _ in the path part; cli accepts dash but the backing C
- struct field names don't */
- for(s = arg, op = NULL; (*s != '\0') && (op == NULL); s++) {
- if (*s == '=')
- op = s;
- else if (*s == '-')
- *s = '_';
- }
-
- /* extract val, if we need to */
- if (val == NULL) {
- *why = "";
- if (op == arg) {
- free(arg);
- *why = "value not specified; syntax is path=val";
- return -1;
- }
- if (op == NULL) {
- conf_native_t *n = conf_get_field(arg);
- if ((n == NULL) || (n->type != CFN_BOOLEAN)) {
- free(arg);
- *why = "value not specified for non-boolean variable; syntax is path=val";
- return -1;
- }
- val = "1"; /* auto-value for boolean */
- }
- else {
- *op = '\0';
- val = op+1;
- op--;
- switch(*op) {
- case '+': pol = POL_APPEND; *op = '\0'; break;
- case '^': pol = POL_PREPEND; *op = '\0'; break;
- }
- }
- }
-
- /* now that we have a clean path (arg) and a value, try to set the config */
- ret = conf_set(CFR_CLI, arg, -1, val, pol);
- if (ret != 0)
- *why = "invalid config path";
-
- free(arg);
- return ret;
-}
-
-void conf_parse_arguments(const char *prefix, int *argc, char ***argv)
-{
- int n, dst;
-
- for(n = 0, dst = 0; n < *argc; n++,dst++) {
- char *a = (*argv)[n];
- const char *why;
- int try_again = -1;
-
- if (a[0] == '-') a++;
- if (a[0] == '-') a++;
-
- try_again = conf_set_from_cli(prefix, a, NULL, &why);
- if (try_again && (n < (*argc) - 1)) {
- try_again = conf_set_from_cli(prefix, a, (*argv)[n+1], &why);
- if (!try_again)
- n++;
- }
- if (try_again)
- (*argv)[dst] = (*argv)[n];
- else
- dst--;
- }
- *argc = dst;
-}
-
-void conf_usage(const char *prefix, void (*print)(const char *name, const char *help))
-{
- htsp_entry_t *e;
- int pl = (prefix == NULL ? 0 : strlen(prefix));
-
- conf_fields_foreach(e) {
- if ((prefix == NULL) || (strncmp(prefix, e->key, pl) == 0)) {
- conf_native_t *n = e->value;
- if (n->flags & CFF_USAGE) {
- int kl = strlen(n->hash_path);
- char *s, *name = malloc(kl+32);
- const char *sc;
- for(sc = n->hash_path + pl; *sc == '/'; sc++) ;
- name[0] = '-';
- name[1] = '-';
- strcpy(name+2, sc);
- for(s = name; *s != '\0'; s++)
- if (*s == '_')
- *s = '-';
- switch(n->type) {
- case CFN_BOOLEAN: /* implicit true */ break;
- case CFN_STRING: strcpy(s, " str"); break;
- case CFN_INTEGER: strcpy(s, " int"); break;
- case CFN_REAL: strcpy(s, " num"); break;
- case CFN_COORD: strcpy(s, " coord"); break;
- case CFN_UNIT: strcpy(s, " unit"); break;
- case CFN_COLOR: strcpy(s, " color"); break;
- case CFN_LIST:
- case CFN_INCREMENTS:
- strcpy(s, " ???");
- break;
- }
- print(name, n->description);
- free(name);
- }
- }
- }
-}
-
-int conf_replace_subtree(conf_role_t dst_role, const char *dst_path, conf_role_t src_role, const char *src_path)
-{
- lht_node_t *dst = conf_lht_get_at(dst_role, dst_path, 1);
- lht_node_t *src, *new_src = NULL;
-
- if (src_role == CFR_binary) {
- char *name;
- lht_node_t *ch = NULL;
- int isarr, i;
- conf_native_t *n = conf_get_field(src_path);
-
- if (n == NULL)
- return -1;
- name = strrchr(n->hash_path, '/');
- if (name == NULL)
- return -1;
-
- isarr = n->array_size > 1;
- if (isarr)
- src = lht_dom_node_alloc(LHT_LIST, name+1);
-
- for(i = 0; i < n->array_size; i++) {
- gds_t s;
-
- gds_init(&s);
- if (n->type == CFN_LIST) {
- conf_listitem_t *it;
- ch = lht_dom_node_alloc(LHT_LIST, name+1);
- for(it = conflist_first(n->val.list); it != NULL; it = conflist_next(it)) {
- lht_node_t *txt;
- txt = lht_dom_node_alloc(LHT_TEXT, "");
- txt->data.text.value = pcb_strdup(it->payload);
- lht_dom_list_append(ch, txt);
- }
- }
- else {
- conf_print_native_field((conf_pfn)pcb_append_printf, &s, 0, &n->val, n->type, n->prop+i, i);
- ch = lht_dom_node_alloc(LHT_TEXT, isarr ? "" : name+1);
- ch->data.text.value = s.array;
- if (isarr)
- lht_dom_list_append(src, ch);
- s.array = NULL;
- gds_uninit(&s);
- }
- }
-
- if (!isarr)
- src = ch;
- }
- else
- src = conf_lht_get_at(src_role, src_path, 0);
-
- if ((src == NULL) && (dst != NULL)) {
- lht_tree_del(dst);
- return 0;
- }
-
- if (dst == NULL)
- goto err;
-
- new_src = lht_dom_duptree(src);
- if (new_src == NULL)
- goto err;
-
- if (lht_tree_replace(dst, new_src) != LHTE_SUCCESS)
- goto err;
-
- conf_lht_dirty[dst_role]++;
-
- lht_tree_del(dst);
- if (src_role == CFR_binary)
- lht_dom_node_free(src);
- return 0;
-
- err:;
- if (src_role == CFR_binary)
- lht_dom_node_free(src);
- if (new_src != NULL)
- lht_dom_node_free(new_src);
- return -1;
-}
-
-
-int conf_save_file(const char *project_fn, const char *pcb_fn, conf_role_t role, const char *fn)
-{
- int fail = 1;
- lht_node_t *r = conf_lht_get_first(role);
- const char *try;
- char *efn;
-
- /* do not save if there's no change */
- if (conf_lht_dirty[role] == 0)
- return 0;
-
- if (fn == NULL) {
- switch(role) {
- case CFR_USER:
- fn = conf_user_fn;
- break;
- case CFR_PROJECT:
- fn = conf_get_project_conf_name(project_fn, pcb_fn, &try);
- if (fn == NULL) {
- Message(PCB_MSG_DEFAULT, "Error: can not save config to project file: %s does not exist - please create an empty file there first\n", try);
- return -1;
- }
- break;
- default: return -1;
- }
- }
-
- resolve_path(fn, &efn, 0);
-
- if (r != NULL) {
- FILE *f;
- f = fopen(efn, "w");
-
- if ((f == NULL) && (role == CFR_USER)) {
- /* create the directory and try again */
- char *path = pcb_strdup(efn), *end;
- end = strrchr(path, '/');
- if (end != NULL) {
- *end = '\0';
- if (pcb_mkdir(path, 0755) == 0) {
- Message(PCB_MSG_DEFAULT, "Created directory %s for saving %s\n", path, fn);
- f = fopen(efn, "w");
- }
- else
- Message(PCB_MSG_DEFAULT, "Error: failed to create directory %s for saving %s\n", path, efn);
- }
- free(path);
- }
-
- if (f != NULL) {
-#warning CONF TODO: a project file needs to be loaded, merged, then written (to preserve non-config nodes)
- lht_dom_export(r->doc->root, f, "");
- fail = 0;
- conf_lht_dirty[role] = 0;
- fclose(f);
- }
- else
- Message(PCB_MSG_DEFAULT, "Error: can't save config to %s - can't open the file for write\n", fn);
- }
-
- free(efn);
- return fail;
-}
-
-int conf_export_to_file(const char *fn, conf_role_t role, const char *conf_path)
-{
- lht_node_t *at = conf_lht_get_at(role, conf_path, 0);
- lht_err_t r;
- FILE *f;
-
- if (at == NULL)
- return -1;
-
- f = fopen(fn, "w");
- if (f == NULL)
- return -1;
-
- r = lht_dom_export(at, f, "");
- fclose(f);
- return r;
-}
-
-
-conf_listitem_t *conf_list_first_str(conflist_t *list, const char **item_str, int *idx)
-{
- conf_listitem_t *item_li;
- item_li = conflist_first(list);
- if (item_li == NULL)
- return NULL;
- if (item_li->type == CFN_STRING) {
- *item_str = item_li->val.string[0];
- return item_li;
- }
- return conf_list_next_str(item_li, item_str, idx);
-}
-
-conf_listitem_t *conf_list_next_str(conf_listitem_t *item_li, const char **item_str, int *idx)
-{
- while((item_li = conflist_next(item_li)) != NULL) {
- if (item_li->type != CFN_STRING)
- continue;
- /* found next string */
- *item_str = item_li->val.string[0];
- return item_li;
- }
- /* found end of the list */
- *item_str = NULL;
- return item_li;
-}
-
-const char *conf_concat_strlist(const conflist_t *lst, gds_t *buff, int *inited, char sep)
-{
- int n;
- conf_listitem_t *ci;
-
- if ((inited == NULL) || (!*inited)) {
- gds_init(buff);
- if (inited != NULL)
- *inited = 1;
- }
- else
- gds_truncate(buff, 0);
-
- for (n = 0, ci = conflist_first((conflist_t *)lst); ci != NULL; ci = conflist_next(ci), n++) {
- const char *p = ci->val.string[0];
- if (ci->type != CFN_STRING)
- continue;
- if (n > 0)
- gds_append(buff, sep);
- gds_append_str(buff, p);
- }
- return buff->array;
-}
-
-void conf_lock(conf_role_t target)
-{
- conf_root_lock[target] = 1;
-}
-
-void conf_unlock(conf_role_t target)
-{
- conf_root_lock[target] = 0;
-}
-
-int conf_islocked(conf_role_t target)
-{
- return conf_root_lock[target];
-}
-
-int conf_isdirty(conf_role_t target)
-{
- return conf_lht_dirty[target];
-}
-
-void conf_makedirty(conf_role_t target)
-{
- conf_lht_dirty[target]++;
-}
-conf_role_t conf_lookup_role(const lht_node_t *nd)
-{
- conf_role_t r;
- for(r = 0; r < CFR_max_real; r++)
- if (conf_root[r] == nd->doc)
- return r;
-
- return CFR_invalid;
-}
-
-void conf_reset(conf_role_t target, const char *source_fn)
-{
- lht_node_t *n;
-
- if (conf_root[target] != NULL)
- lht_dom_uninit(conf_root[target]);
-
- conf_root[target] = lht_dom_init();
- lht_dom_loc_newfile(conf_root[target], source_fn);
- conf_root[target]->root = lht_dom_node_alloc(LHT_LIST, conf_list_name);
- conf_root[target]->root->doc = conf_root[target];
- n = lht_dom_node_alloc(LHT_HASH, "overwrite");
- lht_dom_list_insert(conf_root[target]->root, n);
-}
-
-/*****************/
-static int needs_braces(const char *s)
-{
- for(; *s != '\0'; s++)
- if (!isalnum(*s) && (*s != '_') && (*s != '-') && (*s != '+') && (*s != '/') && (*s != ':') && (*s != '.') && (*s != ',') && (*s != '$') && (*s != '(') && (*s != ')') && (*s != '~'))
- return 1;
- return 0;
-}
-
-#define print_str_or_null(pfn, ctx, verbose, chk, out) \
- do { \
- if (chk == NULL) { \
- if (verbose) \
- ret += pfn(ctx, "");\
- } \
- else {\
- if (needs_braces(out)) \
- ret += pfn(ctx, "{%s}", out); \
- else \
- ret += pfn(ctx, "%s", out); \
- } \
- } while(0)
-
-int conf_print_native_field(conf_pfn pfn, void *ctx, int verbose, confitem_t *val, conf_native_type_t type, confprop_t *prop, int idx)
-{
- int ret = 0;
- switch(type) {
- case CFN_STRING: print_str_or_null(pfn, ctx, verbose, val->string[idx], val->string[idx]); break;
- case CFN_BOOLEAN: ret += pfn(ctx, "%d", val->boolean[idx]); break;
- case CFN_INTEGER: ret += pfn(ctx, "%ld", val->integer[idx]); break;
- case CFN_REAL: ret += pfn(ctx, "%f", val->real[idx]); break;
- case CFN_COORD: ret += pfn(ctx, "%$mS", val->coord[idx]); break;
- case CFN_UNIT: print_str_or_null(pfn, ctx, verbose, val->unit[idx], val->unit[idx]->suffix); break;
- case CFN_COLOR: print_str_or_null(pfn, ctx, verbose, val->color[idx], val->color[idx]); break;
- case CFN_INCREMENTS:
- {
- Increments *i = &val->increments[idx];
- ret += pfn(ctx, "{ grid=%$mS/%$mS/%$mS size=%$mS/%$mS/%$mS line=%$mS/%$mS/%$mS clear=%$mS/%$mS/%$mS}",
- i->grid, i->grid_min, i->grid_max,
- i->size, i->size_min, i->size_max,
- i->line, i->line_min, i->line_max,
- i->clear, i->clear_min, i->clear_max);
- }
- break;
- case CFN_LIST:
- {
- conf_listitem_t *n;
- if (conflist_length(val->list) > 0) {
- ret += pfn(ctx, "{");
- for(n = conflist_first(val->list); n != NULL; n = conflist_next(n)) {
- conf_print_native_field(pfn, ctx, verbose, &n->val, n->type, &n->prop, 0);
- ret += pfn(ctx, ";");
- }
- ret += pfn(ctx, "}");
- }
- else {
- if (verbose)
- ret += pfn(ctx, "");
- else
- ret += pfn(ctx, "{}");
- }
- }
- break;
- }
- if (verbose) {
- ret += pfn(ctx, " <file_name, prop[idx].src->line);
- }
- ret += pfn(ctx, ">>");
- }
- return ret;
-}
-
-int conf_print_native(conf_pfn pfn, void *ctx, const char * prefix, int verbose, conf_native_t *node)
-{
- int ret = 0;
- if ((node->used <= 0) && (!verbose))
- return 0;
- if (node->array_size > 1) {
- int n;
- if (!verbose)
- ret += pfn(ctx, "{");
- for(n = 0; n < node->used; n++) {
- if (verbose)
- ret += pfn(ctx, "%s I %s[%d] = ", prefix, node->hash_path, n);
- ret += conf_print_native_field(pfn, ctx, verbose, &node->val, node->type, node->prop, n);
- if (verbose)
- ret += pfn(ctx, " conf_rev=%d\n", node->conf_rev);
- else
- ret += pfn(ctx, ";");
- }
- if (verbose) {
- if (node->used == 0)
- ret += pfn(ctx, "%s I %s[] = \n", prefix, node->hash_path);
- }
- else
- ret += pfn(ctx, "}");
- }
- else {
- if (verbose)
- ret += pfn(ctx, "%s I %s = ", prefix, node->hash_path);
- ret += conf_print_native_field(pfn, ctx, verbose, &node->val, node->type, node->prop, 0);
- if (verbose)
- ret += pfn(ctx, " conf_rev=%d\n", node->conf_rev);
- }
- return ret;
-}
-
-
-/****************/
-
-void conf_init(void)
-{
- conf_reset(CFR_ENV, "");
- conf_reset(CFR_CLI, "");
- conf_reset(CFR_DESIGN, "");
-
- conf_reset(CFR_file, "");
- conf_reset(CFR_binary, "");
-}
-
-void conf_uninit(void)
-{
- int n;
- htsp_entry_t *e;
-
- conf_hid_uninit();
-
- for(n = 0; n < CFR_max_alloc; n++)
- if (conf_root[n] != NULL)
- lht_dom_uninit(conf_root[n]);
-
- conf_fields_foreach(e) {
- conf_free_native(e->value);
- htsp_delentry(conf_fields, e);
- }
- htsp_free(conf_fields);
-
- vmst_uninit(&merge_subtree);
-}
-
-void conf_setf(conf_role_t role, const char *path, int idx, const char *fmt, ...)
-{
- char *tmp;
- va_list ap;
-
- va_start(ap, fmt);
- tmp = pcb_strdup_vprintf(fmt, ap);
- va_end(ap);
-
- conf_set(role, path, idx, tmp, POL_OVERWRITE);
-
- free(tmp);
-}
Index: 1.1.4/src/list_conf.h
===================================================================
--- 1.1.4/src/list_conf.h (revision 10776)
+++ 1.1.4/src/list_conf.h (nonexistent)
@@ -1,49 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef LIST_CONF_H
-#define LIST_CONF_H
-
-#include "conf.h"
-
-#include
-
-#ifdef FROM_CONF_C
-#define TDL_DONT_UNDEF
-#endif
-
-#define TDL(x) conflist_ ## x
-#define TDL_LIST_T conflist_t
-#define TDL_LIST_U conflist_u
-#define TDL_ITEM_T conf_listitem_t
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define conflist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-
-#include
-#include
-
-#endif
Index: 1.1.4/src/fptr_cast.c
===================================================================
--- 1.1.4/src/fptr_cast.c (revision 10776)
+++ 1.1.4/src/fptr_cast.c (nonexistent)
@@ -1,37 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include
-#include "fptr_cast.h"
-
-void *pcb_cast_f2d(pcb_fptr_t f)
-{
- assert(sizeof(void *) == sizeof(pcb_fptr_t));
- return (void *)f;
-}
-
-pcb_fptr_t pcb_cast_d2f(void *d)
-{
- assert(sizeof(void *) == sizeof(pcb_fptr_t));
- return (pcb_fptr_t)d;
-}
-
Index: 1.1.4/src/hid_flags.h
===================================================================
--- 1.1.4/src/hid_flags.h (revision 10776)
+++ 1.1.4/src/hid_flags.h (nonexistent)
@@ -1,18 +0,0 @@
-#ifndef PCB_HID_FLAGS_H
-#define PCB_HID_FLAGS_H
-
-/* Use this to temporarily enable all layers, so that they can be
- exported even if they're not currently visible. save_array must be
- MAX_LAYER+2 big. */
-void hid_save_and_show_layer_ons(int *save_array);
-/* Use this to restore them. */
-void hid_restore_layer_ons(int *save_array);
-
-
-/* Looks up an integer (usually boolean) value by conf path or by running
- an action (if name has a parenthesis). When an action is run, it has 0
- or 1 argument only and the return value of the action is returned.
- On error, returns -1. */
-int hid_get_flag(const char *name);
-
-#endif
Index: 1.1.4/src/list_pin.h
===================================================================
--- 1.1.4/src/list_pin.h (revision 10776)
+++ 1.1.4/src/list_pin.h (nonexistent)
@@ -1,41 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef LIST_PIN_H
-#define LIST_PIN_H
-
-/* List of Pins */
-#define TDL(x) pinlist_ ## x
-#define TDL_LIST_T pinlist_t
-#define TDL_ITEM_T PinType
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define pinlist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-
-#include
-#include
-
-#endif
Index: 1.1.4/src/conf.h
===================================================================
--- 1.1.4/src/conf.h (revision 10776)
+++ 1.1.4/src/conf.h (nonexistent)
@@ -1,358 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef PCB_CONF_H
-#define PCB_CONF_H
-#include "global.h"
-#include "global_typedefs.h"
-#include "pcb-printf.h"
-#include
-#include
-#include
-#include "unit.h"
-
-typedef union confitem_u confitem_t ;
-typedef struct conf_listitem_s conf_listitem_t;
-
-#include "list_conf.h"
-
-extern int conf_rev; /* increased by one each time there's a change in any of the config binaries */
-
-typedef enum {
- POL_PREPEND,
- POL_APPEND,
- POL_OVERWRITE,
- POL_DISABLE,
- POL_invalid
-} conf_policy_t;
-
-typedef enum { /* bitfield */
- CFF_USAGE = 1 /* settings should be printed in usage help */
-} conf_flag_t;
-
-
-typedef const char * CFT_STRING;
-typedef int CFT_BOOLEAN;
-typedef long CFT_INTEGER;
-typedef double CFT_REAL;
-typedef Coord CFT_COORD;
-typedef Unit * CFT_UNIT;
-typedef char * CFT_COLOR;
-typedef conflist_t CFT_LIST;
-typedef Increments CFT_INCREMENTS;
-
-typedef enum {
- CFN_STRING,
- CFN_BOOLEAN,
- CFN_INTEGER, /* signed long */
- CFN_REAL, /* double */
- CFN_COORD,
- CFN_UNIT,
- CFN_COLOR,
- CFN_LIST,
- CFN_INCREMENTS
-} conf_native_type_t;
-
-union confitem_u {
- const char **string;
- int *boolean;
- long *integer;
- double *real;
- Coord *coord;
- const Unit **unit;
- const char **color;
- conflist_t *list;
- Increments *increments;
- void *any;
-};
-
-typedef struct {
- int prio;
- lht_node_t *src;
-} confprop_t;
-
-typedef struct {
- /* static fields defined by the macros */
- const char *description;
- const char *hash_path; /* points to the hash key once its added in the hash (else: NULL) */
- int array_size;
- conf_native_type_t type;
- conf_flag_t flags;
- struct {
- unsigned io_pcb_no_attrib:1;
- unsigned read_only:1; /* set by conf_core, has no lihata, should not be overwritten */
- } random_flags; /* hack... persistent flags attached by various plugins */
-
- /* dynamic fields loaded from lihata */
- confitem_t val; /* value is always an array (len 1 for the common case) */
- confprop_t *prop; /* an array of properties allocated as big as val's array */
- int used; /* number of items actually used in the arrays */
- int conf_rev; /* last changed rev */
-
- /* dynamic fields for HIDs storing their data */
- vtp0_t hid_data;
- vtp0_t hid_callbacks; /* vector of (const conf_hid_callbacks_t *) */
-} conf_native_t;
-
-
-struct conf_listitem_s {
- conf_native_type_t type;
- confitem_t val; /* value is always an array (len 1 for the common case) */
- confprop_t prop; /* an array of properties allocated as big as val's array */
- const char *payload;
- gdl_elem_t link;
-};
-
-
-typedef enum {
- CFR_INTERNAL,
- CFR_SYSTEM,
- CFR_DEFAULTPCB, /* default.pcb */
- CFR_USER,
- CFR_ENV, /* env vars */
- CFR_PROJECT, /* project specific, from a local file */
- CFR_DESIGN, /* from the design file */
- CFR_CLI, /* from the command line */
- CFR_max_real, /* all the above are real files and should be merged */
- /* these ones are not real roles and are used in internal communication in the GUI HIDs */
- CFR_file, /* custom file */
- CFR_binary, /* the in-memory binary representation */
- CFR_max_alloc, /* all the above should have a root */
-
- CFR_invalid
-} conf_role_t;
-
-extern const int conf_default_prio[];
-
-void conf_init(void);
-void conf_uninit(void);
-
-/* Load all config files from disk into memory-lht and run conf_update to
- get the binary representation updated */
-void conf_load_all(const char *project_fn, const char *pcb_fn);
-
-/* Load a file or a string as a role */
-int conf_load_as(conf_role_t role, const char *fn, int fn_is_text);
-
-/* Load a project file into CFR_PROJECT. Both project_fn and pcb_fn can't be NULL.
- Leaves an initialized but empty CFR_PROJECT root if no project file was
- found. Runs conf_update(NULL); */
-void conf_load_project(const char *project_fn, const char *pcb_fn);
-
-/* Update the binary representation from the memory-lht representation */
-void conf_update(const char *path);
-
-conf_native_t *conf_get_field(const char *path);
-void conf_reg_field_(void *value, int array_size, conf_native_type_t type, const char *path, const char *desc, conf_flag_t flags);
-
-void conf_unreg_fields(const char *prefix);
-
-/* Set the value of path[arr_idx] in memory-lht role target to new_val using
- policy pol. Only lists should be indexed. Indexing can be a [n] suffix on
- path or a non-negative arr_idx. Updates the in-memory binary as well. If
- new_val is NULL, the selected subtree is removed from the lihata document. */
-int conf_set(conf_role_t target, const char *path, int arr_idx, const char *new_val, conf_policy_t pol);
-
-/* Remove the subtree of path[arr_idx] in memory-lht role target. Same
- considerations as in conf_set. */
-int conf_del(conf_role_t target, const char *path, int arr_idx);
-
-/* Same as conf_set, but without updating the binary - useful for multiple
- conf_set_dry calls and a single all-tree conf_udpate(NULL) for transactions. */
-int conf_set_dry(conf_role_t target, const char *path_, int arr_idx, const char *new_val, conf_policy_t pol);
-
-/* Same as conf_set, but doesn't look up where to set things: change the value of
- the lihata node backing the native field */
-int conf_set_native(conf_native_t *field, int arr_idx, const char *new_val);
-
-/* Process a command line argument arg_ (if val == NULL) or a pair of command line
- arguments arg_ and val. In the first case assume arg_ has both a config path
- and a value (may be implicit true for a boolean). In the second case val
- is always the value. If prefix is not NULL, the path is prefixed with it.
- On error always set *why to a const string reason.
- Returns 0 on success. */
-int conf_set_from_cli(const char *prefix, const char *arg_, const char *val, const char **why);
-
-/* Attempt to consume argv[] using conf_set_from_cli */
-void conf_parse_arguments(const char *prefix, int *argc, char ***argv);
-
-#define conf_reg_field_array(globvar, field, type_name, path, desc, flags) \
- conf_reg_field_((void *)&globvar.field, (sizeof(globvar.field) / sizeof(globvar.field[0])), type_name, path, desc, flags)
-
-#define conf_reg_field_scalar(globvar, field, type_name, path, desc, flags) \
- conf_reg_field_((void *)&globvar.field, 1, type_name, path, desc, flags)
-
-/* register a config field, array or scalar, selecting the right macro */
-#define conf_reg_field(globvar, field,isarray,type_name,cpath,cname, desc, flags) \
- conf_reg_field_ ## isarray(globvar, field,type_name,cpath "/" cname, desc, flags)
-
-/* convert a policy text to policy value - return POL_invalid on error */
-conf_policy_t conf_policy_parse(const char *s);
-
-/* Return the name of the policy - always a static string, even for invalid roles */
-const char *conf_policy_name(conf_policy_t p);
-
-/* convert a role text to role value - return CFR_invalid on error */
-conf_role_t conf_role_parse(const char *s);
-
-/* Return the name of the role - always a static string, even for invalid roles */
-const char *conf_role_name(conf_role_t r);
-
-/* Lock/unlock the structure of a role. In a locked role value of existing
- fields may be modified but the structure of the tree is static (can't
- create or remove nodes). This is useful when an io_ file format supports
- only a subset of settings: it can build the CFR_DESIGN tree, lock it so
- settings that it wouldn't know how to save won't appear. NOTE: io_pcb
- supports all settings via attributes so does not lock. */
-void conf_lock(conf_role_t target);
-void conf_unlock(conf_role_t target);
-
-
-/* replace dst_role:dst_path with a copy of src_role:src_path */
-int conf_replace_subtree(conf_role_t dst_role, const char *dst_path, conf_role_t src_role, const char *src_path);
-
-/* Throw out a subtree (remove all nodes from the lihata representation).
- Useful for io_ plugins, on CFR_DESIGN, before loading a new file. */
-void conf_reset(conf_role_t target, const char *source_fn);
-
-/* Save an in-memory lihata representation to the disk */
-int conf_save_file(const char *project_fn, const char *pcb_fn, conf_role_t role, const char *fn);
-
-/* Returns whether a given lihata tree is locked */
-int conf_islocked(conf_role_t target);
-
-/* Returns whether a given lihata tree has changed since load or last save */
-int conf_isdirty(conf_role_t target);
-void conf_makedirty(conf_role_t target);
-
-/* all configuration fields ever seen */
-extern htsp_t *conf_fields;
-
-/***** print fields from binary to lihata/text *****/
-
-typedef int (*conf_pfn)(void *ctx, const char *fmt, ...);
-
-/* Prints the value of a node in a form that is suitable for lihata. Prints
- a single element of an array, but prints lists as lists. Returns
- the sum of conf_pfn call return values - this is usually the number of
- bytes printed. */
-int conf_print_native_field(conf_pfn pfn, void *ctx, int verbose, confitem_t *val, conf_native_type_t type, confprop_t *prop, int idx);
-
-/* Prints the value of a node in a form that is suitable for lihata. Prints
- full arrays. Returns the sum of conf_pfn call return values - this is
- usually the number of bytes printed. */
-int conf_print_native(conf_pfn pfn, void *ctx, const char * prefix, int verbose, conf_native_t *node);
-
-
-/****** utility ******/
-
-void conf_setf(conf_role_t role, const char *path, int idx, const char *fmt, ...);
-
-#define conf_list_foreach_path_first(res, conf_list, call) \
-do { \
- conf_listitem_t *__n__; \
- const conflist_t *__lst1__ = (conf_list); \
- conflist_t *__lst__ = (conflist_t *)(__lst1__); \
- if (__lst__ != NULL) { \
- for(__n__ = conflist_first(__lst__); __n__ != NULL; __n__ = conflist_next(__n__)) { \
- char *__path__; \
- const char **__in__ = __n__->val.string; \
- if (__in__ == NULL) \
- continue; \
- resolve_path(*__in__, &__path__, 0); \
- res = call; \
- free(__path__); \
- if (res == 0) \
- break; \
- } \
- } \
-} while(0)
-
-/* printf("conf_list_foreach_path_first: %s using %s\n", # call, # conf_list); \*/
-
-/* htsp_entry_t *e; */
-#define conf_fields_foreach(e) \
- for (e = htsp_first(conf_fields); e; e = htsp_next(conf_fields, e))
-
-/* helpers to make the code shorter */
-#define conf_set_design(path, fmt, new_val) \
- conf_setf(CFR_DESIGN, path, -1, fmt, new_val)
-
-#define conf_set_editor(field, val) \
- conf_set(CFR_DESIGN, "editor/" #field, -1, val ? "1" : "0", POL_OVERWRITE)
-
-#define conf_toggle_editor(field) \
- conf_set_editor(field, !conf_core.editor.field)
-
-#define conf_toggle_editor_(sfield, field) \
- conf_set_editor(sfield, !conf_core.editor.field)
-
-/* For temporary modification/restoration of variables (hack) */
-#define conf_force_set_bool(var, val) *((CFT_BOOLEAN *)(&var)) = val
-#define conf_force_set_str(var, val) *((CFT_STRING *)(&var)) = val
-
-/* get the first config subtree node (it's a hash and its children
- are "design", "rc", ...) */
-lht_node_t *conf_lht_get_first(conf_role_t target);
-
-/* loop helper */
-conf_listitem_t *conf_list_first_str(conflist_t *list, const char **item_str, int *idx);
-conf_listitem_t *conf_list_next_str(conf_listitem_t *item_li, const char **item_str, int *idx);
-
-/*conf_listitem_t *item;*/
-#define conf_loop_list(list, item, idx) \
- for (idx = 0, item = conflist_first((conflist_t *)cl); item != NULL; item = conflist_next(item), idx++)
-
-/*conf_listitem_t *item; const char *item_str; */
-#define conf_loop_list_str(list, item_li, item_str, idx) \
- for (idx = 0, item_li = conf_list_first_str((conflist_t *)list, &item_str, &idx); \
- item_li != NULL;\
- item_li = conf_list_next_str(item_li, &item_str, &idx))
-
-const char *conf_concat_strlist(const conflist_t *lst, gds_t *buff, int *inited, char sep);
-
-/* Print usage help for all nodes that have the CFF_USAGE flag and whose
- path starts with prefix (if prefix != NULL) */
-void conf_usage(const char *prefix, void (*print)(const char *name, const char *help));
-
-/* Determine under which role a node is */
-conf_role_t conf_lookup_role(const lht_node_t *nd);
-
-/* Return the lihata node of a path in target, optionally creating it with the right type */
-lht_node_t *conf_lht_get_at(conf_role_t target, const char *path, int create);
-
-/* Write an existing conf subtree to a file */
-int conf_export_to_file(const char *fn, conf_role_t role, const char *conf_path);
-
-/* Determine the policy and priority of a config lihata node;
- returns 0 on success but may not fill in both values, caller is
- responsible for initializing them before the call. */
-int conf_get_policy_prio(lht_node_t *node, conf_policy_t *gpolicy, long *gprio);
-
-/* Parse text and convert the value into native form and store in one of dst
- fields depending on type */
-int conf_parse_text(confitem_t *dst, int idx, conf_native_type_t type, const char *text, lht_node_t *err_node);
-
-/* Determine the file name of the project file - project_fn and pcb_fn can be NULL */
-const char *conf_get_project_conf_name(const char *project_fn, const char *pcb_fn, const char **out_project_fn);
-
-#endif
Index: 1.1.4/src/fptr_cast.h
===================================================================
--- 1.1.4/src/fptr_cast.h (revision 10776)
+++ 1.1.4/src/fptr_cast.h (nonexistent)
@@ -1,34 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/* Function pointer <-> data pointer casts with assert on size match. C89
- does not permit these casts but they practically work on any platform
- pcb-rnd has the chance to run on. Hide the ugliness behind this API. */
-
-#ifndef PCB_FPTRCAST_H
-#define PCB_FPTRCAST_H
-typedef void (*pcb_fptr_t)();
-
-void *pcb_cast_f2d(pcb_fptr_t f);
-pcb_fptr_t pcb_cast_d2f(void *d);
-
-#endif
Index: 1.1.4/src/thermal.c
===================================================================
--- 1.1.4/src/thermal.c (revision 10776)
+++ 1.1.4/src/thermal.c (nonexistent)
@@ -1,438 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996,2004,2006 Thomas Nau
- *
- * this file, thermal.c was written by and is
- * (C) Copyright 2006, harry eaton
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau@rz.uni-ulm.de
- *
- */
-
-/* negative thermal finger polygons */
-
-#include "config.h"
-
-#include
-#include
-
-#include "misc.h"
-#include "polygon.h"
-#include "thermal.h"
-
-static PCBTypePtr pcb;
-
-struct cent {
- Coord x, y;
- Coord s, c;
- char style;
- POLYAREA *p;
-};
-
-static POLYAREA *diag_line(Coord X, Coord Y, Coord l, Coord w, pcb_bool rt)
-{
- PLINE *c;
- Vector v;
- Coord x1, x2, y1, y2;
-
- if (rt) {
- x1 = (l - w) * M_SQRT1_2;
- x2 = (l + w) * M_SQRT1_2;
- y1 = x1;
- y2 = x2;
- }
- else {
- x2 = -(l - w) * M_SQRT1_2;
- x1 = -(l + w) * M_SQRT1_2;
- y1 = -x1;
- y2 = -x2;
- }
-
- v[0] = X + x1;
- v[1] = Y + y2;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[0] = X - x2;
- v[1] = Y - y1;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = X - x1;
- v[1] = Y - y2;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = X + x2;
- v[1] = Y + y1;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- return ContourToPoly(c);
-}
-
-static POLYAREA *square_therm(PinTypePtr pin, pcb_cardinal_t style)
-{
- POLYAREA *p, *p2;
- PLINE *c;
- Vector v;
- Coord d, in, out;
-
- switch (style) {
- case 1:
- d = pcb->ThermScale * pin->Clearance * M_SQRT1_2;
- out = (pin->Thickness + pin->Clearance) / 2;
- in = pin->Thickness / 2;
- /* top (actually bottom since +y is down) */
- v[0] = pin->X - in + d;
- v[1] = pin->Y + in;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[0] = pin->X + in - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X + out - d;
- v[1] = pin->Y + out;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X - out + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- p = ContourToPoly(c);
- /* right */
- v[0] = pin->X + in;
- v[1] = pin->Y + in - d;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[1] = pin->Y - in + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X + out;
- v[1] = pin->Y - out + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[1] = pin->Y + out - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- p2 = ContourToPoly(c);
- p->f = p2;
- p2->b = p;
- /* left */
- v[0] = pin->X - in;
- v[1] = pin->Y - in + d;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[1] = pin->Y + in - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X - out;
- v[1] = pin->Y + out - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[1] = pin->Y - out + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- p2 = ContourToPoly(c);
- p->f->f = p2;
- p2->b = p->f;
- /* bottom (actually top since +y is down) */
- v[0] = pin->X + in - d;
- v[1] = pin->Y - in;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[0] = pin->X - in + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X - out + d;
- v[1] = pin->Y - out;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X + out - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- p2 = ContourToPoly(c);
- p->f->f->f = p2;
- p2->f = p;
- p2->b = p->f->f;
- p->b = p2;
- return p;
- case 4:
- {
- LineType l;
- l.Flags = NoFlags();
- d = pin->Thickness / 2 - pcb->ThermScale * pin->Clearance;
- out = pin->Thickness / 2 + pin->Clearance / 4;
- in = pin->Clearance / 2;
- /* top */
- l.Point1.X = pin->X - d;
- l.Point2.Y = l.Point1.Y = pin->Y + out;
- l.Point2.X = pin->X + d;
- p = LinePoly(&l, in);
- /* right */
- l.Point1.X = l.Point2.X = pin->X + out;
- l.Point1.Y = pin->Y - d;
- l.Point2.Y = pin->Y + d;
- p2 = LinePoly(&l, in);
- p->f = p2;
- p2->b = p;
- /* bottom */
- l.Point1.X = pin->X - d;
- l.Point2.Y = l.Point1.Y = pin->Y - out;
- l.Point2.X = pin->X + d;
- p2 = LinePoly(&l, in);
- p->f->f = p2;
- p2->b = p->f;
- /* left */
- l.Point1.X = l.Point2.X = pin->X - out;
- l.Point1.Y = pin->Y - d;
- l.Point2.Y = pin->Y + d;
- p2 = LinePoly(&l, in);
- p->f->f->f = p2;
- p2->b = p->f->f;
- p->b = p2;
- p2->f = p;
- return p;
- }
- default: /* style 2 and 5 */
- d = 0.5 * pcb->ThermScale * pin->Clearance;
- if (style == 5)
- d += d;
- out = (pin->Thickness + pin->Clearance) / 2;
- in = pin->Thickness / 2;
- /* topright */
- v[0] = pin->X + in;
- v[1] = pin->Y + in;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[1] = pin->Y + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 2) {
- v[0] = pin->X + out;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- }
- else
- frac_circle(c, v[0] + pin->Clearance / 4, v[1], v, 2);
- v[1] = pin->Y + in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- /* pivot 1/4 circle to next point */
- frac_circle(c, pin->X + in, pin->Y + in, v, 4);
- v[0] = pin->X + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 2) {
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[1] = pin->Y + in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- }
- else
- frac_circle(c, v[0], v[1] - pin->Clearance / 4, v, 2);
- p = ContourToPoly(c);
- /* bottom right */
- v[0] = pin->X + in;
- v[1] = pin->Y - d;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[1] = pin->Y - in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 2) {
- v[1] = pin->Y - out;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- }
- else
- frac_circle(c, v[0], v[1] - pin->Clearance / 4, v, 2);
- v[0] = pin->X + in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- /* pivot 1/4 circle to next point */
- frac_circle(c, pin->X + in, pin->Y - in, v, 4);
- v[1] = pin->Y - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 5)
- frac_circle(c, v[0] - pin->Clearance / 4, v[1], v, 2);
- p2 = ContourToPoly(c);
- p->f = p2;
- p2->b = p;
- /* bottom left */
- v[0] = pin->X - d;
- v[1] = pin->Y - in;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[0] = pin->X - in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[1] = pin->Y - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 2) {
- v[0] = pin->X - out;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- }
- else
- frac_circle(c, v[0] - pin->Clearance / 4, v[1], v, 2);
- v[1] = pin->Y - in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- /* pivot 1/4 circle to next point */
- frac_circle(c, pin->X - in, pin->Y - in, v, 4);
- v[0] = pin->X - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 5)
- frac_circle(c, v[0], v[1] + pin->Clearance / 4, v, 2);
- p2 = ContourToPoly(c);
- p->f->f = p2;
- p2->b = p->f;
- /* top left */
- v[0] = pin->X - d;
- v[1] = pin->Y + out;
- if ((c = poly_NewContour(v)) == NULL)
- return NULL;
- v[0] = pin->X - in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- /* pivot 1/4 circle to next point (x-out, y+in) */
- frac_circle(c, pin->X - in, pin->Y + in, v, 4);
- v[1] = pin->Y + d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 2) {
- v[0] = pin->X - in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- }
- else
- frac_circle(c, v[0] + pin->Clearance / 4, v[1], v, 2);
- v[1] = pin->Y + in;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- v[0] = pin->X - d;
- poly_InclVertex(c->head.prev, poly_CreateNode(v));
- if (style == 5)
- frac_circle(c, v[0], v[1] + pin->Clearance / 4, v, 2);
- p2 = ContourToPoly(c);
- p->f->f->f = p2;
- p2->f = p;
- p2->b = p->f->f;
- p->b = p2;
- return p;
- }
-}
-
-static POLYAREA *oct_therm(PinTypePtr pin, pcb_cardinal_t style)
-{
- POLYAREA *p, *p2, *m;
- Coord t = 0.5 * pcb->ThermScale * pin->Clearance;
- Coord w = pin->Thickness + pin->Clearance;
-
- p = OctagonPoly(pin->X, pin->Y, w, GET_SQUARE(pin));
- p2 = OctagonPoly(pin->X, pin->Y, pin->Thickness, GET_SQUARE(pin));
- /* make full clearance ring */
- poly_Boolean_free(p, p2, &m, PBO_SUB);
- switch (style) {
- default:
- case 1:
- p = diag_line(pin->X, pin->Y, w, t, pcb_true);
- poly_Boolean_free(m, p, &p2, PBO_SUB);
- p = diag_line(pin->X, pin->Y, w, t, pcb_false);
- poly_Boolean_free(p2, p, &m, PBO_SUB);
- return m;
- case 2:
- p = RectPoly(pin->X - t, pin->X + t, pin->Y - w, pin->Y + w);
- poly_Boolean_free(m, p, &p2, PBO_SUB);
- p = RectPoly(pin->X - w, pin->X + w, pin->Y - t, pin->Y + t);
- poly_Boolean_free(p2, p, &m, PBO_SUB);
- return m;
- /* fix me add thermal style 4 */
- case 5:
- {
- Coord t = pin->Thickness / 2;
- POLYAREA *q;
- /* cheat by using the square therm's rounded parts */
- p = square_therm(pin, style);
- q = RectPoly(pin->X - t, pin->X + t, pin->Y - t, pin->Y + t);
- poly_Boolean_free(p, q, &p2, PBO_UNITE);
- poly_Boolean_free(m, p2, &p, PBO_ISECT);
- return p;
- }
- }
-}
-
-/* ThermPoly returns a POLYAREA having all of the clearance that when
- * subtracted from the plane create the desired thermal fingers.
- * Usually this is 4 disjoint regions.
- *
- */
-POLYAREA *ThermPoly(PCBTypePtr p, PinTypePtr pin, pcb_cardinal_t laynum)
-{
- ArcType a;
- POLYAREA *pa, *arc;
- pcb_cardinal_t style = GET_THERM(laynum, pin);
-
- if (style == 3)
- return NULL; /* solid connection no clearance */
- pcb = p;
- if (TEST_FLAG(PCB_FLAG_SQUARE, pin))
- return square_therm(pin, style);
- if (TEST_FLAG(PCB_FLAG_OCTAGON, pin))
- return oct_therm(pin, style);
- /* must be circular */
- switch (style) {
- case 1:
- case 2:
- {
- POLYAREA *m;
- Coord t = (pin->Thickness + pin->Clearance) / 2;
- Coord w = 0.5 * pcb->ThermScale * pin->Clearance;
- pa = CirclePoly(pin->X, pin->Y, t);
- arc = CirclePoly(pin->X, pin->Y, pin->Thickness / 2);
- /* create a thin ring */
- poly_Boolean_free(pa, arc, &m, PBO_SUB);
- /* fix me needs error checking */
- if (style == 2) {
- /* t is the theoretically required length, but we use twice that
- * to avoid descritisation errors in our circle approximation.
- */
- pa = RectPoly(pin->X - t * 2, pin->X + t * 2, pin->Y - w, pin->Y + w);
- poly_Boolean_free(m, pa, &arc, PBO_SUB);
- pa = RectPoly(pin->X - w, pin->X + w, pin->Y - t * 2, pin->Y + t * 2);
- }
- else {
- /* t is the theoretically required length, but we use twice that
- * to avoid descritisation errors in our circle approximation.
- */
- pa = diag_line(pin->X, pin->Y, t * 2, w, pcb_true);
- poly_Boolean_free(m, pa, &arc, PBO_SUB);
- pa = diag_line(pin->X, pin->Y, t * 2, w, pcb_false);
- }
- poly_Boolean_free(arc, pa, &m, PBO_SUB);
- return m;
- }
-
-
- default:
- a.X = pin->X;
- a.Y = pin->Y;
- a.Height = a.Width = pin->Thickness / 2 + pin->Clearance / 4;
- a.Thickness = 1;
- a.Clearance = pin->Clearance / 2;
- a.Flags = NoFlags();
- a.Delta = 90 - (a.Clearance * (1. + 2. * pcb->ThermScale) * 180) / (M_PI * a.Width);
- a.StartAngle = 90 - a.Delta / 2 + (style == 4 ? 0 : 45);
- pa = ArcPoly(&a, a.Clearance);
- if (!pa)
- return NULL;
- a.StartAngle += 90;
- arc = ArcPoly(&a, a.Clearance);
- if (!arc)
- return NULL;
- pa->f = arc;
- arc->b = pa;
- a.StartAngle += 90;
- arc = ArcPoly(&a, a.Clearance);
- if (!arc)
- return NULL;
- pa->f->f = arc;
- arc->b = pa->f;
- a.StartAngle += 90;
- arc = ArcPoly(&a, a.Clearance);
- if (!arc)
- return NULL;
- pa->b = arc;
- pa->f->f->f = arc;
- arc->b = pa->f->f;
- arc->f = pa;
- pa->b = arc;
- return pa;
- }
-}
Index: 1.1.4/src/list_arc.c
===================================================================
--- 1.1.4/src/list_arc.c (revision 10776)
+++ 1.1.4/src/list_arc.c (nonexistent)
@@ -1,26 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#define TDL_DONT_UNDEF
-#include "global_objs.h"
-#include "list_arc.h"
-#include
Index: 1.1.4/src/thermal.h
===================================================================
--- 1.1.4/src/thermal.h (revision 10776)
+++ 1.1.4/src/thermal.h (nonexistent)
@@ -1,45 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996,2006 Thomas Nau
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau@rz.uni-ulm.de
- *
- */
-
-/* prototypes for thermal routines
- *
- * Thermals are normal lines on the layout. The only thing unique
- * about them is that they have the PCB_FLAG_USETHERMAL set so that they
- * can be identified as thermals. It is handy for pcb to automatically
- * make adjustments to the thermals when the user performs certain
- * operations, and the functions in thermal.h help implement that.
- */
-
-#ifndef PCB_THERMAL_H
-#define PCB_THERMAL_H
-
-#include
-#include "global.h"
-#include "mymem.h"
-
-POLYAREA *ThermPoly(PCBTypePtr, PinTypePtr, pcb_cardinal_t);
-
-#endif
Index: 1.1.4/src/list_arc.h
===================================================================
--- 1.1.4/src/list_arc.h (revision 10776)
+++ 1.1.4/src/list_arc.h (nonexistent)
@@ -1,41 +0,0 @@
-/*
- * COPYRIGHT
- *
- * pcb-rnd, interactive printed circuit board design
- * Copyright (C) 2016 Tibor 'Igor2' Palinkas
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef LIST_ARC_H
-#define LIST_ARC_H
-
-/* List of Arcs */
-#define TDL(x) arclist_ ## x
-#define TDL_LIST_T arclist_t
-#define TDL_ITEM_T ArcType
-#define TDL_FIELD link
-#define TDL_SIZE_T size_t
-#define TDL_FUNC
-
-#define arclist_foreach(list, iterator, loop_elem) \
- gdl_foreach_((&((list)->lst)), (iterator), (loop_elem))
-
-
-#include
-#include
-
-#endif
Index: 1.1.4/src/move.c
===================================================================
--- 1.1.4/src/move.c (revision 10776)
+++ 1.1.4/src/move.c (nonexistent)
@@ -1,1051 +0,0 @@
-/*
- * COPYRIGHT
- *
- * PCB, interactive printed circuit board design
- * Copyright (C) 1994,1995,1996 Thomas Nau
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Contact addresses for paper mail and Email:
- * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
- * Thomas.Nau@rz.uni-ulm.de
- *
- */
-
-
-/* functions used to move pins, elements ...
- */
-
-#include "config.h"
-#include "conf_core.h"
-
-#include
-#include
-
-#include "create.h"
-#include "data.h"
-#include "draw.h"
-#include "error.h"
-#include "misc.h"
-#include "move.h"
-#include "polygon.h"
-#include "rtree.h"
-#include "search.h"
-#include "select.h"
-#include "undo.h"
-#include "hid_actions.h"
-#include "compat_misc.h"
-#include "layer.h"
-
-/* ---------------------------------------------------------------------------
- * some local prototypes
- */
-static void *MoveElementName(ElementTypePtr);
-static void *MoveElement(ElementTypePtr);
-static void *MoveVia(PinTypePtr);
-static void *MoveLine(LayerTypePtr, LineTypePtr);
-static void *MoveArc(LayerTypePtr, ArcTypePtr);
-static void *MoveText(LayerTypePtr, TextTypePtr);
-static void *MovePolygon(LayerTypePtr, PolygonTypePtr);
-static void *MoveLinePoint(LayerTypePtr, LineTypePtr, PointTypePtr);
-static void *MovePolygonPoint(LayerTypePtr, PolygonTypePtr, PointTypePtr);
-static void *MoveLineToLayer(LayerTypePtr, LineTypePtr);
-static void *MoveArcToLayer(LayerTypePtr, ArcTypePtr);
-static void *MoveRatToLayer(RatTypePtr);
-static void *MoveTextToLayer(LayerTypePtr, TextTypePtr);
-static void *MovePolygonToLayer(LayerTypePtr, PolygonTypePtr);
-
-/* ---------------------------------------------------------------------------
- * some local identifiers
- */
-static Coord DeltaX, DeltaY; /* used by local routines as offset */
-static LayerTypePtr Dest;
-static pcb_bool MoreToCome;
-static ObjectFunctionType MoveFunctions = {
- MoveLine,
- MoveText,
- MovePolygon,
- MoveVia,
- MoveElement,
- MoveElementName,
- NULL,
- NULL,
- MoveLinePoint,
- MovePolygonPoint,
- MoveArc,
- NULL
-}, MoveToLayerFunctions = {
-MoveLineToLayer, MoveTextToLayer, MovePolygonToLayer, NULL, NULL, NULL, NULL, NULL, NULL, NULL, MoveArcToLayer, MoveRatToLayer};
-
-/* ---------------------------------------------------------------------------
- * moves a element by +-X and +-Y
- */
-void MoveElementLowLevel(DataTypePtr Data, ElementTypePtr Element, Coord DX, Coord DY)
-{
- if (Data)
- r_delete_entry(Data->element_tree, (BoxType *) Element);
- ELEMENTLINE_LOOP(Element);
- {
- MOVE_LINE_LOWLEVEL(line, DX, DY);
- }
- END_LOOP;
- PIN_LOOP(Element);
- {
- if (Data) {
- r_delete_entry(Data->pin_tree, (BoxType *) pin);
- RestoreToPolygon(Data, PCB_TYPE_PIN, Element, pin);
- }
- MOVE_PIN_LOWLEVEL(pin, DX, DY);
- if (Data) {
- r_insert_entry(Data->pin_tree, (BoxType *) pin, 0);
- ClearFromPolygon(Data, PCB_TYPE_PIN, Element, pin);
- }
- }
- END_LOOP;
- PAD_LOOP(Element);
- {
- if (Data) {
- r_delete_entry(Data->pad_tree, (BoxType *) pad);
- RestoreToPolygon(Data, PCB_TYPE_PAD, Element, pad);
- }
- MOVE_PAD_LOWLEVEL(pad, DX, DY);
- if (Data) {
- r_insert_entry(Data->pad_tree, (BoxType *) pad, 0);
- ClearFromPolygon(Data, PCB_TYPE_PAD, Element, pad);
- }
- }
- END_LOOP;
- ARC_LOOP(Element);
- {
- MOVE_ARC_LOWLEVEL(arc, DX, DY);
- }
- END_LOOP;
- ELEMENTTEXT_LOOP(Element);
- {
- if (Data && Data->name_tree[n])
- r_delete_entry(PCB->Data->name_tree[n], (BoxType *) text);
- MOVE_TEXT_LOWLEVEL(text, DX, DY);
- if (Data && Data->name_tree[n])
- r_insert_entry(PCB->Data->name_tree[n], (BoxType *) text, 0);
- }
- END_LOOP;
- MOVE_BOX_LOWLEVEL(&Element->BoundingBox, DX, DY);
- MOVE_BOX_LOWLEVEL(&Element->VBox, DX, DY);
- MOVE(Element->MarkX, Element->MarkY, DX, DY);
- if (Data)
- r_insert_entry(Data->element_tree, (BoxType *) Element, 0);
-}
-
-/* ----------------------------------------------------------------------
- * moves all names of an element to a new position
- */
-static void *MoveElementName(ElementTypePtr Element)
-{
- if (PCB->ElementOn && (FRONT(Element) || PCB->InvisibleObjectsOn)) {
- EraseElementName(Element);
- ELEMENTTEXT_LOOP(Element);
- {
- if (PCB->Data->name_tree[n])
- r_delete_entry(PCB->Data->name_tree[n], (BoxType *) text);
- MOVE_TEXT_LOWLEVEL(text, DeltaX, DeltaY);
- if (PCB->Data->name_tree[n])
- r_insert_entry(PCB->Data->name_tree[n], (BoxType *) text, 0);
- }
- END_LOOP;
- DrawElementName(Element);
- Draw();
- }
- else {
- ELEMENTTEXT_LOOP(Element);
- {
- if (PCB->Data->name_tree[n])
- r_delete_entry(PCB->Data->name_tree[n], (BoxType *) text);
- MOVE_TEXT_LOWLEVEL(text, DeltaX, DeltaY);
- if (PCB->Data->name_tree[n])
- r_insert_entry(PCB->Data->name_tree[n], (BoxType *) text, 0);
- }
- END_LOOP;
- }
- return (Element);
-}
-
-/* ---------------------------------------------------------------------------
- * moves an element
- */
-static void *MoveElement(ElementTypePtr Element)
-{
- pcb_bool didDraw = pcb_false;
-
- if (PCB->ElementOn && (FRONT(Element) || PCB->InvisibleObjectsOn)) {
- EraseElement(Element);
- MoveElementLowLevel(PCB->Data, Element, DeltaX, DeltaY);
- DrawElementName(Element);
- DrawElementPackage(Element);
- didDraw = pcb_true;
- }
- else {
- if (PCB->PinOn)
- EraseElementPinsAndPads(Element);
- MoveElementLowLevel(PCB->Data, Element, DeltaX, DeltaY);
- }
- if (PCB->PinOn) {
- DrawElementPinsAndPads(Element);
- didDraw = pcb_true;
- }
- if (didDraw)
- Draw();
- return (Element);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a via
- */
-static void *MoveVia(PinTypePtr Via)
-{
- r_delete_entry(PCB->Data->via_tree, (BoxType *) Via);
- RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- MOVE_VIA_LOWLEVEL(Via, DeltaX, DeltaY);
- if (PCB->ViaOn)
- EraseVia(Via);
- r_insert_entry(PCB->Data->via_tree, (BoxType *) Via, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via);
- if (PCB->ViaOn) {
- DrawVia(Via);
- Draw();
- }
- return (Via);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a line
- */
-static void *MoveLine(LayerTypePtr Layer, LineTypePtr Line)
-{
- if (Layer->On)
- EraseLine(Line);
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- r_delete_entry(Layer->line_tree, (BoxType *) Line);
- MOVE_LINE_LOWLEVEL(Line, DeltaX, DeltaY);
- r_insert_entry(Layer->line_tree, (BoxType *) Line, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- if (Layer->On) {
- DrawLine(Layer, Line);
- Draw();
- }
- return (Line);
-}
-
-/* ---------------------------------------------------------------------------
- * moves an arc
- */
-static void *MoveArc(LayerTypePtr Layer, ArcTypePtr Arc)
-{
- RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- r_delete_entry(Layer->arc_tree, (BoxType *) Arc);
- if (Layer->On) {
- EraseArc(Arc);
- MOVE_ARC_LOWLEVEL(Arc, DeltaX, DeltaY);
- DrawArc(Layer, Arc);
- Draw();
- }
- else {
- MOVE_ARC_LOWLEVEL(Arc, DeltaX, DeltaY);
- }
- r_insert_entry(Layer->arc_tree, (BoxType *) Arc, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- return (Arc);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a text object
- */
-static void *MoveText(LayerTypePtr Layer, TextTypePtr Text)
-{
- RestoreToPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- r_delete_entry(Layer->text_tree, (BoxType *) Text);
- if (Layer->On) {
- EraseText(Layer, Text);
- MOVE_TEXT_LOWLEVEL(Text, DeltaX, DeltaY);
- DrawText(Layer, Text);
- Draw();
- }
- else
- MOVE_TEXT_LOWLEVEL(Text, DeltaX, DeltaY);
- r_insert_entry(Layer->text_tree, (BoxType *) Text, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text);
- return (Text);
-}
-
-/* ---------------------------------------------------------------------------
- * low level routine to move a polygon
- */
-void MovePolygonLowLevel(PolygonTypePtr Polygon, Coord DeltaX, Coord DeltaY)
-{
- POLYGONPOINT_LOOP(Polygon);
- {
- MOVE(point->X, point->Y, DeltaX, DeltaY);
- }
- END_LOOP;
- MOVE_BOX_LOWLEVEL(&Polygon->BoundingBox, DeltaX, DeltaY);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a polygon
- */
-static void *MovePolygon(LayerTypePtr Layer, PolygonTypePtr Polygon)
-{
- if (Layer->On) {
- ErasePolygon(Polygon);
- }
- r_delete_entry(Layer->polygon_tree, (BoxType *) Polygon);
- MovePolygonLowLevel(Polygon, DeltaX, DeltaY);
- r_insert_entry(Layer->polygon_tree, (BoxType *) Polygon, 0);
- InitClip(PCB->Data, Layer, Polygon);
- if (Layer->On) {
- DrawPolygon(Layer, Polygon);
- Draw();
- }
- return (Polygon);
-}
-
-/* ---------------------------------------------------------------------------
- * moves one end of a line
- */
-static void *MoveLinePoint(LayerTypePtr Layer, LineTypePtr Line, PointTypePtr Point)
-{
- if (Layer) {
- if (Layer->On)
- EraseLine(Line);
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- r_delete_entry(Layer->line_tree, &Line->BoundingBox);
- MOVE(Point->X, Point->Y, DeltaX, DeltaY);
- SetLineBoundingBox(Line);
- r_insert_entry(Layer->line_tree, &Line->BoundingBox, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- if (Layer->On) {
- DrawLine(Layer, Line);
- Draw();
- }
- return (Line);
- }
- else { /* must be a rat */
-
- if (PCB->RatOn)
- EraseRat((RatTypePtr) Line);
- r_delete_entry(PCB->Data->rat_tree, &Line->BoundingBox);
- MOVE(Point->X, Point->Y, DeltaX, DeltaY);
- SetLineBoundingBox(Line);
- r_insert_entry(PCB->Data->rat_tree, &Line->BoundingBox, 0);
- if (PCB->RatOn) {
- DrawRat((RatTypePtr) Line);
- Draw();
- }
- return (Line);
- }
-}
-
-/* ---------------------------------------------------------------------------
- * moves a polygon-point
- */
-static void *MovePolygonPoint(LayerTypePtr Layer, PolygonTypePtr Polygon, PointTypePtr Point)
-{
- if (Layer->On) {
- ErasePolygon(Polygon);
- }
- r_delete_entry(Layer->polygon_tree, (BoxType *) Polygon);
- MOVE(Point->X, Point->Y, DeltaX, DeltaY);
- SetPolygonBoundingBox(Polygon);
- r_insert_entry(Layer->polygon_tree, (BoxType *) Polygon, 0);
- RemoveExcessPolygonPoints(Layer, Polygon);
- InitClip(PCB->Data, Layer, Polygon);
- if (Layer->On) {
- DrawPolygon(Layer, Polygon);
- Draw();
- }
- return (Point);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a line between layers; lowlevel routines
- */
-static void *MoveLineToLayerLowLevel(LayerType * Source, LineType * line, LayerType * Destination)
-{
- r_delete_entry(Source->line_tree, (BoxType *) line);
-
- linelist_remove(line);
- linelist_append(&(Destination->Line), line);
-
- if (!Destination->line_tree)
- Destination->line_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Destination->line_tree, (BoxType *) line, 0);
- return line;
-}
-
-/* ---------------------------------------------------------------------------
- * moves an arc between layers; lowlevel routines
- */
-static void *MoveArcToLayerLowLevel(LayerType * Source, ArcType * arc, LayerType * Destination)
-{
- r_delete_entry(Source->arc_tree, (BoxType *) arc);
-
- arclist_remove(arc);
- arclist_append(&Destination->Arc, arc);
-
- if (!Destination->arc_tree)
- Destination->arc_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Destination->arc_tree, (BoxType *) arc, 0);
- return arc;
-}
-
-
-/* ---------------------------------------------------------------------------
- * moves an arc between layers
- */
-static void *MoveArcToLayer(LayerType * Layer, ArcType * Arc)
-{
- ArcTypePtr newone;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Arc)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
- return NULL;
- }
- if (Dest == Layer && Layer->On) {
- DrawArc(Layer, Arc);
- Draw();
- }
- if (((long int) Dest == -1) || Dest == Layer)
- return (Arc);
- AddObjectToMoveToLayerUndoList(PCB_TYPE_ARC, Layer, Arc, Arc);
- RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc);
- if (Layer->On)
- EraseArc(Arc);
- newone = (ArcTypePtr) MoveArcToLayerLowLevel(Layer, Arc, Dest);
- ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Dest, Arc);
- if (Dest->On)
- DrawArc(Dest, newone);
- Draw();
- return (newone);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a line between layers
- */
-static void *MoveRatToLayer(RatType * Rat)
-{
- LineTypePtr newone;
- /*Coord X1 = Rat->Point1.X, Y1 = Rat->Point1.Y;
- Coord X1 = Rat->Point1.X, Y1 = Rat->Point1.Y;
- if PCB_FLAG_VIA
- if we're on a pin, add a thermal
- else make a via and a wire, but 0-length wire not good
- else as before */
-
- newone = CreateNewLineOnLayer(Dest, Rat->Point1.X, Rat->Point1.Y,
- Rat->Point2.X, Rat->Point2.Y, conf_core.design.line_thickness, 2 * conf_core.design.clearance, Rat->Flags);
- if (conf_core.editor.clear_line)
- conf_set_editor(clear_line, 1);
- if (!newone)
- return (NULL);
- AddObjectToCreateUndoList(PCB_TYPE_LINE, Dest, newone, newone);
- if (PCB->RatOn)
- EraseRat(Rat);
- MoveObjectToRemoveUndoList(PCB_TYPE_RATLINE, Rat, Rat, Rat);
- DrawLine(Dest, newone);
- Draw();
- return (newone);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a line between layers
- */
-
-struct via_info {
- Coord X, Y;
- jmp_buf env;
-};
-
-static r_dir_t moveline_callback(const BoxType * b, void *cl)
-{
- struct via_info *i = (struct via_info *) cl;
- PinTypePtr via;
-
- if ((via =
- CreateNewVia(PCB->Data, i->X, i->Y,
- conf_core.design.via_thickness, 2 * conf_core.design.clearance, PCB_FLAG_NO, conf_core.design.via_drilling_hole, NULL, NoFlags())) != NULL) {
- AddObjectToCreateUndoList(PCB_TYPE_VIA, via, via, via);
- DrawVia(via);
- }
- longjmp(i->env, 1);
-}
-
-static void *MoveLineToLayer(LayerType * Layer, LineType * Line)
-{
- struct via_info info;
- BoxType sb;
- LineTypePtr newone;
- void *ptr1, *ptr2, *ptr3;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Line)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
- return NULL;
- }
- if (Dest == Layer && Layer->On) {
- DrawLine(Layer, Line);
- Draw();
- }
- if (((long int) Dest == -1) || Dest == Layer)
- return (Line);
-
- AddObjectToMoveToLayerUndoList(PCB_TYPE_LINE, Layer, Line, Line);
- if (Layer->On)
- EraseLine(Line);
- RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line);
- newone = (LineTypePtr) MoveLineToLayerLowLevel(Layer, Line, Dest);
- Line = NULL;
- ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Dest, newone);
- if (Dest->On)
- DrawLine(Dest, newone);
- Draw();
- if (!PCB->ViaOn || MoreToCome ||
- GetLayerGroupNumberByPointer(Layer) ==
- GetLayerGroupNumberByPointer(Dest) || TEST_SILK_LAYER(Layer) || TEST_SILK_LAYER(Dest))
- return (newone);
- /* consider via at Point1 */
- sb.X1 = newone->Point1.X - newone->Thickness / 2;
- sb.X2 = newone->Point1.X + newone->Thickness / 2;
- sb.Y1 = newone->Point1.Y - newone->Thickness / 2;
- sb.Y2 = newone->Point1.Y + newone->Thickness / 2;
- if ((SearchObjectByLocation(PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3,
- newone->Point1.X, newone->Point1.Y, conf_core.design.via_thickness / 2) == PCB_TYPE_NONE)) {
- info.X = newone->Point1.X;
- info.Y = newone->Point1.Y;
- if (setjmp(info.env) == 0)
- r_search(Layer->line_tree, &sb, NULL, moveline_callback, &info, NULL);
- }
- /* consider via at Point2 */
- sb.X1 = newone->Point2.X - newone->Thickness / 2;
- sb.X2 = newone->Point2.X + newone->Thickness / 2;
- sb.Y1 = newone->Point2.Y - newone->Thickness / 2;
- sb.Y2 = newone->Point2.Y + newone->Thickness / 2;
- if ((SearchObjectByLocation(PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3,
- newone->Point2.X, newone->Point2.Y, conf_core.design.via_thickness / 2) == PCB_TYPE_NONE)) {
- info.X = newone->Point2.X;
- info.Y = newone->Point2.Y;
- if (setjmp(info.env) == 0)
- r_search(Layer->line_tree, &sb, NULL, moveline_callback, &info, NULL);
- }
- Draw();
- return (newone);
-}
-
-/* ---------------------------------------------------------------------------
- * moves a text object between layers; lowlevel routines
- */
-static void *MoveTextToLayerLowLevel(LayerType * Source, TextType * text, LayerType * Destination)
-{
- RestoreToPolygon(PCB->Data, PCB_TYPE_TEXT, Source, text);
- r_delete_entry(Source->text_tree, (BoxType *) text);
-
- textlist_remove(text);
- textlist_append(&Destination->Text, text);
-
- if (GetLayerGroupNumberByNumber(solder_silk_layer) == GetLayerGroupNumberByPointer(Destination))
- SET_FLAG(PCB_FLAG_ONSOLDER, text);
- else
- CLEAR_FLAG(PCB_FLAG_ONSOLDER, text);
-
- /* re-calculate the bounding box (it could be mirrored now) */
- SetTextBoundingBox(&PCB->Font, text);
- if (!Destination->text_tree)
- Destination->text_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Destination->text_tree, (BoxType *) text, 0);
- ClearFromPolygon(PCB->Data, PCB_TYPE_TEXT, Destination, text);
-
- return text;
-}
-
-/* ---------------------------------------------------------------------------
- * moves a text object between layers
- */
-static void *MoveTextToLayer(LayerType * layer, TextType * text)
-{
- if (TEST_FLAG(PCB_FLAG_LOCK, text)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
- return NULL;
- }
- if (Dest != layer) {
- AddObjectToMoveToLayerUndoList(PCB_TYPE_TEXT, layer, text, text);
- if (layer->On)
- EraseText(layer, text);
- text = MoveTextToLayerLowLevel(layer, text, Dest);
- if (Dest->On)
- DrawText(Dest, text);
- if (layer->On || Dest->On)
- Draw();
- }
- return text;
-}
-
-/* ---------------------------------------------------------------------------
- * moves a polygon between layers; lowlevel routines
- */
-static void *MovePolygonToLayerLowLevel(LayerType * Source, PolygonType * polygon, LayerType * Destination)
-{
- r_delete_entry(Source->polygon_tree, (BoxType *) polygon);
-
- polylist_remove(polygon);
- polylist_append(&Destination->Polygon, polygon);
-
- if (!Destination->polygon_tree)
- Destination->polygon_tree = r_create_tree(NULL, 0, 0);
- r_insert_entry(Destination->polygon_tree, (BoxType *) polygon, 0);
-
- return polygon;
-}
-
-struct mptlc {
- pcb_cardinal_t snum, dnum;
- int type;
- PolygonTypePtr polygon;
-} mptlc;
-
-r_dir_t mptl_pin_callback(const BoxType * b, void *cl)
-{
- struct mptlc *d = (struct mptlc *) cl;
- PinTypePtr pin = (PinTypePtr) b;
- if (!TEST_THERM(d->snum, pin) || !IsPointInPolygon(pin->X, pin->Y, pin->Thickness + pin->Clearance + 2, d->polygon))
- return R_DIR_NOT_FOUND;
- if (d->type == PCB_TYPE_PIN)
- AddObjectToFlagUndoList(PCB_TYPE_PIN, pin->Element, pin, pin);
- else
- AddObjectToFlagUndoList(PCB_TYPE_VIA, pin, pin, pin);
- ASSIGN_THERM(d->dnum, GET_THERM(d->snum, pin), pin);
- CLEAR_THERM(d->snum, pin);
- return R_DIR_FOUND_CONTINUE;
-}
-
-/* ---------------------------------------------------------------------------
- * moves a polygon between layers
- */
-static void *MovePolygonToLayer(LayerType * Layer, PolygonType * Polygon)
-{
- PolygonTypePtr newone;
- struct mptlc d;
-
- if (TEST_FLAG(PCB_FLAG_LOCK, Polygon)) {
- Message(PCB_MSG_DEFAULT, _("Sorry, the object is locked\n"));
- return NULL;
- }
- if (((long int) Dest == -1) || (Layer == Dest))
- return (Polygon);
- AddObjectToMoveToLayerUndoList(PCB_TYPE_POLYGON, Layer, Polygon, Polygon);
- if (Layer->On)
- ErasePolygon(Polygon);
- /* Move all of the thermals with the polygon */
- d.snum = GetLayerNumber(PCB->Data, Layer);
- d.dnum = GetLayerNumber(PCB->Data, Dest);
- d.polygon = Polygon;
- d.type = PCB_TYPE_PIN;
- r_search(PCB->Data->pin_tree, &Polygon->BoundingBox, NULL, mptl_pin_callback, &d, NULL);
- d.type = PCB_TYPE_VIA;
- r_search(PCB->Data->via_tree, &Polygon->BoundingBox, NULL, mptl_pin_callback, &d, NULL);
- newone = (struct polygon_st *) MovePolygonToLayerLowLevel(Layer, Polygon, Dest);
- InitClip(PCB->Data, Dest, newone);
- if (Dest->On) {
- DrawPolygon(Dest, newone);
- Draw();
- }
- return (newone);
-}
-
-/* ---------------------------------------------------------------------------
- * moves the object identified by its data pointers and the type
- * not we don't bump the undo serial number
- */
-void *MoveObject(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY)
-{
- void *result;
- /* setup offset */
- DeltaX = DX;
- DeltaY = DY;
- AddObjectToMoveUndoList(Type, Ptr1, Ptr2, Ptr3, DX, DY);
- result = ObjectOperation(&MoveFunctions, Type, Ptr1, Ptr2, Ptr3);
- return (result);
-}
-
-/* ---------------------------------------------------------------------------
- * moves the object identified by its data pointers and the type
- * as well as all attached rubberband lines
- */
-void *MoveObjectAndRubberband(int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY)
-{
- RubberbandTypePtr ptr;
- void *ptr2;
-
- pcb_draw_inhibit_inc();
-
- /* setup offset */
- DeltaX = DX;
- DeltaY = DY;
- if (DX == 0 && DY == 0) {
- int n;
-
- /* first clear any marks that we made in the line flags */
- for(n = 0, ptr = Crosshair.AttachedObject.Rubberband; n < Crosshair.AttachedObject.RubberbandN; n++, ptr++)
- CLEAR_FLAG(PCB_FLAG_RUBBEREND, ptr->Line);
-
- return (NULL);
- }
-
- /* move all the lines... and reset the counter */
- ptr = Crosshair.AttachedObject.Rubberband;
- while (Crosshair.AttachedObject.RubberbandN) {
- /* first clear any marks that we made in the line flags */
- CLEAR_FLAG(PCB_FLAG_RUBBEREND, ptr->Line);
- AddObjectToMoveUndoList(PCB_TYPE_LINE_POINT, ptr->Layer, ptr->Line, ptr->MovedPoint, DX, DY);
- MoveLinePoint(ptr->Layer, ptr->Line, ptr->MovedPoint);
- Crosshair.AttachedObject.RubberbandN--;
- ptr++;
- }
-
- AddObjectToMoveUndoList(Type, Ptr1, Ptr2, Ptr3, DX, DY);
- ptr2 = ObjectOperation(&MoveFunctions, Type, Ptr1, Ptr2, Ptr3);
- IncrementUndoSerialNumber();
-
- pcb_draw_inhibit_dec();
- Draw();
-
- return (ptr2);
-}
-
-/* ---------------------------------------------------------------------------
- * moves the object identified by its data pointers and the type
- * to a new layer without changing it's position
- */
-void *MoveObjectToLayer(int Type, void *Ptr1, void *Ptr2, void *Ptr3, LayerTypePtr Target, pcb_bool enmasse)
-{
- void *result;
-
- /* setup global identifiers */
- Dest = Target;
- MoreToCome = enmasse;
- result = ObjectOperation(&MoveToLayerFunctions, Type, Ptr1, Ptr2, Ptr3);
- IncrementUndoSerialNumber();
- return (result);
-}
-
-/* ---------------------------------------------------------------------------
- * moves the selected objects to a new layer without changing their
- * positions
- */
-pcb_bool MoveSelectedObjectsToLayer(LayerTypePtr Target)
-{
- pcb_bool changed;
-
- /* setup global identifiers */
- Dest = Target;
- MoreToCome = pcb_true;
- changed = SelectedOperation(&MoveToLayerFunctions, pcb_true, PCB_TYPEMASK_ALL);
- /* passing pcb_true to above operation causes Undoserial to auto-increment */
- return (changed);
-}
-
-/* ---------------------------------------------------------------------------
- * moves the selected layers to a new index in the layer list.
- */
-
-static void move_one_thermal(int old_index, int new_index, PinType * pin)
-{
- int t1 = 0, i;
- int oi = old_index, ni = new_index;
-
- if (old_index != -1)
- t1 = GET_THERM(old_index, pin);
-
- if (oi == -1)
- oi = MAX_LAYER - 1; /* inserting a layer */
- if (ni == -1)
- ni = MAX_LAYER - 1; /* deleting a layer */
-
- if (oi < ni) {
- for (i = oi; i < ni; i++)
- ASSIGN_THERM(i, GET_THERM(i + 1, pin), pin);
- }
- else {
- for (i = oi; i > ni; i--)
- ASSIGN_THERM(i, GET_THERM(i - 1, pin), pin);
- }
-
- if (new_index != -1)
- ASSIGN_THERM(new_index, t1, pin);
- else
- ASSIGN_THERM(ni, 0, pin);
-}
-
-static void move_all_thermals(int old_index, int new_index)
-{
- VIA_LOOP(PCB->Data);
- {
- move_one_thermal(old_index, new_index, via);
- }
- END_LOOP;
-
- ALLPIN_LOOP(PCB->Data);
- {
- move_one_thermal(old_index, new_index, pin);
- }
- ENDALL_LOOP;
-}
-
-static int LastLayerInComponentGroup(int layer)
-{
- int cgroup = GetLayerGroupNumberByNumber(max_group + COMPONENT_LAYER);
- int lgroup = GetLayerGroupNumberByNumber(layer);
- if (cgroup == lgroup && PCB->LayerGroups.Number[lgroup] == 2)
- return 1;
- return 0;
-}
-
-static int LastLayerInSolderGroup(int layer)
-{
- int sgroup = GetLayerGroupNumberByNumber(max_group + SOLDER_LAYER);
- int lgroup = GetLayerGroupNumberByNumber(layer);
- if (sgroup == lgroup && PCB->LayerGroups.Number[lgroup] == 2)
- return 1;
- return 0;
-}
-
-int MoveLayer(int old_index, int new_index)
-{
- int groups[MAX_LAYER + 2], l, g;
- LayerType saved_layer;
- int saved_group;
-
- AddLayerChangeToUndoList(old_index, new_index);
- IncrementUndoSerialNumber();
-
- if (old_index < -1 || old_index >= max_copper_layer) {
- Message(PCB_MSG_DEFAULT, "Invalid old layer %d for move: must be -1..%d\n", old_index, max_copper_layer - 1);
- return 1;
- }
- if (new_index < -1 || new_index > max_copper_layer || new_index >= MAX_LAYER) {
- Message(PCB_MSG_DEFAULT, "Invalid new layer %d for move: must be -1..%d\n", new_index, max_copper_layer);
- return 1;
- }
- if (old_index == new_index)
- return 0;
-
- if (new_index == -1 && LastLayerInComponentGroup(old_index)) {
- gui->confirm_dialog("You can't delete the last top-side layer\n", "Ok", NULL);
- return 1;
- }
-
- if (new_index == -1 && LastLayerInSolderGroup(old_index)) {
- gui->confirm_dialog("You can't delete the last bottom-side layer\n", "Ok", NULL);
- return 1;
- }
-
- for (g = 0; g < MAX_LAYER + 2; g++)
- groups[g] = -1;
-
- for (g = 0; g < MAX_LAYER; g++)
- for (l = 0; l < PCB->LayerGroups.Number[g]; l++)
- groups[PCB->LayerGroups.Entries[g][l]] = g;
-
- if (old_index == -1) {
- LayerTypePtr lp;
- if (max_copper_layer == MAX_LAYER) {
- Message(PCB_MSG_DEFAULT, "No room for new layers\n");
- return 1;
- }
- /* Create a new layer at new_index. */
- lp = &PCB->Data->Layer[new_index];
- memmove(&PCB->Data->Layer[new_index + 1],
- &PCB->Data->Layer[new_index], (max_copper_layer - new_index + 2) * sizeof(LayerType));
- memmove(&groups[new_index + 1], &groups[new_index], (max_copper_layer - new_index + 2) * sizeof(int));
- max_copper_layer++;
- memset(lp, 0, sizeof(LayerType));
- lp->On = 1;
- lp->Name = pcb_strdup("New Layer");
- lp->Color = conf_core.appearance.color.layer[new_index];
- lp->SelectedColor = conf_core.appearance.color.layer_selected[new_index];
- for (l = 0; l < max_copper_layer; l++)
- if (LayerStack[l] >= new_index)
- LayerStack[l]++;
- LayerStack[max_copper_layer - 1] = new_index;
- }
- else if (new_index == -1) {
- /* Delete the layer at old_index */
- memmove(&PCB->Data->Layer[old_index],
- &PCB->Data->Layer[old_index + 1], (max_copper_layer - old_index + 2 - 1) * sizeof(LayerType));
- memset(&PCB->Data->Layer[max_copper_layer + 1], 0, sizeof(LayerType));
- memmove(&groups[old_index], &groups[old_index + 1], (max_copper_layer - old_index + 2 - 1) * sizeof(int));
- for (l = 0; l < max_copper_layer; l++)
- if (LayerStack[l] == old_index)
- memmove(LayerStack + l, LayerStack + l + 1, (max_copper_layer - l - 1) * sizeof(LayerStack[0]));
- max_copper_layer--;
- for (l = 0; l < max_copper_layer; l++)
- if (LayerStack[l] > old_index)
- LayerStack[l]--;
- }
- else {
- /* Move an existing layer */
- memcpy(&saved_layer, &PCB->Data->Layer[old_index], sizeof(LayerType));
- saved_group = groups[old_index];
- if (old_index < new_index) {
- memmove(&PCB->Data->Layer[old_index], &PCB->Data->Layer[old_index + 1], (new_index - old_index) * sizeof(LayerType));
- memmove(&groups[old_index], &groups[old_index + 1], (new_index - old_index) * sizeof(int));
- }
- else {
- memmove(&PCB->Data->Layer[new_index + 1], &PCB->Data->Layer[new_index], (old_index - new_index) * sizeof(LayerType));
- memmove(&groups[new_index + 1], &groups[new_index], (old_index - new_index) * sizeof(int));
- }
- memcpy(&PCB->Data->Layer[new_index], &saved_layer, sizeof(LayerType));
- groups[new_index] = saved_group;
- }
-
- move_all_thermals(old_index, new_index);
-
- for (g = 0; g < MAX_LAYER; g++)
- PCB->LayerGroups.Number[g] = 0;
- for (l = 0; l < max_copper_layer + 2; l++) {
- int i;
- g = groups[l];
- if (g >= 0) {
- i = PCB->LayerGroups.Number[g]++;
- PCB->LayerGroups.Entries[g][i] = l;
- }
- }
-
- for (g = 0; g < MAX_LAYER; g++)
- if (PCB->LayerGroups.Number[g] == 0) {
- memmove(&PCB->LayerGroups.Number[g],
- &PCB->LayerGroups.Number[g + 1], (MAX_LAYER - g - 1) * sizeof(PCB->LayerGroups.Number[g]));
- memmove(&PCB->LayerGroups.Entries[g],
- &PCB->LayerGroups.Entries[g + 1], (MAX_LAYER - g - 1) * sizeof(PCB->LayerGroups.Entries[g]));
- }
-
- hid_action("LayersChanged");
- gui->invalidate_all();
- return 0;
-}
-
-/* --------------------------------------------------------------------------- */
-
-static const char movelayer_syntax[] = "MoveLayer(old,new)";
-
-static const char movelayer_help[] = "Moves/Creates/Deletes Layers.";
-
-/* %start-doc actions MoveLayer
-
-Moves a layer, creates a new layer, or deletes a layer.
-
-@table @code
-
-@item old
-The is the layer number to act upon. Allowed values are:
-@table @code
-
-@item c
-Currently selected layer.
-
-@item -1
-Create a new layer.
-
-@item number
-An existing layer number.
-
-@end table
-
-@item new
-Specifies where to move the layer to. Allowed values are:
-@table @code
-@item -1
-Deletes the layer.
-
-@item up
-Moves the layer up.
-
-@item down
-Moves the layer down.
-
-@item c
-Creates a new layer.
-
-@end table
-
-@end table
-
-%end-doc */
-
-int MoveLayerAction(int argc, const char **argv, Coord x, Coord y)
-{
- int old_index, new_index;
- int new_top = -1;
-
- if (argc != 2) {
- Message(PCB_MSG_DEFAULT, "Usage; MoveLayer(old,new)");
- return 1;
- }
-
- if (strcmp(argv[0], "c") == 0)
- old_index = INDEXOFCURRENT;
- else
- old_index = atoi(argv[0]);
-
- if (strcmp(argv[1], "c") == 0) {
- new_index = INDEXOFCURRENT;
- if (new_index < 0)
- new_index = 0;
- }
- else if (strcmp(argv[1], "up") == 0) {
- new_index = INDEXOFCURRENT - 1;
- if (new_index < 0)
- return 1;
- new_top = new_index;
- }
- else if (strcmp(argv[1], "down") == 0) {
- new_index = INDEXOFCURRENT + 1;
- if (new_index >= max_copper_layer)
- return 1;
- new_top = new_index;
- }
- else
- new_index = atoi(argv[1]);
-
- if (MoveLayer(old_index, new_index))
- return 1;
-
- if (new_index == -1) {
- new_top = old_index;
- if (new_top >= max_copper_layer)
- new_top--;
- new_index = new_top;
- }
- if (old_index == -1)
- new_top = new_index;
-
- if (new_top != -1)
- ChangeGroupVisibility(new_index, 1, 1);
-
- return 0;
-}
-
-HID_Action move_action_list[] = {
- {"MoveLayer", 0, MoveLayerAction,
- movelayer_help, movelayer_syntax}
-};
-
-REGISTER_ACTIONS(move_action_list, NULL)
Index: 1.1.4/src/polygon1.c
===================================================================
--- 1.1.4/src/polygon1.c (revision 10776)
+++ 1.1.4/src/polygon1.c (nonexistent)
@@ -1,3190 +0,0 @@
-/*
- polygon clipping functions. harry eaton implemented the algorithm
- described in "A Closed Set of Algorithms for Performing Set
- Operations on Polygonal Regions in the Plane" which the original
- code did not do. I also modified it for integer coordinates
- and faster computation. The license for this modified copy was
- switched to the GPL per term (3) of the original LGPL license.
- Copyright (C) 2006 harry eaton
-
- based on:
- poly_Boolean: a polygon clip library
- Copyright (C) 1997 Alexey Nikitin, Michael Leonov
- (also the authors of the paper describing the actual algorithm)
- leonov@propro.iis.nsk.su
-
- in turn based on:
- nclip: a polygon clip library
- Copyright (C) 1993 Klamer Schutte
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with this program; if not, write to the Free
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- polygon1.c
- (C) 1997 Alexey Nikitin, Michael Leonov
- (C) 1993 Klamer Schutte
-
- all cases where original (Klamer Schutte) code is present
- are marked
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include