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

Convert through hole pads to via's #31

Merged
merged 2 commits into from
Apr 11, 2020
Merged

Convert through hole pads to via's #31

merged 2 commits into from
Apr 11, 2020

Conversation

coolio986
Copy link
Contributor

No description provided.

Copy link
Collaborator

@urish urish left a 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 } = {
Copy link
Collaborator

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') {
Copy link
Collaborator

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)]
Copy link
Collaborator

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', () => {
Copy link
Collaborator

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)

@urish urish added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Apr 8, 2020
@urish urish merged commit c1e856e into wokwi:master Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants