Merge lp:~xzcvczx/kicad/gerber-fix into lp:kicad/product

Proposed by xzcvczx
Status: Merged
Merged at revision: 6176
Proposed branch: lp:~xzcvczx/kicad/gerber-fix
Merge into: lp:kicad/product
Diff against target: 18 lines (+3/-3)
1 file modified
gerbview/rs274x.cpp (+3/-3)
To merge this branch: bzr merge lp:~xzcvczx/kicad/gerber-fix
Reviewer Review Type Date Requested Status
Wayne Stambaugh Approve
Nick Østergaard (community) Approve
Miguel Angel Ajo Approve
Maciej Suminski Approve
Review via email: mp+270279@code.launchpad.net

Commit message

Fixed the image rotation parsing code,

Before the change any image rotation that wasn't 270 degrees would show a ReportMessage.
Also made the strnicmp check the correct lengths of the numbers, as before it would only check the first 2 characters for all numbers

Description of the change

Fixed Gerber generation if the include extended attributes field is checked in pcbnew

To post a comment you must log in.
Revision history for this message
Maciej Suminski (orsonmmz) :
review: Approve
lp:~xzcvczx/kicad/gerber-fix updated
6156. By xzcvczx

Fixed RS274X image rotation parsing.

If the image was being rotated by a valid amount but not 270 degrees due to the if statements it would already report that there was an invalid value.

Also due to the strnicmp only checking the first 2 characters which was valid for 0* but not the rest of the numbers, some values would be able to work that shouldn't

Revision history for this message
Miguel Angel Ajo (mangelajo) wrote :

Review: Approve

nice, I didn't know we could do code reviews like this in launchpad ;)

Maciej Sumiński wrote:
> Review: Approve
>
>

Revision history for this message
Miguel Angel Ajo (mangelajo) :
review: Approve
Revision history for this message
Nick Østergaard (nickoe) :
review: Approve
Revision history for this message
Wayne Stambaugh (stambaughw) :
review: Approve
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I just committed this merge request in r6176. I managed to mess up the commit message with your author information instead of your commit message. Sorry about that. At least your name is attached to the commit. Thank you for contribution to KiCad.

Cheers,

Wayne

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gerbview/rs274x.cpp'
2--- gerbview/rs274x.cpp 2015-08-23 12:35:49 +0000
3+++ gerbview/rs274x.cpp 2015-09-08 12:23:37 +0000
4@@ -434,11 +434,11 @@
5 case IMAGE_ROTATION: // command IR0* or IR90* or IR180* or IR270*
6 if( strnicmp( text, "0*", 2 ) == 0 )
7 m_ImageRotation = 0;
8- if( strnicmp( text, "90*", 2 ) == 0 )
9+ else if( strnicmp( text, "90*", 3 ) == 0 )
10 m_ImageRotation = 90;
11- if( strnicmp( text, "180*", 2 ) == 0 )
12+ else if( strnicmp( text, "180*", 4 ) == 0 )
13 m_ImageRotation = 180;
14- if( strnicmp( text, "270*", 2 ) == 0 )
15+ else if( strnicmp( text, "270*", 4 ) == 0 )
16 m_ImageRotation = 270;
17 else
18 ReportMessage( _( "RS274X: Command \"IR\" rotation value not allowed" ) );