The first stab at true library symbol inheritance was recently merged into the development branch of KiCad and will be available in next nightly builds. Saving to the legacy symbol library file format is no longer possible because the legacy format cannot support symbol field inheritance. You must first save legacy libraries to the new symbol library file format before you can use the field inheritance feature.
This change only implements derived symbol field inheritance from a single parent symbol. I suspect that this use case actually provides most user’s inheritance requirements. The inheritance is pretty basic when adding a new symbol to a schematic the following inheritance rules apply:
- Symbols that do not derive from other symbols (root symbols) are used as is.
- If a field is defined in the parent symbol but not in the derived symbol then the field from the parent symbol is used.
- If a field is defined in the derived symbol but not in the parent symbol then the field from the derived symbol is used.
- If a filed is defined in the derived symbol and in the parent symbol, the field from the derived symbol is used.
This change required rethinking how the symbol library editor displays derived symbols. I opted for what I thought would be the least confusing option so only the fields defined in derived symbols are shown on the canvas and in the symbol properties dialog. Fields inherited from the parent symbol are not shown when editing a derived symbol. I thought it would be confusing to show fields that cannot be edited but I am open suggestion regarding how to best handle this.
Below is a simple root symbol with an optional field.
Below are the simple root symbol properties.
Below is derived symbol that inherits from the root symbol above. Notice the footprint and datasheet fields from the root symbol are not shown. Only the fields provided by the inherited symbol are shown.
Below are the properties of the inherited symbol. Notice that the “reference” field and optional field “opt-field-parent-1” have a different values than the root symbol. This will replace the field in the parent when added to a schematic. This includes all field properties not just the values.
Below is what the derived symbol will look like when added to a schematic.
Below are the properties for the symbol in the schematic.
Please let me know if you find the UI and/or inheritance behavior confusing and how to improve the user experience.