← Back to team overview

kicad-developers team mailing list archive

Re: Kicad Fields, was Re: [RFC] On net ties, microwave tools & custom pad shapes, altogether.

 

On 5/4/2016 10:40 PM, Strontium wrote:
> I split this from the net-ties, etc RFC because its drifting off topic
> from that discussion.
> 
> I am not sure I understand the rationale to "It should also
> be limited to passing information to external tools such as simulators
> and scripts such as Tom's proposal"?

Any feature that is internal to kicad should not be handled through
fields.  Other than the 4 mandatory fields, fields are reserved for user
defined data.  For example, the gate and pin swapping information could
be passed via fields.  However, this will be a internal kicad feature in
the future and will be implemented as part of the file formats rather
than using fields.  The only exception I know of is the spice netlist
formatter with uses text notes and/or fields to generate spice netlists.

> 
> Both the Footprint and the Component Reference are "Fields" and
> key:value pairs.  I would imaging these are the first Fields that any
> new Kicad user works with.
> 
> Kicad has functionality to work with those "Fields" and they are core
> information NOT just for external tools, they also convey information
> from Schematic to PCB.  Yet they are also just Key:Value field pairs.
> 
> I agree that it requires documentation if the number of fields grows,
> especially if they are not explicitly included like the default Field
> list automatically includes Footprint and reference.  Surely one way to
> mitigate that is to have a list of "standard" Fields that can be
> selected from in addition to typing them in.  It would also be possible
> to have a validator or entry dialogue for a "standard" fields "value",
> similar to the footprint field.  This is not a design proposal, merely a
> suggestion of how this could be handled.
> 
> It would also still be very "generally" useful to be able to add fields
> to nets, and for that information to be able to propagate to the PCB
> elements they reflect.  Alternatively (and I actually think its
> preferable) some mechanism to query that information from the schematic,
> given a PCB object, eliminates the need to propagate it into the PCB
> file and keeps it DRY.
> 
> Whether for a core feature or not, Properly implemented, I can easily
> imagine fields that carry arbitrary information between Schematic/PCB
> being a killer feature, especially for scripting. It would then make it
> easy to create scripts for all sorts of purposes and for their operation
> to be generally parametrisable and documented in the schematic. 
> Something which now is not possible.

User defined fields can contain any information that the user can think
of and are available to scripts in both the schematic file and the
netlist file.  There is nothing preventing you from parsing this
information with any script and doing whatever you want to do with the
user defined field information.  This is outside the scope of kicad and
is left up to the imagination of the user.  The key difference is "user"
defined feature versus "kicad" defined feature.

