diff --git a/SKILL.md b/SKILL.md index 65cc783..ec1a679 100644 --- a/SKILL.md +++ b/SKILL.md @@ -340,10 +340,14 @@ Leave any genuinely-unknown field blank — the SOP hides blank parameters, so a empty until filled. The full method for the second-source search is in `references/schlib_parameters.md`. -Collect the values into a `params.json` and write them into the symbol: +Write the **full parameter set** — the typeid template's engineering columns **plus** the SOP +params above (see `references/schlib_parameters.md`). Collect your filled values into a +`params.json` and pass `--typeid` so the writer guarantees every template column is present +(blank where the datasheet is silent): ```bash -python scripts/schlib_write.py --schlib .SchLib --params params.json --out //.SchLib +python scripts/schlib_write.py --schlib .SchLib --params params.json \ + --out //.SchLib --typeid ``` Deliver the resulting `.SchLib`; the engineer opens it in Altium once to confirm it loads, then diff --git a/assets/CHANGELOG.xlsx b/assets/CHANGELOG.xlsx index 2681c60..2f57f66 100644 Binary files a/assets/CHANGELOG.xlsx and b/assets/CHANGELOG.xlsx differ diff --git a/references/schlib_parameters.md b/references/schlib_parameters.md index 9b53436..b84b496 100644 --- a/references/schlib_parameters.md +++ b/references/schlib_parameters.md @@ -93,24 +93,35 @@ symbol's Library Ref (from `altium_refs.py`); omit it to apply to every componen } ``` +## The full parameter set (template + SOP) + +Every `.SchLib` should carry the **complete** parameter set for its part: the **typeid +template's engineering columns** (all columns of that typeid's `template.xlsx` sheet except the +internal bookkeeping ones — the tag `MPN_make_type`, `Skill Version`, `Template Version`, and the +four `Library/Footprint Ref/Path` columns) **plus** the mandatory SOP params above. So a CER +(ceramic MLCC) symbol gets `Capacitance(uF)`, `Tolerance`, `Voltage(V)`, +`Dielectric(temp. Coefficient)`, `Operating Temp(°C)`, `Max operating temp(°C)`, `Package`, +`Description`, `Manufacturer` from the template, alongside `Value`, `Manufacturer Part`, +`Process`, `Vecmocon Part Code`, `ROHS`, `Datasheet`, and the second-source fields. Fill each +from the datasheet; leave blank what the datasheet doesn't state. + ## Writing them into the symbol -Write the parameters straight into the `.SchLib`, producing a new file: +Write the parameters straight into the `.SchLib`, producing a new file. Pass `--typeid` so the +writer guarantees the whole template column set is present (blank where you didn't supply a +value) — this is what keeps every symbol's parameter set complete and consistent: ```bash -python scripts/schlib_write.py --schlib .SchLib --params params.json --out .SchLib +python scripts/schlib_write.py --schlib .SchLib --params params.json --out .SchLib --typeid ``` -`params.json` may carry a `"remove"` list (defaults to `["Manufacturer_Name", -"Manufacturer_Part_Number"]`); those Ultra-Librarian defaults are stripped and the SOP params -added. The script targets the component named in `"component"` (its Library Ref / storage name), -or every component if omitted, and self-checks the output re-opens as a valid OLE. Deliver the -resulting `.SchLib`, and have the engineer open it in Altium once to confirm it loads, then Save -to Server with a revision note per the SOP. - -Scope note: the direct writer keeps a component's `Data` under Altium's 4096-byte mini-stream -threshold in the common case; a very large parameter set (or an extremely long datasheet URL) -can push it past that, at which point fall back to the `altium_params.py` DXP-script path. +`params.json` carries your filled values (and may include a `"remove"` list — defaults to +`["Manufacturer_Name", "Manufacturer_Part_Number"]`, the Ultra-Librarian duplicates that get +stripped). The script targets the component named in `"component"` (its Library Ref / storage +name), or every component if omitted, and self-checks the output re-opens as a valid OLE. It +handles any parameter-set size — small sets stay in Altium's mini-stream, larger ones are written +as a regular stream automatically. Deliver the resulting `.SchLib`; have the engineer open it in +Altium once to confirm it loads, then Save to Server with a revision note per the SOP. Fallback (apply from inside Altium): diff --git a/scripts/schlib_write.py b/scripts/schlib_write.py index ffc952b..4730cd6 100644 --- a/scripts/schlib_write.py +++ b/scripts/schlib_write.py @@ -29,7 +29,7 @@ IMPORTANT: this writes Altium's own binary format from outside Altium. It is val re-open as a well-formed OLE with every other stream byte-identical, but ALWAYS open the result in Altium once to confirm it loads before relying on it. """ -import argparse, json, struct, sys, hashlib +import argparse, json, os, struct, sys, hashlib import olefile FREESECT=0xFFFFFFFF; ENDOFCHAIN=0xFFFFFFFE; FATSECT=0xFFFFFFFD @@ -42,6 +42,26 @@ def le32(b,o): return struct.unpack('