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
96b6e1a5
Commit
96b6e1a5
authored
Jun 24, 2014
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make dialog pns properties resizable. DXF import: add very basic polyline import.
parent
95a6e8de
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
100 additions
and
126 deletions
+100
-126
draw_panel.cpp
common/draw_panel.cpp
+1
-1
dialog_pns_settings_base.cpp
pcbnew/dialogs/dialog_pns_settings_base.cpp
+4
-7
dialog_pns_settings_base.fbp
pcbnew/dialogs/dialog_pns_settings_base.fbp
+31
-112
dialog_pns_settings_base.h
pcbnew/dialogs/dialog_pns_settings_base.h
+2
-4
dxf2brd_items.cpp
pcbnew/import_dxf/dxf2brd_items.cpp
+60
-0
dxf2brd_items.h
pcbnew/import_dxf/dxf2brd_items.h
+2
-2
No files found.
common/draw_panel.cpp
View file @
96b6e1a5
...
@@ -128,7 +128,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
...
@@ -128,7 +128,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
if
(
cfg
)
if
(
cfg
)
{
{
cfg
->
Read
(
ENBL_MIDDLE_BUTT_PAN_KEY
,
&
m_enableMiddleButtonPan
,
fals
e
);
cfg
->
Read
(
ENBL_MIDDLE_BUTT_PAN_KEY
,
&
m_enableMiddleButtonPan
,
tru
e
);
cfg
->
Read
(
ENBL_ZOOM_NO_CENTER_KEY
,
&
m_enableZoomNoCenter
,
false
);
cfg
->
Read
(
ENBL_ZOOM_NO_CENTER_KEY
,
&
m_enableZoomNoCenter
,
false
);
cfg
->
Read
(
MIDDLE_BUTT_PAN_LIMITED_KEY
,
&
m_panScrollbarLimits
,
false
);
cfg
->
Read
(
MIDDLE_BUTT_PAN_LIMITED_KEY
,
&
m_panScrollbarLimits
,
false
);
cfg
->
Read
(
ENBL_AUTO_PAN_KEY
,
&
m_enableAutoPan
,
true
);
cfg
->
Read
(
ENBL_AUTO_PAN_KEY
,
&
m_enableAutoPan
,
true
);
...
...
pcbnew/dialogs/dialog_pns_settings_base.cpp
View file @
96b6e1a5
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
DIALOG_PNS_SETTINGS_BASE
::
DIALOG_PNS_SETTINGS_BASE
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
long
style
)
:
DIALOG_SHIM
(
parent
,
id
,
title
,
pos
,
size
,
style
)
DIALOG_PNS_SETTINGS_BASE
::
DIALOG_PNS_SETTINGS_BASE
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
long
style
)
:
DIALOG_SHIM
(
parent
,
id
,
title
,
pos
,
size
,
style
)
{
{
this
->
SetSizeHints
(
wx
DefaultSize
,
wxDefaultSize
);
this
->
SetSizeHints
(
wx
Size
(
280
,
380
)
,
wxDefaultSize
);
wxBoxSizer
*
bMainSizer
;
wxBoxSizer
*
bMainSizer
;
bMainSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
bMainSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
...
@@ -91,8 +91,8 @@ DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID
...
@@ -91,8 +91,8 @@ DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID
bOptions
->
Add
(
bEffort
,
0
,
wxEXPAND
,
5
);
bOptions
->
Add
(
bEffort
,
0
,
wxEXPAND
,
5
);
m_staticline1
=
new
wxStaticLine
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
wxLI_HORIZONTAL
);
b
Options
->
Add
(
m_staticline1
,
0
,
wxEXPAND
|
wxALL
,
5
);
b
MainSizer
->
Add
(
bOptions
,
1
,
wxEXPAND
|
wxALL
,
5
);
m_stdButtons
=
new
wxStdDialogButtonSizer
();
m_stdButtons
=
new
wxStdDialogButtonSizer
();
m_stdButtonsOK
=
new
wxButton
(
this
,
wxID_OK
);
m_stdButtonsOK
=
new
wxButton
(
this
,
wxID_OK
);
...
@@ -101,10 +101,7 @@ DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID
...
@@ -101,10 +101,7 @@ DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID
m_stdButtons
->
AddButton
(
m_stdButtonsCancel
);
m_stdButtons
->
AddButton
(
m_stdButtonsCancel
);
m_stdButtons
->
Realize
();
m_stdButtons
->
Realize
();
bOptions
->
Add
(
m_stdButtons
,
0
,
wxEXPAND
,
5
);
bMainSizer
->
Add
(
m_stdButtons
,
0
,
wxEXPAND
|
wxALL
,
5
);
bMainSizer
->
Add
(
bOptions
,
1
,
wxEXPAND
|
wxALL
,
5
);
this
->
SetSizer
(
bMainSizer
);
this
->
SetSizer
(
bMainSizer
);
...
...
pcbnew/dialogs/dialog_pns_settings_base.fbp
View file @
96b6e1a5
This diff is collapsed.
Click to expand it.
pcbnew/dialogs/dialog_pns_settings_base.h
View file @
96b6e1a5
...
@@ -24,9 +24,8 @@ class DIALOG_SHIM;
...
@@ -24,9 +24,8 @@ class DIALOG_SHIM;
#include <wx/stattext.h>
#include <wx/stattext.h>
#include <wx/slider.h>
#include <wx/slider.h>
#include <wx/sizer.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/statbox.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
...
@@ -52,7 +51,6 @@ class DIALOG_PNS_SETTINGS_BASE : public DIALOG_SHIM
...
@@ -52,7 +51,6 @@ class DIALOG_PNS_SETTINGS_BASE : public DIALOG_SHIM
wxSlider
*
m_effort
;
wxSlider
*
m_effort
;
wxStaticText
*
m_lowLabel
;
wxStaticText
*
m_lowLabel
;
wxStaticText
*
m_highLabel
;
wxStaticText
*
m_highLabel
;
wxStaticLine
*
m_staticline1
;
wxStdDialogButtonSizer
*
m_stdButtons
;
wxStdDialogButtonSizer
*
m_stdButtons
;
wxButton
*
m_stdButtonsOK
;
wxButton
*
m_stdButtonsOK
;
wxButton
*
m_stdButtonsCancel
;
wxButton
*
m_stdButtonsCancel
;
...
@@ -65,7 +63,7 @@ class DIALOG_PNS_SETTINGS_BASE : public DIALOG_SHIM
...
@@ -65,7 +63,7 @@ class DIALOG_PNS_SETTINGS_BASE : public DIALOG_SHIM
public
:
public
:
DIALOG_PNS_SETTINGS_BASE
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Interactive Router settings"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
2
77
,
404
),
long
style
=
wxDEFAULT_DIALOG_STYLE
);
DIALOG_PNS_SETTINGS_BASE
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
_
(
"Interactive Router settings"
),
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
2
98
,
410
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
~
DIALOG_PNS_SETTINGS_BASE
();
~
DIALOG_PNS_SETTINGS_BASE
();
};
};
...
...
pcbnew/import_dxf/dxf2brd_items.cpp
View file @
96b6e1a5
...
@@ -134,6 +134,66 @@ void DXF2BRD_CONVERTER::addLine( const DRW_Line& data )
...
@@ -134,6 +134,66 @@ void DXF2BRD_CONVERTER::addLine( const DRW_Line& data )
appendToBoard
(
segm
);
appendToBoard
(
segm
);
}
}
void
DXF2BRD_CONVERTER
::
addPolyline
(
const
DRW_Polyline
&
data
)
{
// Currently, Pcbnew does not know polylines, for boards.
// So we have to convert a polyline to a set of segments.
// Obviously, the z coordinate is ignored
wxPoint
startpoint
;
for
(
unsigned
ii
=
0
;
ii
<
data
.
vertlist
.
size
();
ii
++
)
{
DRW_Vertex
*
vertex
=
data
.
vertlist
[
ii
];
if
(
ii
==
0
)
{
startpoint
.
x
=
mapX
(
vertex
->
basePoint
.
x
);
startpoint
.
y
=
mapY
(
vertex
->
basePoint
.
y
);
continue
;
}
DRAWSEGMENT
*
segm
=
new
DRAWSEGMENT
(
m_brd
);
segm
->
SetLayer
(
m_brdLayer
);
segm
->
SetStart
(
startpoint
);
wxPoint
endpoint
(
mapX
(
vertex
->
basePoint
.
x
),
mapY
(
vertex
->
basePoint
.
y
)
);
segm
->
SetEnd
(
endpoint
);
segm
->
SetWidth
(
mapDim
(
data
.
thickness
==
0
?
m_defaultThickness
:
data
.
thickness
)
);
appendToBoard
(
segm
);
startpoint
=
endpoint
;
}
}
void
DXF2BRD_CONVERTER
::
addLWPolyline
(
const
DRW_LWPolyline
&
data
)
{
// Currently, Pcbnew does not know polylines, for boards.
// So we have to convert a polyline to a set of segments.
// The import is a simplified import: the width of segment is
// (obviously contant and is the width of the DRW_LWPolyline.
// the variable width of each vertex (when exists) is not used.
wxPoint
startpoint
;
for
(
unsigned
ii
=
0
;
ii
<
data
.
vertlist
.
size
();
ii
++
)
{
DRW_Vertex2D
*
vertex
=
data
.
vertlist
[
ii
];
if
(
ii
==
0
)
{
startpoint
.
x
=
mapX
(
vertex
->
x
);
startpoint
.
y
=
mapY
(
vertex
->
y
);
continue
;
}
DRAWSEGMENT
*
segm
=
new
DRAWSEGMENT
(
m_brd
);
segm
->
SetLayer
(
m_brdLayer
);
segm
->
SetStart
(
startpoint
);
wxPoint
endpoint
(
mapX
(
vertex
->
x
),
mapY
(
vertex
->
y
)
);
segm
->
SetEnd
(
endpoint
);
segm
->
SetWidth
(
mapDim
(
data
.
thickness
==
0
?
m_defaultThickness
:
data
.
thickness
)
);
appendToBoard
(
segm
);
startpoint
=
endpoint
;
}
}
/*
/*
* Import Circle entities.
* Import Circle entities.
...
...
pcbnew/import_dxf/dxf2brd_items.h
View file @
96b6e1a5
...
@@ -123,9 +123,9 @@ private:
...
@@ -123,9 +123,9 @@ private:
virtual
void
addCircle
(
const
DRW_Circle
&
data
);
virtual
void
addCircle
(
const
DRW_Circle
&
data
);
virtual
void
addArc
(
const
DRW_Arc
&
data
);
virtual
void
addArc
(
const
DRW_Arc
&
data
);
virtual
void
addEllipse
(
const
DRW_Ellipse
&
data
){}
virtual
void
addEllipse
(
const
DRW_Ellipse
&
data
){}
virtual
void
addLWPolyline
(
const
DRW_LWPolyline
&
data
)
{}
virtual
void
addLWPolyline
(
const
DRW_LWPolyline
&
data
)
;
virtual
void
addText
(
const
DRW_Text
&
data
);
virtual
void
addText
(
const
DRW_Text
&
data
);
virtual
void
addPolyline
(
const
DRW_Polyline
&
data
)
{}
virtual
void
addPolyline
(
const
DRW_Polyline
&
data
)
;
virtual
void
addSpline
(
const
DRW_Spline
*
data
){}
virtual
void
addSpline
(
const
DRW_Spline
*
data
){}
virtual
void
addKnot
(
const
DRW_Entity
&
)
{}
virtual
void
addKnot
(
const
DRW_Entity
&
)
{}
virtual
void
addInsert
(
const
DRW_Insert
&
data
){}
virtual
void
addInsert
(
const
DRW_Insert
&
data
){}
...
...
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