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
7e76fd08
Commit
7e76fd08
authored
Apr 28, 2015
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move teardrops editor to tool framework
parent
a1ac84e5
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
42 additions
and
20 deletions
+42
-20
CMakeLists.txt
common/CMakeLists.txt
+0
-1
CMakeLists.txt
pcbnew/CMakeLists.txt
+1
-0
class_teardrop.cpp
pcbnew/class_teardrop.cpp
+1
-1
dialog_teardrops_base.cpp
pcbnew/dialogs/dialog_teardrops_base.cpp
+1
-1
dialog_teardrops_base.fbp
pcbnew/dialogs/dialog_teardrops_base.fbp
+1
-1
pcbframe.cpp
pcbnew/pcbframe.cpp
+2
-5
common_actions.cpp
pcbnew/tools/common_actions.cpp
+4
-0
common_actions.h
pcbnew/tools/common_actions.h
+3
-0
edit_teardrops.cpp
pcbnew/tools/edit_teardrops.cpp
+18
-7
edit_teardrops.h
pcbnew/tools/edit_teardrops.h
+8
-3
tools_common.cpp
pcbnew/tools/tools_common.cpp
+3
-1
No files found.
common/CMakeLists.txt
View file @
7e76fd08
...
...
@@ -279,7 +279,6 @@ set( PCB_COMMON_SRCS
../pcbnew/class_zone.cpp
../pcbnew/class_zone_settings.cpp
../pcbnew/class_teardrop.cpp
../pcbnew/edit_teardrops.cpp
../pcbnew/classpcb.cpp
../pcbnew/ratsnest_data.cpp
../pcbnew/ratsnest_viewitem.cpp
...
...
pcbnew/CMakeLists.txt
View file @
7e76fd08
...
...
@@ -276,6 +276,7 @@ set( PCBNEW_CLASS_SRCS
tools/bright_box.cpp
tools/edit_points.cpp
tools/edit_constraints.cpp
tools/edit_teardrops.cpp
tools/point_editor.cpp
tools/drawing_tool.cpp
tools/edit_tool.cpp
...
...
pcbnew/class_teardrop.cpp
View file @
7e76fd08
...
...
@@ -80,7 +80,7 @@ bool TEARDROP::CurvedSegments(TRACK &aTrack, const VIA &aVia, std::vector<VECTOR
// Check that the track is not too short
double
segOutsideVia
=
aTrack
.
GetLength
()
-
(
aVia
.
GetWidth
()
/
2
);
double
minLength
=
(
9
0
*
aVia
.
GetWidth
()
/
2
)
/
100
;
double
minLength
=
(
15
0
*
aVia
.
GetWidth
()
/
2
)
/
100
;
if
(
segOutsideVia
<
minLength
)
{
return
false
;
}
...
...
pcbnew/dialogs/dialog_teardrops_base.cpp
View file @
7e76fd08
...
...
@@ -88,7 +88,7 @@ DIALOG_TEARDROPS_BASE::DIALOG_TEARDROPS_BASE( wxWindow* parent, wxWindowID id, c
m_scopeVias
->
SetValue
(
true
);
sbSizer16
->
Add
(
m_scopeVias
,
0
,
0
,
5
);
m_scopePads
=
new
wxCheckBox
(
this
,
wxID_ANY
,
wxT
(
"
P
ads"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_scopePads
=
new
wxCheckBox
(
this
,
wxID_ANY
,
wxT
(
"
Circular p
ads"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_scopePads
->
SetValue
(
true
);
sbSizer16
->
Add
(
m_scopePads
,
0
,
0
,
5
);
...
...
pcbnew/dialogs/dialog_teardrops_base.fbp
View file @
7e76fd08
...
...
@@ -689,7 +689,7 @@
<property
name=
"font"
></property>
<property
name=
"hidden"
>
0
</property>
<property
name=
"id"
>
wxID_ANY
</property>
<property
name=
"label"
>
P
ads
</property>
<property
name=
"label"
>
Circular p
ads
</property>
<property
name=
"maximum_size"
></property>
<property
name=
"minimum_size"
></property>
<property
name=
"name"
>
m_scopePads
</property>
...
...
pcbnew/pcbframe.cpp
View file @
7e76fd08
...
...
@@ -62,11 +62,10 @@
#include <class_track.h>
#include <class_board.h>
#include <class_module.h>
//#include <class_teardrop.h>
#include <worksheet_viewitem.h>
#include <ratsnest_data.h>
#include <ratsnest_viewitem.h>
#include <edit_teardrops.h>
#include <
tools/
edit_teardrops.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
...
...
@@ -735,9 +734,7 @@ void PCB_EDIT_FRAME::ShowTeardropsEditor( wxCommandEvent& event )
int
retVal
=
dlg_teardrops
->
ShowModal
();
if
(
retVal
==
wxID_OK
)
{
SELECTION
selection
=
m_toolManager
->
GetTool
<
SELECTION_TOOL
>
()
->
GetSelection
();
TEARDROPS_EDITOR
editor
(
this
,
GetGalCanvas
()
->
GetView
());
editor
.
EditTeardrops
(
selection
,
settings
);
m_toolManager
->
GetTool
<
TEARDROPS_EDITOR
>
()
->
EditTeardrops
(
settings
);
OnModify
();
}
}
...
...
pcbnew/tools/common_actions.cpp
View file @
7e76fd08
...
...
@@ -458,6 +458,10 @@ TOOL_ACTION COMMON_ACTIONS::routerInlineDrag( "pcbnew.InteractiveRouter.InlineDr
AS_GLOBAL
,
0
,
""
,
""
);
TOOL_ACTION
COMMON_ACTIONS
::
teardropsEditor
(
"pcbnew.TeardropsEditor.EditTeardrops"
,
AS_GLOBAL
,
0
,
_
(
"Run teardrops editor"
),
_
(
"Run teardrops editor"
),
NULL
,
AF_ACTIVATE
);
// Point editor
TOOL_ACTION
COMMON_ACTIONS
::
pointEditorUpdate
(
"pcbnew.PointEditor.update"
,
AS_GLOBAL
,
0
,
...
...
pcbnew/tools/common_actions.h
View file @
7e76fd08
...
...
@@ -281,6 +281,9 @@ public:
static
TOOL_ACTION
copySettingsToPads
;
static
TOOL_ACTION
globalEditPads
;
/// Activate teardrops editor
static
TOOL_ACTION
teardropsEditor
;
/**
* Function TranslateLegacyId()
...
...
pcbnew/edit_teardrops.cpp
→
pcbnew/
tools/
edit_teardrops.cpp
View file @
7e76fd08
...
...
@@ -3,12 +3,22 @@
#include "class_module.h"
#include "ratsnest_data.h"
#include "view/view.h"
#include "common_actions.h"
#include "router/pns_utils.h"
TEARDROPS_EDITOR
::
TEARDROPS_EDITOR
(
PCB_EDIT_FRAME
*
frame
,
KIGFX
::
VIEW
*
view
)
TEARDROPS_EDITOR
::
TEARDROPS_EDITOR
()
:
TOOL_BASE
(
BATCH
,
TOOL_MANAGER
::
MakeToolId
(
"pcbnew.TeardropsEditor"
),
"pcbnew.TeardropsEditor"
)
{
m_frame
=
frame
;
m_view
=
view
;
}
TEARDROPS_EDITOR
::~
TEARDROPS_EDITOR
()
{
}
void
TEARDROPS_EDITOR
::
Reset
(
RESET_REASON
aReason
)
{
m_frame
=
getEditFrame
<
PCB_EDIT_FRAME
>
();
m_view
=
getView
();
}
void
TEARDROPS_EDITOR
::
FilterSelection
(
SELECTION
&
selection
)
...
...
@@ -23,9 +33,10 @@ void TEARDROPS_EDITOR::FilterSelection(SELECTION &selection)
}
}
bool
TEARDROPS_EDITOR
::
EditTeardrops
(
SELECTION
&
selection
,
const
DIALOG_TEARDROPS
::
TEARDROPS_SETTINGS
&
settings
)
bool
TEARDROPS_EDITOR
::
EditTeardrops
(
const
DIALOG_TEARDROPS
::
TEARDROPS_SETTINGS
&
settings
)
{
bool
retVal
=
false
;
SELECTION
selection
=
GetManager
()
->
GetTool
<
SELECTION_TOOL
>
()
->
GetSelection
();
switch
(
settings
.
m_type
)
{
case
DIALOG_TEARDROPS
:
:
TEARDROPS_TYPE_CURVED
:
...
...
@@ -103,9 +114,9 @@ bool TEARDROPS_EDITOR::AddToSelected(SELECTION &selection, const DIALOG_TEARDROP
DrawSegments
(
teardropStart
,
*
track
);
added
=
true
;
}
if
(
settings
.
m_clearSelection
==
true
)
{
track
->
ClearSelected
();
}
if
(
settings
.
m_clearSelection
==
true
)
{
GetManager
()
->
RunAction
(
COMMON_ACTIONS
::
selectionClear
,
true
);
}
if
(
added
==
true
)
{
...
...
pcbnew/edit_teardrops.h
→
pcbnew/
tools/
edit_teardrops.h
View file @
7e76fd08
...
...
@@ -5,12 +5,17 @@
#include "tools/selection_tool.h"
#include "dialogs/dialog_teardrops.h"
#include "class_teardrop.h"
#include "import_export.h"
class
TEARDROPS_EDITOR
class
APIEXPORT
TEARDROPS_EDITOR
:
public
TOOL_BASE
{
public
:
TEARDROPS_EDITOR
(
PCB_EDIT_FRAME
*
frame
,
KIGFX
::
VIEW
*
view
);
bool
EditTeardrops
(
SELECTION
&
selection
,
const
DIALOG_TEARDROPS
::
TEARDROPS_SETTINGS
&
settings
);
TEARDROPS_EDITOR
();
~
TEARDROPS_EDITOR
();
bool
EditTeardrops
(
const
DIALOG_TEARDROPS
::
TEARDROPS_SETTINGS
&
settings
);
/// @copydoc TOOL_INTERACTIVE::Reset
void
Reset
(
RESET_REASON
aReason
);
private
:
PCB_EDIT_FRAME
*
m_frame
;
...
...
pcbnew/tools/tools_common.cpp
View file @
7e76fd08
...
...
@@ -34,6 +34,7 @@
#include <tools/pcb_editor_control.h>
#include <tools/placement_tool.h>
#include <tools/common_actions.h>
#include <tools/edit_teardrops.h>
#include <router/router_tool.h>
#include <router/length_tuner_tool.h>
...
...
@@ -49,4 +50,5 @@ void registerAllTools( TOOL_MANAGER *aToolManager )
aToolManager
->
RegisterTool
(
new
PCBNEW_CONTROL
);
aToolManager
->
RegisterTool
(
new
PCB_EDITOR_CONTROL
);
aToolManager
->
RegisterTool
(
new
PLACEMENT_TOOL
);
aToolManager
->
RegisterTool
(
new
TEARDROPS_EDITOR
);
}
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