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
64c1ea5c
Commit
64c1ea5c
authored
Jun 05, 2012
by
Marco Mattila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing checks and undo support to pcbnew zone duplication.
parent
27d6310c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
12 deletions
+58
-12
wxPcbStruct.h
include/wxPcbStruct.h
+8
-0
class_zone_settings.cpp
pcbnew/class_zone_settings.cpp
+1
-0
edit.cpp
pcbnew/edit.cpp
+1
-12
zones_by_polygon.cpp
pcbnew/zones_by_polygon.cpp
+47
-0
PolyLine.h
polygon/PolyLine.h
+1
-0
No files found.
include/wxPcbStruct.h
View file @
64c1ea5c
...
@@ -196,6 +196,14 @@ protected:
...
@@ -196,6 +196,14 @@ protected:
*/
*/
int
propagate
();
int
propagate
();
/**
* Function duplicateZone
* duplicates the given zone.
* @param aDC is the current Device Context.
* @param aZone is the zone to duplicate
*/
void
duplicateZone
(
wxDC
*
aDC
,
ZONE_CONTAINER
*
aZone
);
public
:
public
:
PCB_LAYER_BOX_SELECTOR
*
m_SelLayerBox
;
// a combo box to display and select active layer
PCB_LAYER_BOX_SELECTOR
*
m_SelLayerBox
;
// a combo box to display and select active layer
wxComboBox
*
m_SelTrackWidthBox
;
// a combo box to display and select current track width
wxComboBox
*
m_SelTrackWidthBox
;
// a combo box to display and select current track width
...
...
pcbnew/class_zone_settings.cpp
View file @
64c1ea5c
...
@@ -86,5 +86,6 @@ void ZONE_SETTINGS::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport ) c
...
@@ -86,5 +86,6 @@ void ZONE_SETTINGS::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport ) c
aTarget
.
SetPriority
(
m_ZonePriority
);
aTarget
.
SetPriority
(
m_ZonePriority
);
aTarget
.
SetNet
(
m_NetcodeSelection
);
aTarget
.
SetNet
(
m_NetcodeSelection
);
aTarget
.
SetLayer
(
m_CurrentZone_Layer
);
aTarget
.
SetLayer
(
m_CurrentZone_Layer
);
aTarget
.
m_Poly
->
SetLayer
(
m_CurrentZone_Layer
);
}
}
}
}
pcbnew/edit.cpp
View file @
64c1ea5c
...
@@ -470,18 +470,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
...
@@ -470,18 +470,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_PCB_ZONE_DUPLICATE
:
case
ID_POPUP_PCB_ZONE_DUPLICATE
:
{
{
ZONE_CONTAINER
*
zone
=
(
ZONE_CONTAINER
*
)
GetCurItem
();
ZONE_CONTAINER
*
zone
=
(
ZONE_CONTAINER
*
)
GetCurItem
();
ZONE_CONTAINER
*
newZone
=
new
ZONE_CONTAINER
(
m_Pcb
);
duplicateZone
(
&
dc
,
zone
);
newZone
->
Copy
(
zone
);
ZONE_SETTINGS
zoneSettings
;
zoneSettings
<<
*
zone
;
if
(
InvokeCopperZonesEditor
(
this
,
&
zoneSettings
)
)
{
zoneSettings
.
ExportSetting
(
*
newZone
);
m_Pcb
->
Add
(
newZone
);
newZone
->
Draw
(
m_canvas
,
&
dc
,
GR_OR
);
}
else
delete
newZone
;
}
}
break
;
break
;
...
...
pcbnew/zones_by_polygon.cpp
View file @
64c1ea5c
...
@@ -107,6 +107,53 @@ void PCB_EDIT_FRAME::Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* aZone )
...
@@ -107,6 +107,53 @@ void PCB_EDIT_FRAME::Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* aZone )
}
}
void
PCB_EDIT_FRAME
::
duplicateZone
(
wxDC
*
aDC
,
ZONE_CONTAINER
*
aZone
)
{
ZONE_CONTAINER
*
newZone
=
new
ZONE_CONTAINER
(
GetBoard
()
);
newZone
->
Copy
(
aZone
);
newZone
->
UnFill
();
ZONE_SETTINGS
zoneSettings
;
zoneSettings
<<
*
aZone
;
if
(
InvokeCopperZonesEditor
(
this
,
&
zoneSettings
)
)
{
zoneSettings
.
ExportSetting
(
*
newZone
);
newZone
->
m_Poly
->
Hatch
();
_AuxiliaryList
.
ClearListAndDeleteItems
();
s_PickedList
.
ClearListAndDeleteItems
();
SaveCopyOfZones
(
s_PickedList
,
GetBoard
(),
newZone
->
GetNet
(),
newZone
->
GetLayer
()
);
GetBoard
()
->
Add
(
newZone
);
ITEM_PICKER
picker
(
newZone
,
UR_NEW
);
s_PickedList
.
PushItem
(
picker
);
GetScreen
()
->
SetCurItem
(
NULL
);
// This outline may be deleted when merging outlines
// Combine zones if possible
GetBoard
()
->
AreaPolygonModified
(
&
_AuxiliaryList
,
newZone
,
true
,
s_Verbose
);
// Redraw zones
GetBoard
()
->
RedrawAreasOutlines
(
m_canvas
,
aDC
,
GR_OR
,
newZone
->
GetLayer
()
);
GetBoard
()
->
RedrawFilledAreas
(
m_canvas
,
aDC
,
GR_OR
,
newZone
->
GetLayer
()
);
if
(
GetBoard
()
->
GetAreaIndex
(
newZone
)
>=
0
&&
GetBoard
()
->
Test_Drc_Areas_Outlines_To_Areas_Outlines
(
newZone
,
true
)
)
{
DisplayError
(
this
,
_
(
"Duplicate Zone: The outline of the duplicated zone fails DRC check!"
)
);
}
UpdateCopyOfZonesList
(
s_PickedList
,
_AuxiliaryList
,
GetBoard
()
);
SaveCopyInUndoList
(
s_PickedList
,
UR_UNSPECIFIED
);
s_PickedList
.
ClearItemsList
();
OnModify
();
}
else
delete
newZone
;
}
int
PCB_EDIT_FRAME
::
Delete_LastCreatedCorner
(
wxDC
*
DC
)
int
PCB_EDIT_FRAME
::
Delete_LastCreatedCorner
(
wxDC
*
DC
)
{
{
ZONE_CONTAINER
*
zone
=
GetBoard
()
->
m_CurrentZoneContour
;
ZONE_CONTAINER
*
zone
=
GetBoard
()
->
m_CurrentZoneContour
;
...
...
polygon/PolyLine.h
View file @
64c1ea5c
...
@@ -159,6 +159,7 @@ public:
...
@@ -159,6 +159,7 @@ public:
void
AppendArc
(
int
xi
,
int
yi
,
int
xf
,
int
yf
,
int
xc
,
int
yc
,
int
num
);
void
AppendArc
(
int
xi
,
int
yi
,
int
xf
,
int
yf
,
int
xc
,
int
yc
,
int
num
);
// access functions
// access functions
void
SetLayer
(
int
aLayer
)
{
m_layer
=
aLayer
;
}
int
GetLayer
()
{
return
m_layer
;
}
int
GetLayer
()
{
return
m_layer
;
}
int
GetNumCorners
();
int
GetNumCorners
();
int
GetNumSides
();
int
GetNumSides
();
...
...
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