racklet / electronics-prototyping

Design files for electronic components for use in Racklet
Apache License 2.0
3 stars 0 forks source link

Implement a KiCad component classifier #12

Closed luxas closed 3 years ago

luxas commented 3 years ago

Commits:

The sample data I used for policy.yaml is:

classifiers:
- class: capacitor
  labels:
  - key: symbolName
    op: Equals
    values:
    - "C_Small"
- class: capacitor
  labels:
  - key: footprintLibrary
    op: Equals
    values:
    - Capacitor_SMD
- class: resistor
  labels:
  - key: symbolName
    op: Equals
    values:
    - R_Small
- class: shunt_resistor
  labels:
  - key: symbolName
    op: Equals
    values:
    - R_Small
  attributes:
  - key: Tolerance
    op: Equals
    values:
    - "1"

I used the Kubernetes API way of matching labels in order to be sure it's at least somewhat generic and battle-tested, instead of inventing my own thing. If you go and check the Go code implementing this in k8s, and compare to this implementation, one can see that Rust really shines for this task.

@chiplet @twelho