> 
> Examples: You could have a python script which produces tuned antennas
> parametrically, and does it based on the parameters specified in the
> schematic.
>     In the schematic, you place a component for a "mounting hole" you
> declare for the "mounting hole" its actual co-ordinates, as it is a
> constraint.  Now a script run on the PCB can ensure that the mounting
> holes are located in "exactly" the correct location as specified in the
> schematic.
>     You could create a schematic representation for your board
> "outline", and the field is the name of a DXF. In pcbnew, a script can
> read that, and automatically load the DXF and draw the outline on the
> outline layer.  Change the DXF and the PCB can easily and quickly be
> updated to redraw the outline layer.
> 
> It would clearly be up to the developer of the script to document the
> parameters and how the script is used, as its not "core" functionality. 
> BUT, a full library of "extended" functionality could grow around this
> feature and it makes kicad significantly more powerful and significantly
> easier to extend.  I believe users would quickly become accustomed to
> looking in the library for the "extended" features they want, as their
> needs grow.
> 
> 
> 
> 
> On 04/05/16 22:57, Wayne Stambaugh wrote:
>> The use of fields for arbitrary data is indeed powerful.  It should also
>> be limited to passing information to external tools such as simulators
>> and scripts such as Tom's proposal.  Anything that is supported as a
>> feature in KiCad should be part of the schematic file format and fully
>> supported by the schematic editor.  The problem with using fields is the
>> user has to know how to define all of the attributes correctly which
>> requires thorough documentation.  I don't see this as a good solution
>> for the average user.  This is a bit like using regular expressions.
>> They are really powerful but only a small number of users (typically
>> developers) will actually know how to use them effectively.
>>
>> On 5/3/2016 7:13 PM, Strontium wrote:
>>> My 2c.
>>>
>>> One of the fantastically useful features of eeschema is components have
>>> an "arbitrary" list of key:value pairs (fields) attached to them as
>>> attributes.
>>>
>>> Can I suggest that such a feature attached to objects on the PCB would
>>> be even more powerful/useful.
>>>
>>> It would mean that changes like the ones suggested would not require
>>> further format changes to the pcb file, these attributes can be
>>> added/deleted at will as they are just a key:value pair.  It would also
>>> make the file format backward/forward compatible, pcbnew wont care what
>>> the key:values are, it can read/edit/propagate them.  If functionality
>>> exists to utilise them then it can use it, if not, they are passive,
>>> just like eeschema.
>>>
>>> Further, the key:value pairs in eeschema could be imported into the
>>> matching pcb objects, so that there is only 1 place that needs to be
>>> edited to set them (the schematic). (I actually think that should be the
>>> proper place to set them)
>>>
>>> And by objects I mean both components AND nets. At the moment only
>>> components have "fields" on the schematic, the ability to attach them to
>>> nets would be mighty handy.
>>>
>>> It would also be super useful for python scripting, because you can
>>> tag/parametrise your objects on the pcb and your scripts can then,
>>> easily, only do things with the appropriately tagged entities.
>>>
>>> FOR EXAMPLE:
>>>
>>> On the schematic, a key value pair is added to a net:
>>> IMPEDANCE:50
>>> This attribute is set as visible, so when the schematic is printed its
>>> OBVIOUS that the net needs to be 50Ohm impedance. (It would be great on
>>> schematic if the visible flag had 3 states: invisible, value only,
>>> key+value)
>>>
>>> On the PCB, a python script is run "adjust_impedance", it scans all nets
>>> looking for ones with the "IMPEDANCE" key, and then adjusts the width of
>>> the trace to have that impedance, as required. And if it can't, it
>>> generates a list of nets which are not the correct impedance, based on
>>> the board parameters as set in the schematic.
>>>
>>> ALL of the features suggested below would be easier to implement with
>>> such a unified attribute system between schematic/pcb AND would mean
>>> that fewer changes need to be made to the file formats long term.
>>>
>>> Steven J
>>>
>>>
>>>
>>> On 03/05/16 20:40, Tomasz Wlostowski wrote:
>>>> Hi all,
>>>>
>>>> Recently there has been a lot of discussion on these features. Here's a
>>>> short proposal how we could hit all three birds with one stone:
>>>>
>>>> Changes to SCH:
>>>> - none
>>>>
>>>> Changes to netlist import:
>>>> - auto_generate flag for SCH components - when set, invokes a Python
>>>> script/C++ plugin which updates the PCB footprint of the component
>>>> depending on its SCH parameters (e.g. produces a microstrip footprint
>>>> based on Width/Length parameters defined on SCH).
>>>> - write some microwave component generator plugins (or port the
>>>> existing
>>>> tools). Perhaps a good job for Python.
>>>>
>>>> Changes to PCB:
>>>> 1) Add two flags to each graphical primitive within a footprint:
>>>> - net_tie: DRC treats the primitive as non-conducting and doesn't throw
>>>> a short circuit error (see drawing A)
>>>> - net_inherit = pad_number: the primitive will take the net of the pad
>>>> with given pad_number (see drawing B)
>>>> 2) Add new 'anchor' virtual pad type.
>>>> - indicates the point to attach a trace/via when routing the component.
>>>> - exists on a single copper layer.
>>>> - has no physical copper.
>>>> - has an optional direction vector which denotes how it can be
>>>> connected
>>>> with a trace/other anchor pad (see drawing C)
>>>> - has a circular perimeter (maybe other shapes in the future if
>>>> needed).
>>>> Objects intersecting the graphical primitive outside the anchor
>>>> perimeter are considered colliding by the DRC (see drawing D) even if
>>>> they have the same net.
>>>> 3) modify .kicad_pcb/footprint formats to support the above:
>>>> - extend fp_* entities: net_tie & net_inherit flags
>>>> - extend pad entity: add anchor pad type, perimeter radius and
>>>> direction
>>>> vector.
>>>> 4) modify DRC to support the above (we can benefit from the work
>>>> already
>>>> done by JP)
>>>>
>>>>
>>>> Advantages:
>>>> - microwave footprints generated straight from the schematics.
>>>> - net ties for free (since based on the same idea as microwave
>>>> components)
>>>> - custom footprint copper shapes almost for free (costs one extra
>>>> flag &
>>>> some changes in netlist importer)
>>>> - minimum changes to file formats & data structures.
>>>>
>>>> The attached drawing shows use cases for all of the above and explains
>>>> the concept of anchors.
>>>>
>>>> Looking forward to your feedback,
>>>> Tom
>>>>
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp


References