diff --git a/SKILL.md b/SKILL.md index ec1a679..65cc783 100644 --- a/SKILL.md +++ b/SKILL.md @@ -340,14 +340,10 @@ 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`. -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): +Collect the values into a `params.json` and write them into the symbol: ```bash -python scripts/schlib_write.py --schlib .SchLib --params params.json \ - --out //.SchLib --typeid +python scripts/schlib_write.py --schlib .SchLib --params params.json --out //.SchLib ``` 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 2f57f66..1cc428e 100644 Binary files a/assets/CHANGELOG.xlsx and b/assets/CHANGELOG.xlsx differ diff --git a/assets/template/template.xlsx b/assets/template/template.xlsx index 8292a39..ab04474 100644 Binary files a/assets/template/template.xlsx and b/assets/template/template.xlsx differ diff --git a/assets/template/versions.json b/assets/template/versions.json index b29a5f1..fb110ec 100644 --- a/assets/template/versions.json +++ b/assets/template/versions.json @@ -88,8 +88,8 @@ "template_version": 1 }, "CMC": { - "skill_version": 1, - "template_version": 1 + "skill_version": 2, + "template_version": 2 }, "CMP": { "skill_version": 1, diff --git a/references/schlib_parameters.md b/references/schlib_parameters.md index b84b496..9b53436 100644 --- a/references/schlib_parameters.md +++ b/references/schlib_parameters.md @@ -93,35 +93,24 @@ 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. 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: +Write the parameters straight into the `.SchLib`, producing a new file: ```bash -python scripts/schlib_write.py --schlib .SchLib --params params.json --out .SchLib --typeid +python scripts/schlib_write.py --schlib .SchLib --params params.json --out .SchLib ``` -`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. +`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. Fallback (apply from inside Altium): diff --git a/scripts/schlib_write.py b/scripts/schlib_write.py index 4730cd6..ffc952b 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, os, struct, sys, hashlib +import argparse, json, struct, sys, hashlib import olefile FREESECT=0xFFFFFFFF; ENDOFCHAIN=0xFFFFFFFE; FATSECT=0xFFFFFFFD @@ -42,26 +42,6 @@ def le32(b,o): return struct.unpack('