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
9bed4814
Commit
9bed4814
authored
Feb 18, 2015
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ratsnest update in 'Create array' tool (GAL).
parent
f06690c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
63 deletions
+18
-63
class_board.cpp
pcbnew/class_board.cpp
+6
-51
edit_tool.cpp
pcbnew/tools/edit_tool.cpp
+12
-12
No files found.
pcbnew/class_board.cpp
View file @
9bed4814
...
...
@@ -2635,66 +2635,18 @@ BOARD_ITEM* BOARD::DuplicateAndAddItem( const BOARD_ITEM* aItem,
new_module
->
IncrementReference
(
true
);
}
m_Modules
.
PushBack
(
new_module
);
new_item
=
new_module
;
break
;
}
case
PCB_TEXT_T
:
{
const
TEXTE_PCB
*
old_text
=
static_cast
<
const
TEXTE_PCB
*>
(
aItem
);
TEXTE_PCB
*
new_text
=
new
TEXTE_PCB
(
*
old_text
);
m_Drawings
.
PushBack
(
new_text
);
new_item
=
new_text
;
break
;
}
case
PCB_LINE_T
:
{
DRAWSEGMENT
*
new_edge
=
new
DRAWSEGMENT
(
*
static_cast
<
const
DRAWSEGMENT
*>
(
aItem
)
);
m_Drawings
.
PushBack
(
new_edge
);
new_item
=
new_edge
;
break
;
}
case
PCB_TRACE_T
:
{
TRACK
*
new_track
=
new
TRACK
(
*
static_cast
<
const
TRACK
*>
(
aItem
)
);
m_Track
.
PushBack
(
new_track
);
new_item
=
new_track
;
break
;
}
case
PCB_ZONE_AREA_T
:
{
ZONE_CONTAINER
*
new_zone
=
new
ZONE_CONTAINER
(
*
static_cast
<
const
ZONE_CONTAINER
*>
(
aItem
)
);
m_ZoneDescriptorList
.
push_back
(
new_zone
);
new_item
=
new_zone
;
break
;
}
case
PCB_TARGET_T
:
{
PCB_TARGET
*
new_target
=
new
PCB_TARGET
(
*
static_cast
<
const
PCB_TARGET
*>
(
aItem
)
);
m_Drawings
.
PushBack
(
new_target
);
new_item
=
new_target
;
break
;
}
case
PCB_DIMENSION_T
:
{
DIMENSION
*
new_dim
=
new
DIMENSION
(
*
static_cast
<
const
DIMENSION
*>
(
aItem
)
);
m_Drawings
.
PushBack
(
new_dim
);
new_item
=
new_dim
;
new_item
=
static_cast
<
BOARD_ITEM
*>
(
aItem
->
Clone
()
);
break
;
}
default
:
// Un-handled item for duplication
wxASSERT_MSG
(
false
,
"Duplication not supported for items of class "
...
...
@@ -2702,6 +2654,9 @@ BOARD_ITEM* BOARD::DuplicateAndAddItem( const BOARD_ITEM* aItem,
break
;
}
if
(
new_item
)
Add
(
new_item
);
return
new_item
;
}
...
...
@@ -2723,7 +2678,7 @@ wxString BOARD::GetNextModuleReferenceWithPrefix( const wxString& aPrefix,
continue
;
// the suffix must be a number
if
(
!
remainder
.
IsNumber
()
)
if
(
!
remainder
.
IsNumber
()
)
continue
;
long
number
;
...
...
pcbnew/tools/edit_tool.cpp
View file @
9bed4814
...
...
@@ -699,10 +699,10 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
BOARD_ITEM
*
new_item
=
NULL
;
if
(
PCB_EDIT_FRAME
*
frame
=
dynamic_cast
<
PCB_EDIT_FRAME
*>
(
editFrame
)
)
new_item
=
frame
->
GetBoard
()
->
DuplicateAndAddItem
(
item
,
increment
);
else
if
(
FOOTPRINT_EDIT_FRAME
*
frame
=
dynamic_cast
<
FOOTPRINT_EDIT_FRAME
*>
(
editFrame
)
)
new_item
=
frame
->
GetBoard
()
->
m_Modules
->
DuplicateAndAddItem
(
item
,
increment
);
if
(
m_editModules
)
new_item
=
editFrame
->
GetBoard
()
->
m_Modules
->
DuplicateAndAddItem
(
item
,
increment
);
else
new_item
=
editFrame
->
GetBoard
()
->
DuplicateAndAddItem
(
item
,
increment
);
if
(
new_item
)
{
...
...
@@ -759,9 +759,7 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
PCB_BASE_FRAME
*
editFrame
=
getEditFrame
<
PCB_BASE_FRAME
>
();
editFrame
->
OnModify
();
const
bool
editingModule
=
NULL
!=
dynamic_cast
<
FOOTPRINT_EDIT_FRAME
*>
(
editFrame
);
if
(
editingModule
)
if
(
m_editModules
)
{
// Module editors do their undo point upfront for the whole module
editFrame
->
SaveCopyInUndoList
(
editFrame
->
GetBoard
()
->
m_Modules
,
UR_MODEDIT
);
...
...
@@ -819,10 +817,10 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
// if renumbering, no need to increment
const
bool
increment
=
!
array_opts
->
ShouldRenumberItems
();
if
(
PCB_EDIT_FRAME
*
frame
=
dynamic_cast
<
PCB_EDIT_FRAME
*>
(
editFrame
)
)
newItem
=
frame
->
GetBoard
()
->
DuplicateAndAddItem
(
item
,
increment
);
else
if
(
FOOTPRINT_EDIT_FRAME
*
frame
=
dynamic_cast
<
FOOTPRINT_EDIT_FRAME
*>
(
editFrame
)
)
newItem
=
frame
->
GetBoard
()
->
m_Modules
->
DuplicateAndAddItem
(
item
,
increment
);
if
(
m_editModules
)
newItem
=
editFrame
->
GetBoard
()
->
m_Modules
->
DuplicateAndAddItem
(
item
,
increment
);
else
newItem
=
editFrame
->
GetBoard
()
->
DuplicateAndAddItem
(
item
,
increment
);
if
(
newItem
)
{
...
...
@@ -839,6 +837,7 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
}
editFrame
->
GetGalCanvas
()
->
GetView
()
->
Add
(
newItem
);
getModel
<
BOARD
>
()
->
GetRatsnest
()
->
Update
(
newItem
);
}
}
...
...
@@ -881,7 +880,7 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
}
}
if
(
!
editingModule
)
if
(
!
m_editModules
)
{
if
(
originalItemsModified
)
{
...
...
@@ -896,6 +895,7 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
}
}
getModel
<
BOARD
>
()
->
GetRatsnest
()
->
Recalculate
();
setTransitions
();
return
0
;
...
...
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