From 6751926ac2d6b60b8f755eec86a4b865a23dbf86 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 14 Jul 2026 13:19:37 +0000 Subject: [PATCH] schlib_write: write full template+SOP param set (--typeid), fill ComponentDescription from template Description; docs updated --- SKILL.md | 8 +++- assets/CHANGELOG.xlsx | Bin 5533 -> 5536 bytes references/schlib_parameters.md | 35 +++++++++++------ scripts/schlib_write.py | 65 +++++++++++++++++++++++++++++--- 4 files changed, 89 insertions(+), 19 deletions(-) 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 2681c608d321c632053431f15e90f6bfab908c65..2f57f6685b1df084108aaef1648ecf4b1913f4e6 100644 GIT binary patch delta 1420 zcmbQMy+E5Mz?+#xgn@y9gP|yEBF{n2qO5l@c??}!eonlmRll5fk)F7K`h*E9SRRR~ z-V?jHB{1pAySJIAuQfhkv^e(f^UuvsPO)U}>hRylEpak&msHJVwai1)WILKzJf1bg zEwAy}l3aYdFFFMG#et=j%%TFCwHmGS3x7P2$0 z@8>`NdDqNr;g{DQ{Lr@aJl+spHt$c+y?a-``-tv|NUxd98ON;`-m0_yzS?#9I`PE& zk=u*^AFc@P4(gJQ%-bh9pEZ%CWAE!cUk{qK?Eb=}>oU!FN$%l%66o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zG;QHE%@58BbMj-5DWTNy$K6^|jK{p!8KanqL<}vJ{O*N+wxw}VD1&*h*@2sVTi(5O zzB%^%)Bs~P`87a0t&Hdv3g?~;G7KLLe>}NcQ(Ju2GOd!_$EM}A zdrH-k-2IYEh^j4g$YLd0QDaQFXnN!X$|owy)==2v7~pH>)XSBT)Mi-m4%C zc!#_Eajod2$GrF)(^cX9X|Cg_GJ;Z=Jua834*!8iu#FdG`;>I z_&GtEYNX|^mK&RiKQ=!dXhd}x5645_!cQ^r95+AeaFTgk0geg&c3Y?xgzJJ12qZ!R z0z-Ej-m}_9+q#F{9V%sq#^u*`x#+^^A9)A=GTM>Y{#(=4Sa+C5X&}!^0t2k!JHa0S z8XSv+HH5u1ZN@H&?jYA?UC4ju2V90@x1x#(msN` zT@I6zMD46R78rsDGc$n-VE~Vlx&wXdt*ps~*9^-~!YX{Oc+T`uHa#7`G3S=HK;(xF zDzn>_DF*pv%Zlu3LXk<_Hcizvy<-!lI90=gG(0YT&^V~Pc;CMG+4ZpTgaPE6z&))n zbEDLN+mHb5gj;c5)OP)=G1g&WS$t1a$Q;vBzF1P*RdbO^Tsps~VN1!~00TEaMuy7D z2tNf6Ulx-UJ;nBFrXatl;$iy2tt8>~q{A()+$X?jU`J47Q`4Q}OZPG;hR^6J1RK<{ z(-MU~_FNsAqRZLPNRcI;GC$%y+I6Tud>;jNohu8FIu0d7zXuBDPCMXdArl!l;Ozo-#VfpWH3)u#VH69g*9fk3Dg-TG`Sumbo8wdKpV z0v2ct*bdl%#vxYgzPgcEG=3GX42>lYAwZy`$x(51M~78^z!$88*8MDpO6q$j4&NCJ z0$Hsbm+@z$mB<3$2UO^dt6hvSSg;vjkFnXbiV{_Dw#am)U|9EicFRa01!D;%f8zWf D=CyYk 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('