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
655721d9
Commit
655721d9
authored
May 22, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing changes required for updating footprints with the module editor.
parent
957f959e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
edit_tool.cpp
pcbnew/tools/edit_tool.cpp
+10
-8
xchgmod.cpp
pcbnew/xchgmod.cpp
+15
-0
No files found.
pcbnew/tools/edit_tool.cpp
View file @
655721d9
...
@@ -229,8 +229,6 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent )
...
@@ -229,8 +229,6 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent )
// Check if user wants to edit pad or module properties
// Check if user wants to edit pad or module properties
if
(
item
->
Type
()
==
PCB_MODULE_T
)
if
(
item
->
Type
()
==
PCB_MODULE_T
)
{
{
item
->
ClearFlags
();
// Necessary for having an undo entry
for
(
D_PAD
*
pad
=
static_cast
<
MODULE
*>
(
item
)
->
Pads
();
pad
;
pad
=
pad
->
Next
()
)
for
(
D_PAD
*
pad
=
static_cast
<
MODULE
*>
(
item
)
->
Pads
();
pad
;
pad
=
pad
->
Next
()
)
{
{
if
(
pad
->
ViewBBox
().
Contains
(
getViewControls
()
->
GetCursorPosition
()
)
)
if
(
pad
->
ViewBBox
().
Contains
(
getViewControls
()
->
GetCursorPosition
()
)
)
...
@@ -244,6 +242,11 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent )
...
@@ -244,6 +242,11 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent )
std
::
vector
<
PICKED_ITEMS_LIST
*>&
undoList
=
editFrame
->
GetScreen
()
->
m_UndoList
.
m_CommandsList
;
std
::
vector
<
PICKED_ITEMS_LIST
*>&
undoList
=
editFrame
->
GetScreen
()
->
m_UndoList
.
m_CommandsList
;
// Some of properties dialogs alter pointers, so we should deselect them
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
selectionClear
);
STATUS_FLAGS
flags
=
item
->
GetFlags
();
item
->
ClearFlags
();
// It is necessary to determine if anything has changed
// It is necessary to determine if anything has changed
PICKED_ITEMS_LIST
*
lastChange
=
undoList
.
empty
()
?
NULL
:
undoList
.
back
();
PICKED_ITEMS_LIST
*
lastChange
=
undoList
.
empty
()
?
NULL
:
undoList
.
back
();
...
@@ -254,17 +257,15 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent )
...
@@ -254,17 +257,15 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent )
if
(
lastChange
!=
currentChange
)
// Something has changed
if
(
lastChange
!=
currentChange
)
// Something has changed
{
{
// Some of properties dialogs alter pointers, so we should deselect them
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
selectionClear
);
processChanges
(
currentChange
);
processChanges
(
currentChange
);
// Seems unnecessary, as the items are removed/added to the board
updateRatsnest
(
true
);
// updateRatsnest( true );
getModel
<
BOARD
>
(
PCB_T
)
->
GetRatsnest
()
->
Recalculate
();
// getModel<BOARD>( PCB_T )->GetRatsnest()->Recalculate();
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
pointEditorUpdate
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
pointEditorUpdate
);
}
}
item
->
SetFlags
(
flags
);
}
}
if
(
unselect
)
if
(
unselect
)
...
@@ -554,6 +555,7 @@ void EDIT_TOOL::processChanges( const PICKED_ITEMS_LIST* aList )
...
@@ -554,6 +555,7 @@ void EDIT_TOOL::processChanges( const PICKED_ITEMS_LIST* aList )
getView
(),
_1
)
);
getView
(),
_1
)
);
getView
()
->
Add
(
updItem
);
getView
()
->
Add
(
updItem
);
updItem
->
ViewUpdate
();
break
;
break
;
default
:
default
:
...
...
pcbnew/xchgmod.cpp
View file @
655721d9
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include <fctsys.h>
#include <fctsys.h>
#include <class_drawpanel.h>
#include <class_drawpanel.h>
#include <class_draw_panel_gal.h>
#include <confirm.h>
#include <confirm.h>
#include <kicad_string.h>
#include <kicad_string.h>
#include <wxPcbStruct.h>
#include <wxPcbStruct.h>
...
@@ -44,6 +45,8 @@
...
@@ -44,6 +45,8 @@
#include <dialog_exchange_modules_base.h>
#include <dialog_exchange_modules_base.h>
#include <wildcards_and_files_ext.h>
#include <wildcards_and_files_ext.h>
#include <boost/bind.hpp>
static
bool
RecreateCmpFile
(
BOARD
*
aBrd
,
const
wxString
&
aFullCmpFileName
);
static
bool
RecreateCmpFile
(
BOARD
*
aBrd
,
const
wxString
&
aFullCmpFileName
);
class
DIALOG_EXCHANGE_MODULE
:
public
DIALOG_EXCHANGE_MODULE_BASE
class
DIALOG_EXCHANGE_MODULE
:
public
DIALOG_EXCHANGE_MODULE_BASE
...
@@ -470,9 +473,21 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aOldModule,
...
@@ -470,9 +473,21 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aOldModule,
ITEM_PICKER
picker_new
(
aNewModule
,
UR_NEW
);
ITEM_PICKER
picker_new
(
aNewModule
,
UR_NEW
);
aUndoPickList
->
PushItem
(
picker_old
);
aUndoPickList
->
PushItem
(
picker_old
);
aUndoPickList
->
PushItem
(
picker_new
);
aUndoPickList
->
PushItem
(
picker_new
);
if
(
IsGalCanvasActive
()
)
{
KIGFX
::
VIEW
*
view
=
GetGalCanvas
()
->
GetView
();
aOldModule
->
RunOnChildren
(
boost
::
bind
(
&
KIGFX
::
VIEW
::
Remove
,
view
,
_1
)
);
view
->
Remove
(
aOldModule
);
aNewModule
->
RunOnChildren
(
boost
::
bind
(
&
KIGFX
::
VIEW
::
Add
,
view
,
_1
)
);
view
->
Add
(
aNewModule
);
}
}
}
else
else
{
{
GetGalCanvas
()
->
GetView
()
->
Remove
(
aOldModule
);
aOldModule
->
DeleteStructure
();
aOldModule
->
DeleteStructure
();
}
}
...
...
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