Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to the non-plated hole and support for changes to mechanical/MountingHoles #209

Merged
merged 12 commits into from
Dec 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added new NullNumbering and NullPadPlanner
This supports the cases where we don't need these
types in a landpattern generator.
callendorph committed Dec 17, 2024
commit ec1340865c91901e1f6f151397e6215600cc723f
11 changes: 11 additions & 0 deletions src/landpatterns/numbering.stanza
Original file line number Diff line number Diff line change
@@ -41,6 +41,17 @@ Convert the row and column indices into a pad number or reference
<DOC>
public defmulti to-pad-id (x:Numbering, row:Int, column:Int) -> Int|Ref

doc: \<DOC>
Null Numbering Object

This is a default object for creating packages that don't require
any pad numbering. These landpatterns may not contain any pads to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this may not or should not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't prevent composition of landpatterns or manually defining, for example, a mechanical hole pad outside of these constructs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, then maybe we change the language to something like?
"These landpatterns do not need to contain any pads to number."

number.
<DOC>
public defstruct NullNumbering <: Numbering
defmethod to-pad-id (n:NullNumbering, row:Int, column:Int) -> Int|Ref:
throw $ ValueError("Null Numbering Cannot Create Pad IDs")

; Default for Std IC Numbering
val DUAL-ROW-COLS = 2

16 changes: 16 additions & 0 deletions src/landpatterns/pad-planner.stanza
Original file line number Diff line number Diff line change
@@ -244,6 +244,22 @@ Default `hole-shape` - No Holes Created.
public defmethod hole-generator (x:PadPlanner, row:Int, column:Int) -> (Dims -> Shape)|False :
false

doc: \<DOC>
Null Pad Planner

This Pad Planner will generate no pads. It is intended for cases where
a landpattern is created with the `Package` framework that has no
pads to create.
<DOC>
public defstruct NullPadPlanner <: PadPlanner
defmethod active? (x:NullPadPlanner, row:Int, column:Int) -> True|False :
false

defmethod shape-generator (x:NullPadPlanner, row:Int, column:Int) -> (Dims -> Shape)|False:
false



doc: \<DOC>
Pad Planner that always returns a Shape Converter