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
a24576f3
Commit
a24576f3
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial version of the GAL-based Module Editor.
parent
8a5fedb7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
0 deletions
+69
-0
loadcmp.cpp
pcbnew/loadcmp.cpp
+10
-0
modedit.cpp
pcbnew/modedit.cpp
+13
-0
module_editor_frame.h
pcbnew/module_editor_frame.h
+3
-0
moduleframe.cpp
pcbnew/moduleframe.cpp
+42
-0
edit_tool.cpp
pcbnew/tools/edit_tool.cpp
+1
-0
No files found.
pcbnew/loadcmp.cpp
View file @
a24576f3
...
...
@@ -30,6 +30,7 @@
#include <fctsys.h>
#include <class_drawpanel.h>
#include <pcb_draw_panel_gal.h>
#include <confirm.h>
#include <eda_doc.h>
#include <kicad_string.h>
...
...
@@ -117,6 +118,15 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
GetScreen
()
->
ClrModify
();
Zoom_Automatique
(
false
);
if
(
IsGalCanvasActive
()
)
{
static_cast
<
PCB_DRAW_PANEL_GAL
*>
(
GetGalCanvas
()
)
->
DisplayBoard
(
GetBoard
()
);
m_Pcb
->
ComputeBoundingBox
(
false
);
EDA_RECT
boardBbox
=
m_Pcb
->
GetBoundingBox
();
GetGalCanvas
()
->
GetView
()
->
SetViewport
(
BOX2D
(
boardBbox
.
GetOrigin
(),
boardBbox
.
GetSize
()
)
);
}
return
true
;
}
...
...
pcbnew/modedit.cpp
View file @
a24576f3
...
...
@@ -29,6 +29,7 @@
#include <kiface_i.h>
#include <kiway.h>
#include <class_drawpanel.h>
#include <pcb_draw_panel_gal.h>
#include <confirm.h>
#include <gestfich.h>
#include <pgm_base.h>
...
...
@@ -914,3 +915,15 @@ EDA_COLOR_T FOOTPRINT_EDIT_FRAME::GetGridColor() const
return
g_ColorsSettings
.
GetItemColor
(
GRID_VISIBLE
);
}
void
FOOTPRINT_EDIT_FRAME
::
UseGalCanvas
(
bool
aEnable
)
{
EDA_DRAW_FRAME
::
UseGalCanvas
(
aEnable
);
if
(
aEnable
)
{
SetBoard
(
m_Pcb
);
GetGalCanvas
()
->
StartDrawing
();
}
}
pcbnew/module_editor_frame.h
View file @
a24576f3
...
...
@@ -399,6 +399,9 @@ public:
virtual
EDA_COLOR_T
GetGridColor
()
const
;
///> @copydoc EDA_DRAW_FRAME::UseGalCanvas()
virtual
void
UseGalCanvas
(
bool
aEnable
);
DECLARE_EVENT_TABLE
()
protected
:
...
...
pcbnew/moduleframe.cpp
View file @
a24576f3
...
...
@@ -35,6 +35,7 @@
#include <project.h>
#include <kicad_plugin.h>
#include <class_drawpanel.h>
#include <pcb_draw_panel_gal.h>
#include <confirm.h>
#include <wxPcbStruct.h>
#include <dialog_helpers.h>
...
...
@@ -52,6 +53,15 @@
#include <module_editor_frame.h>
#include <wildcards_and_files_ext.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include "tools/selection_tool.h"
#include "tools/edit_tool.h"
#include "tools/drawing_tool.h"
#include "tools/point_editor.h"
#include "tools/pcbnew_control.h"
#include "tools/common_actions.h"
BEGIN_EVENT_TABLE
(
FOOTPRINT_EDIT_FRAME
,
PCB_BASE_FRAME
)
EVT_MENU_RANGE
(
ID_POPUP_PCB_ITEM_SELECTION_START
,
ID_POPUP_PCB_ITEM_SELECTION_END
,
...
...
@@ -167,6 +177,12 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
// Show a title (frame title + footprint name):
updateTitle
();
// Create GAL canvas
EDA_DRAW_FRAME
*
drawFrame
=
static_cast
<
EDA_DRAW_FRAME
*>
(
aParent
);
PCB_DRAW_PANEL_GAL
*
drawPanel
=
new
PCB_DRAW_PANEL_GAL
(
this
,
-
1
,
wxPoint
(
0
,
0
),
m_FrameSize
,
drawFrame
->
GetGalCanvas
()
->
GetBackend
()
);
SetGalCanvas
(
drawPanel
);
SetBoard
(
new
BOARD
()
);
// restore the last footprint from the project, if any
...
...
@@ -224,11 +240,37 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_auimgr
.
AddPane
(
m_canvas
,
wxAuiPaneInfo
().
Name
(
wxT
(
"DrawFrame"
)
).
CentrePane
()
);
m_auimgr
.
AddPane
(
(
wxWindow
*
)
GetGalCanvas
(),
wxAuiPaneInfo
().
Name
(
wxT
(
"DrawFrameGal"
)
).
CentrePane
().
Hide
()
);
m_auimgr
.
AddPane
(
m_messagePanel
,
wxAuiPaneInfo
(
mesg_pane
).
Name
(
wxT
(
"MsgPanel"
)
).
Bottom
().
Layer
(
10
)
);
m_auimgr
.
Update
();
if
(
drawFrame
->
IsGalCanvasActive
()
)
{
drawPanel
->
DisplayBoard
(
GetBoard
()
);
// Create the manager and dispatcher & route draw panel events to the dispatcher
m_toolManager
=
new
TOOL_MANAGER
;
m_toolManager
->
SetEnvironment
(
GetBoard
(),
drawPanel
->
GetView
(),
drawPanel
->
GetViewControls
(),
this
);
m_toolDispatcher
=
new
TOOL_DISPATCHER
(
m_toolManager
);
drawPanel
->
SetEventDispatcher
(
m_toolDispatcher
);
m_toolManager
->
RegisterTool
(
new
SELECTION_TOOL
);
m_toolManager
->
RegisterTool
(
new
EDIT_TOOL
);
m_toolManager
->
RegisterTool
(
new
DRAWING_TOOL
);
m_toolManager
->
RegisterTool
(
new
POINT_EDITOR
);
m_toolManager
->
RegisterTool
(
new
PCBNEW_CONTROL
);
m_toolManager
->
ResetTools
(
TOOL_BASE
::
RUN
);
// Run the selection tool, it is supposed to be always active
m_toolManager
->
InvokeTool
(
"pcbnew.InteractiveSelection"
);
UseGalCanvas
(
true
);
}
}
...
...
pcbnew/tools/edit_tool.cpp
View file @
a24576f3
...
...
@@ -545,6 +545,7 @@ void EDIT_TOOL::processChanges( const PICKED_ITEMS_LIST* aList )
switch
(
operation
)
{
case
UR_CHANGED
:
case
UR_MODEDIT
:
updItem
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
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