Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
249267ed
Commit
249267ed
authored
Dec 05, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: fix minor bug in via edition.
parent
61edf743
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
21 deletions
+25
-21
edit_track_width.cpp
pcbnew/edit_track_width.cpp
+17
-7
onrightclick.cpp
pcbnew/onrightclick.cpp
+7
-13
version.txt
version.txt
+1
-1
No files found.
pcbnew/edit_track_width.cpp
View file @
249267ed
...
@@ -28,7 +28,8 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem,
...
@@ -28,7 +28,8 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem,
PICKED_ITEMS_LIST
*
aItemsListPicker
,
PICKED_ITEMS_LIST
*
aItemsListPicker
,
bool
aUseNetclassValue
)
bool
aUseNetclassValue
)
{
{
int
initial_width
,
new_width
,
new_drill
=
-
1
;
int
initial_width
,
new_width
;
int
initial_drill
=
-
1
,
new_drill
=
-
1
;
bool
change_ok
=
false
;
bool
change_ok
=
false
;
NETINFO_ITEM
*
net
=
NULL
;
NETINFO_ITEM
*
net
=
NULL
;
...
@@ -36,12 +37,15 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem,
...
@@ -36,12 +37,15 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem,
net
=
GetBoard
()
->
FindNet
(
aTrackItem
->
GetNet
()
);
net
=
GetBoard
()
->
FindNet
(
aTrackItem
->
GetNet
()
);
initial_width
=
aTrackItem
->
m_Width
;
initial_width
=
aTrackItem
->
m_Width
;
if
(
net
)
if
(
net
)
new_width
=
net
->
GetTrackWidth
();
new_width
=
net
->
GetTrackWidth
();
else
else
new_width
=
GetBoard
()
->
GetCurrentTrackWidth
();
new_width
=
GetBoard
()
->
GetCurrentTrackWidth
();
if
(
aTrackItem
->
Type
()
==
TYPE_VIA
)
if
(
aTrackItem
->
Type
()
==
TYPE_VIA
)
{
{
if
(
!
aTrackItem
->
IsDrillDefault
()
)
initial_drill
=
aTrackItem
->
GetDrillValue
();
if
(
net
)
if
(
net
)
new_width
=
net
->
GetViaSize
();
new_width
=
net
->
GetViaSize
();
else
else
...
@@ -57,11 +61,6 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem,
...
@@ -57,11 +61,6 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem,
new_width
=
net
->
GetMicroViaSize
();
new_width
=
net
->
GetMicroViaSize
();
}
}
// Set drill value. Note: currently microvias have only a default drill value
if
(
new_drill
>
0
)
aTrackItem
->
SetDrillValue
(
new_drill
);
else
aTrackItem
->
SetDrillDefault
(
);
}
}
aTrackItem
->
m_Width
=
new_width
;
aTrackItem
->
m_Width
=
new_width
;
...
@@ -76,7 +75,10 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem,
...
@@ -76,7 +75,10 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem,
else
if
(
initial_width
>
new_width
)
else
if
(
initial_width
>
new_width
)
change_ok
=
true
;
change_ok
=
true
;
// if new width == initial_width: do nothing
// if new width == initial_width: do nothing,
// unless a via has its drill value changed
else
if
(
(
aTrackItem
->
Type
()
==
TYPE_VIA
)
&&
(
initial_drill
!=
new_drill
)
)
change_ok
=
true
;
if
(
change_ok
)
if
(
change_ok
)
{
{
...
@@ -88,6 +90,14 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem,
...
@@ -88,6 +90,14 @@ bool WinEDA_PcbFrame::SetTrackSegmentWidth( TRACK* aTrackItem,
picker
.
m_Link
=
aTrackItem
->
Copy
();
picker
.
m_Link
=
aTrackItem
->
Copy
();
aItemsListPicker
->
PushItem
(
picker
);
aItemsListPicker
->
PushItem
(
picker
);
aTrackItem
->
m_Width
=
new_width
;
aTrackItem
->
m_Width
=
new_width
;
if
(
aTrackItem
->
Type
()
==
TYPE_VIA
)
{
// Set new drill value. Note: currently microvias have only a default drill value
if
(
new_drill
>
0
)
aTrackItem
->
SetDrillValue
(
new_drill
);
else
aTrackItem
->
SetDrillDefault
(
);
}
}
}
}
}
else
else
...
...
pcbnew/onrightclick.cpp
View file @
249267ed
...
@@ -471,28 +471,22 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
...
@@ -471,28 +471,22 @@ void WinEDA_PcbFrame::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu )
{
{
if
(
Track
->
Type
()
==
TYPE_VIA
)
if
(
Track
->
Type
()
==
TYPE_VIA
)
{
{
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_EDIT_TRACKSEG
,
_
(
msg
=
AddHotkeyName
(
_
(
"Change Via Size and Drill"
),
g_Board_Editor_Hokeys_Descr
,
HK_EDIT_ITEM
);
"Change Via Size and Drill"
)
,
width_segment_xpm
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_EDIT_TRACKSEG
,
msg
,
width_segment_xpm
);
}
}
else
else
{
{
msg
=
AddHotkeyName
(
_
(
"Change Segment Width"
),
g_Board_Editor_Hokeys_Descr
,
HK_EDIT_ITEM
);
msg
=
AddHotkeyName
(
_
(
"Change Segment Width"
),
g_Board_Editor_Hokeys_Descr
,
HK_EDIT_ITEM
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_EDIT_TRACKSEG
,
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_EDIT_TRACKSEG
,
msg
,
width_segment_xpm
);
msg
,
width_segment_xpm
);
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_EDIT_TRACK
,
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_PCB_EDIT_TRACK
,
_
(
"Change Track Width"
),
width_track_xpm
);
_
(
"Change Track Width"
),
width_track_xpm
);
}
}
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
Append_Track_Width_List
(
GetBoard
()
),
ID_POPUP_PCB_SELECT_WIDTH
,
_
(
"Select Track Width"
),
width_track_xpm
);
}
}
else
// Allows switching to an other track/via size when routing
// Allows switching to an other track/via size when routing
{
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
Append_Track_Width_List
(
GetBoard
()
),
ADD_MENUITEM_WITH_SUBMENU
(
PopMenu
,
Append_Track_Width_List
(
GetBoard
()
),
ID_POPUP_PCB_SELECT_WIDTH
,
ID_POPUP_PCB_SELECT_WIDTH
,
_
(
"Select Track Width"
),
width_track_xpm
);
_
(
"Select Track Width"
),
width_track_xpm
);
}
// Delete control:
// Delete control:
PopMenu
->
AppendSeparator
();
PopMenu
->
AppendSeparator
();
...
...
version.txt
View file @
249267ed
release version:
release version:
2010 dec 03 (BZR R2
365
)
2010 dec 03 (BZR R2
639
)
files (.zip,.tgz):
files (.zip,.tgz):
kicad-2010-12-03-testing
kicad-2010-12-03-testing
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment