Skip to main content

categorize_component

Function categorize_component 

Source
pub fn categorize_component(lib_ref: &str, description: &str) -> &'static str
Expand description

Categorize a component by its library reference into a human-readable type.

Returns category name for grouping (Resistor, Capacitor, IC, etc.).

Library-reference categorization was chosen over designator-prefix matching because Altium components use semantic library names (e.g., ‘LPC1768_MCU’) but may share designator prefixes (U1, U2). Library-based categorization captures component type accurately whereas designator prefix only indicates generic IC category. Tradeoff: More complex pattern matching, but handles multi-function ICs correctly.