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
ccb74b99
Commit
ccb74b99
authored
Aug 04, 2012
by
Miguel Angel Ajo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcbnew: footprint wizards now can export the output module to the library or board
parent
9d5e2713
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
10 deletions
+44
-10
footprint_wizard.cpp
pcbnew/footprint_wizard.cpp
+5
-0
footprint_wizard_frame.cpp
pcbnew/footprint_wizard_frame.cpp
+14
-5
footprint_wizard_frame.h
pcbnew/footprint_wizard_frame.h
+7
-1
modedit.cpp
pcbnew/modedit.cpp
+18
-4
No files found.
pcbnew/footprint_wizard.cpp
View file @
ccb74b99
...
...
@@ -110,6 +110,11 @@ void FOOTPRINT_WIZARD_FRAME::ReloadFootprint()
m_canvas
->
Refresh
();
}
MODULE
*
FOOTPRINT_WIZARD_FRAME
::
GetBuiltFootprint
()
{
return
m_FootprintWizard
->
GetModule
();
}
void
FOOTPRINT_WIZARD_FRAME
::
SelectFootprintWizard
()
{
DIALOG_FOOTPRINT_WIZARD_LIST
*
selectWizard
=
...
...
pcbnew/footprint_wizard_frame.cpp
View file @
ccb74b99
...
...
@@ -69,8 +69,10 @@ BEGIN_EVENT_TABLE( FOOTPRINT_WIZARD_FRAME, EDA_DRAW_FRAME )
EVT_TOOL
(
ID_FOOTPRINT_WIZARD_PREVIOUS
,
FOOTPRINT_WIZARD_FRAME
::
Process_Special_Functions
)
/* EVT_TOOL( ID_FOOTPRINT_WIZARD_DONE,
FOOTPRINT_WIZARD_FRAME::ExportSelectedFootprint )*/
EVT_TOOL
(
ID_FOOTPRINT_WIZARD_DONE
,
FOOTPRINT_WIZARD_FRAME
::
ExportSelectedFootprint
)
EVT_TOOL
(
ID_FOOTPRINT_WIZARD_SHOW_3D_VIEW
,
FOOTPRINT_WIZARD_FRAME
::
Show3D_Frame
)
...
...
@@ -271,6 +273,13 @@ FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME()
*/
void
FOOTPRINT_WIZARD_FRAME
::
OnCloseWindow
(
wxCloseEvent
&
Event
)
{
wxCommandEvent
fakeEvent
;
ExportSelectedFootprint
(
fakeEvent
);
}
void
FOOTPRINT_WIZARD_FRAME
::
ExportSelectedFootprint
(
wxCommandEvent
&
aEvent
)
{
SaveSettings
();
if
(
m_Semaphore
)
...
...
@@ -284,6 +293,8 @@ void FOOTPRINT_WIZARD_FRAME::OnCloseWindow( wxCloseEvent& Event )
{
Destroy
();
}
}
...
...
@@ -723,16 +734,14 @@ void FOOTPRINT_WIZARD_FRAME::ReCreateHToolbar()
HK_ZOOM_AUTO
,
IS_COMMENT
);
m_mainToolBar
->
AddTool
(
ID_ZOOM_PAGE
,
wxEmptyString
,
KiBitmap
(
zoom_fit_in_page_xpm
),
msg
);
#if 0
if
(
m_Semaphore
)
{
// The library browser is called from a "load component" command
m_mainToolBar
->
AddSeparator
();
m_mainToolBar->AddTool( ID_FOOTPRINT_WIZARD_
FOOTPRINT_EXPORT_TO_BOARD
,
m_mainToolBar
->
AddTool
(
ID_FOOTPRINT_WIZARD_
DONE
,
wxEmptyString
,
KiBitmap
(
export_footprint_names_xpm
),
_
(
"Insert footprint in board"
)
);
}
#endif
// after adding the buttons to the toolbar, must call Realize() to
// reflect the changes
...
...
pcbnew/footprint_wizard_frame.h
View file @
ccb74b99
...
...
@@ -72,11 +72,17 @@ public:
~
FOOTPRINT_WIZARD_FRAME
();
MODULE
*
GetBuiltFootrint
(
void
);
MODULE
*
GetBuiltFoot
p
rint
(
void
);
private
:
void
OnSize
(
wxSizeEvent
&
event
);
/**
* Function ExportSelectedFootprint();
* will let the caller exit from the wait loop, and get the built footprint
*
*/
void
ExportSelectedFootprint
(
wxCommandEvent
&
aEvent
);
/**
* Function OnSashDrag
...
...
pcbnew/modedit.cpp
View file @
ccb74b99
...
...
@@ -293,14 +293,26 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
SetCurItem
(
NULL
);
GetScreen
()
->
SetCrossHairPosition
(
wxPoint
(
0
,
0
)
);
MODULE
*
module
=
NULL
;
FOOTPRINT_WIZARD_FRAME
*
wizard
=
new
FOOTPRINT_WIZARD_FRAME
(
this
,
NULL
);
wxSemaphore
semaphore
(
0
,
1
);
FOOTPRINT_WIZARD_FRAME
*
wizard
=
new
FOOTPRINT_WIZARD_FRAME
(
this
,
&
semaphore
);
wizard
->
Show
(
true
);
wizard
->
Zoom_Automatique
(
false
);
while
(
semaphore
.
TryWait
()
==
wxSEMA_BUSY
)
// Wait for viewer closing event
{
wxYield
();
wxMilliSleep
(
50
);
}
MODULE
*
module
=
wizard
->
GetBuiltFootprint
();
if
(
module
)
// i.e. if create module command not aborted
{
/* Here we should make a copy of the object before adding to board*/
module
->
SetParent
(
(
EDA_ITEM
*
)
GetBoard
()
);
GetBoard
()
->
m_Modules
.
Append
(
module
);
// Initialize data relative to nets and netclasses (for a new
// module the defaults are used)
// This is mandatory to handle and draw pads
...
...
@@ -311,8 +323,10 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
if
(
GetBoard
()
->
m_Modules
)
GetBoard
()
->
m_Modules
->
ClearFlags
();
Zoom_Automatique
(
false
);
}
wizard
->
Destroy
();
break
;
}
...
...
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