-
Notifications
You must be signed in to change notification settings - Fork 39
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
Convert through hole pads to via's #31
Conversation
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.
Thanks for coming up with a clean pull-request, now it is so much easier to see all the changes and review!
I added some comments / requests, please have a look at them and let me know if you need any additional info or have any questions. Thank you!
return; | ||
} | ||
|
||
const shapes: { [key: string]: string } = { |
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.
Since shapes
is also defined in convertPad()
, let's make it a global const instead defining the exact same object in two different places.
POLYGON: 'custom' | ||
}; | ||
|
||
if (shape !== 'ELLIPSE') { |
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.
Can you please add one test case for non-ellipse shape, so the tests will also cover this if statement?
['size', kiUnits(holeRadius)], | ||
['drill', kiUnits(drill) * 2], | ||
['layers', 'F.Cu', 'B.Cu'], | ||
['net', nets.indexOf(net)] |
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.
Instead of using nets.indexOf()
, please use getNetId()
(you can see an example in convertPad()
). This makes sure we add missing nets to the list as we encounter them (this is a fix to issue #29).
@@ -56,6 +56,20 @@ describe('convertTrack', () => { | |||
}); | |||
}); | |||
|
|||
describe('convertPadToVia', () => { | |||
it('should correctly parse a PAD and convert it to a Via', () => { |
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.
Good job here! You may need to change the expect()
bit after you switch to getNetId()
(see my comment about that below)
No description provided.