-
Notifications
You must be signed in to change notification settings - Fork 38
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
fix: same name of the components should add an error to the circuit json #724
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const errors = checkEachPcbTraceNonOverlapping(db.toArray()) | ||
for (const error of errors) { | ||
db.pcb_trace_error.insert(error) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to only run this on the board, because DRC requirements are board-wide, it is a bit of an unusual case but i do think ots correct to have it on board
const { db } = this.root! | ||
|
||
if (this.isSubcircuit) { | ||
const subcircuitComponentsByName = new Map<string, PrimitiveComponent[]>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subcircuit component name checking is good 👍 this one doesnt need to go on the board
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, we don't need to check it here in Board. But we will have to import from the Group class for this behaviour to be accepted, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can call the super method inside the board so that it runs the DRC checks that run for any subcircuit. You can alternatively create an internal underscore function that does what the subcircuit does. For example _checkForConflictingNames()
pcbX={-3} | ||
/> | ||
</subcircuit> | ||
</group>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a valid circuit that shouldnt error. Names must be unique within a subcircuit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't I am checking for the pcb_trace_error
to be 0
, will update the test name to be clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops sorry ty!!
/close #723