Merge lp:~azonenberg/kicad/advanced-feature-bugfixes into lp:kicad/product

Proposed by Andrew Zonenberg
Status: Merged
Merged at revision: 5029
Proposed branch: lp:~azonenberg/kicad/advanced-feature-bugfixes
Merge into: lp:kicad/product
Diff against target: 124 lines (+30/-5)
4 files modified
pcbnew/class_pad.cpp (+5/-0)
pcbnew/router/pns_router.cpp (+8/-4)
pcbnew/router/pns_via.cpp (+1/-0)
pcbnew/router/pns_via.h (+16/-1)
To merge this branch: bzr merge lp:~azonenberg/kicad/advanced-feature-bugfixes
Reviewer Review Type Date Requested Status
KiCad Lead Developers Pending
Review via email: mp+228429@code.launchpad.net

Description of the change

Fixes the following issues:
1) Pad properties dialog can trigger divide-by-zero when "0" is entered as the pad size
2) PNS router incorrectly detects collisions with blind/buried vias that don't actually intersect the active layer
3) PNS router silently converts blind/buried vias to through-board vias when shoved

To post a comment you must log in.
5028. By jean-pierre charras

Eeschema fixes: fix Bug #1348983 save cmp file crashes cvpcb when eeschema is opened (backannotation crashes). Happens only when some footprint names are not set (blank names).
Also fix incorrect backannotation when footprint names contain spaces (put spaces in names is always a bad idea)
* Fix minor Bug #1349058 Choose component dialog: Search field loses focus after entering a character and internationalize the dialog.
* Fix a subtle bug which prevent eeschema to read the project config file when launched from kicad manager, and when kicad.pro is not found.

5029. By Andrew Zonenberg

1) Pad properties dialog can trigger divide-by-zero when "0" is entered as the pad size
2) PNS router incorrectly detects collisions with blind/buried vias that don't actually intersect the active layer
3) PNS router silently converts blind/buried vias to through-board vias when shoved

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pcbnew/class_pad.cpp'
2--- pcbnew/class_pad.cpp 2014-07-09 12:01:06 +0000
3+++ pcbnew/class_pad.cpp 2014-07-27 19:08:20 +0000
4@@ -965,6 +965,11 @@
5 // Netnames will be shown only if zoom is appropriate
6 if( IsNetnameLayer( aLayer ) )
7 {
8+ // Pad sizes can be zero briefly when someone is typing a number like "0.5" in the pad properties dialog.
9+ // Fail gracefully if this happens.
10+ if( (m_Size.x == 0) && (m_Size.y == 0) )
11+ return UINT_MAX;
12+
13 return ( 100000000 / std::max( m_Size.x, m_Size.y ) );
14 }
15
16
17=== modified file 'pcbnew/router/pns_router.cpp'
18--- pcbnew/router/pns_router.cpp 2014-07-09 14:57:01 +0000
19+++ pcbnew/router/pns_router.cpp 2014-07-27 19:08:20 +0000
20@@ -227,12 +227,15 @@
21
22 PNS_ITEM* PNS_ROUTER::syncVia( VIA* aVia )
23 {
24+ LAYER_ID top, bottom;
25+ aVia->LayerPair(&top, &bottom);
26 PNS_VIA* v = new PNS_VIA(
27 aVia->GetPosition(),
28- PNS_LAYERSET( 0, MAX_CU_LAYERS - 1 ),
29+ PNS_LAYERSET( top, bottom ),
30 aVia->GetWidth(),
31 aVia->GetDrillValue(),
32- aVia->GetNetCode() );
33+ aVia->GetNetCode(),
34+ aVia->GetViaType() );
35
36 v->SetParent( aVia );
37
38@@ -759,8 +762,9 @@
39 via_board->SetWidth( via->Diameter() );
40 via_board->SetDrill( via->Drill() );
41 via_board->SetNetCode( via->Net() );
42- via_board->SetLayerPair( ToLAYER_ID( m_settings.GetLayerTop() ),
43- ToLAYER_ID( m_settings.GetLayerBottom() ) );
44+ via_board->SetViaType(via->ViaType()); //MUST be before SetLayerPair()
45+ via_board->SetLayerPair( ToLAYER_ID( via->Layers().Start() ),
46+ ToLAYER_ID( via->Layers().End() ) );
47 newBI = via_board;
48 break;
49 }
50
51=== modified file 'pcbnew/router/pns_via.cpp'
52--- pcbnew/router/pns_via.cpp 2014-05-16 11:37:31 +0000
53+++ pcbnew/router/pns_via.cpp 2014-07-27 19:08:20 +0000
54@@ -91,6 +91,7 @@
55 v->m_shape = SHAPE_CIRCLE( m_pos, m_diameter / 2 );
56 v->m_rank = m_rank;
57 v->m_marker = m_marker;
58+ v->m_viaType = m_viaType;
59
60 return v;
61 }
62
63=== modified file 'pcbnew/router/pns_via.h'
64--- pcbnew/router/pns_via.h 2014-05-29 11:48:14 +0000
65+++ pcbnew/router/pns_via.h 2014-07-27 19:08:20 +0000
66@@ -24,6 +24,8 @@
67 #include <geometry/shape_line_chain.h>
68 #include <geometry/shape_circle.h>
69
70+#include "../class_track.h"
71+
72 #include "pns_item.h"
73
74 class PNS_NODE;
75@@ -36,7 +38,7 @@
76 {}
77
78 PNS_VIA( const VECTOR2I& aPos, const PNS_LAYERSET& aLayers,
79- int aDiameter, int aDrill, int aNet = -1 ) :
80+ int aDiameter, int aDrill, int aNet = -1, VIATYPE_T aViaType = VIA_THROUGH ) :
81 PNS_ITEM( VIA )
82 {
83 SetNet( aNet );
84@@ -45,6 +47,7 @@
85 m_diameter = aDiameter;
86 m_drill = aDrill;
87 m_shape = SHAPE_CIRCLE( aPos, aDiameter / 2 );
88+ m_viaType = aViaType;
89 }
90
91
92@@ -60,6 +63,7 @@
93 m_rank = aB.m_rank;
94 m_owner = aB.m_owner;
95 m_drill = aB.m_drill;
96+ m_viaType = aB.m_viaType;
97 }
98
99 const VECTOR2I& Pos() const
100@@ -73,6 +77,16 @@
101 m_shape.SetCenter( aPos );
102 }
103
104+ VIATYPE_T ViaType() const
105+ {
106+ return m_viaType;
107+ }
108+
109+ void SetViaType(VIATYPE_T aViaType)
110+ {
111+ m_viaType = aViaType;
112+ }
113+
114 int Diameter() const
115 {
116 return m_diameter;
117@@ -124,6 +138,7 @@
118 int m_drill;
119 VECTOR2I m_pos;
120 SHAPE_CIRCLE m_shape;
121+ VIATYPE_T m_viaType;
122 };
123
124 #endif