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
c087883d
Commit
c087883d
authored
Feb 15, 2011
by
Marco Mattila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move layers into a wxCheckListBox in pcbnew plot dialog.
parent
a609f260
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
191 deletions
+46
-191
dialog_plot_base.cpp
pcbnew/dialogs/dialog_plot_base.cpp
+9
-23
dialog_plot_base.fbp
pcbnew/dialogs/dialog_plot_base.fbp
+11
-124
dialog_plot_base.h
pcbnew/dialogs/dialog_plot_base.h
+1
-5
pcbplot.cpp
pcbnew/pcbplot.cpp
+25
-39
No files found.
pcbnew/dialogs/dialog_plot_base.cpp
View file @
c087883d
...
@@ -26,13 +26,13 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
...
@@ -26,13 +26,13 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_staticText121
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Plot format:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticText121
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Plot format:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticText121
->
Wrap
(
-
1
);
m_staticText121
->
Wrap
(
-
1
);
bSizer27
->
Add
(
m_staticText121
,
0
,
wx
ALL
,
5
);
bSizer27
->
Add
(
m_staticText121
,
0
,
wx
TOP
,
5
);
wxString
m_plotFormatOptChoices
[]
=
{
_
(
"HPGL"
),
_
(
"Gerber"
),
_
(
"Postscript"
),
_
(
"Postscript A4"
),
_
(
"DXF"
)
};
wxString
m_plotFormatOptChoices
[]
=
{
_
(
"HPGL"
),
_
(
"Gerber"
),
_
(
"Postscript"
),
_
(
"Postscript A4"
),
_
(
"DXF"
)
};
int
m_plotFormatOptNChoices
=
sizeof
(
m_plotFormatOptChoices
)
/
sizeof
(
wxString
);
int
m_plotFormatOptNChoices
=
sizeof
(
m_plotFormatOptChoices
)
/
sizeof
(
wxString
);
m_plotFormatOpt
=
new
wxChoice
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
m_plotFormatOptNChoices
,
m_plotFormatOptChoices
,
0
);
m_plotFormatOpt
=
new
wxChoice
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
m_plotFormatOptNChoices
,
m_plotFormatOptChoices
,
0
);
m_plotFormatOpt
->
SetSelection
(
0
);
m_plotFormatOpt
->
SetSelection
(
0
);
bSizer27
->
Add
(
m_plotFormatOpt
,
0
,
wxALL
,
5
);
bSizer27
->
Add
(
m_plotFormatOpt
,
0
,
0
,
5
);
bSizer26
->
Add
(
bSizer27
,
0
,
wxEXPAND
,
5
);
bSizer26
->
Add
(
bSizer27
,
0
,
wxEXPAND
,
5
);
...
@@ -41,7 +41,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
...
@@ -41,7 +41,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_staticTextDir
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Output directory:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticTextDir
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Output directory:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticTextDir
->
Wrap
(
-
1
);
m_staticTextDir
->
Wrap
(
-
1
);
bSizer28
->
Add
(
m_staticTextDir
,
0
,
wx
ALL
|
wxEXPAND
,
5
);
bSizer28
->
Add
(
m_staticTextDir
,
0
,
wx
EXPAND
|
wxLEFT
|
wxTOP
,
5
);
wxBoxSizer
*
bSizer29
;
wxBoxSizer
*
bSizer29
;
bSizer29
=
new
wxBoxSizer
(
wxHORIZONTAL
);
bSizer29
=
new
wxBoxSizer
(
wxHORIZONTAL
);
...
@@ -63,18 +63,9 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
...
@@ -63,18 +63,9 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
wxBoxSizer
*
bUpperSizer
;
wxBoxSizer
*
bUpperSizer
;
bUpperSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
bUpperSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxStaticBoxSizer
*
sbLayersSizer
;
m_LayersSizer
=
new
wxStaticBoxSizer
(
new
wxStaticBox
(
this
,
wxID_ANY
,
_
(
"Layers"
)
),
wxHORIZONTAL
);
sbLayersSizer
=
new
wxStaticBoxSizer
(
new
wxStaticBox
(
this
,
wxID_ANY
,
_
(
"Layers"
)
),
wxHORIZONTAL
);
m_CopperLayersBoxSizer
=
new
wxStaticBoxSizer
(
new
wxStaticBox
(
this
,
wxID_ANY
,
_
(
"Copper Layers"
)
),
wxVERTICAL
);
bUpperSizer
->
Add
(
m_LayersSizer
,
1
,
wxALL
,
3
);
sbLayersSizer
->
Add
(
m_CopperLayersBoxSizer
,
1
,
wxALL
,
5
);
m_TechnicalLayersBoxSizer
=
new
wxStaticBoxSizer
(
new
wxStaticBox
(
this
,
wxID_ANY
,
_
(
"Technical Layers"
)
),
wxVERTICAL
);
sbLayersSizer
->
Add
(
m_TechnicalLayersBoxSizer
,
1
,
wxALL
,
5
);
bUpperSizer
->
Add
(
sbLayersSizer
,
1
,
wxALL
,
3
);
m_PlotOptionsSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_PlotOptionsSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
...
@@ -135,7 +126,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
...
@@ -135,7 +126,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
int
m_drillShapeOptNChoices
=
sizeof
(
m_drillShapeOptChoices
)
/
sizeof
(
wxString
);
int
m_drillShapeOptNChoices
=
sizeof
(
m_drillShapeOptChoices
)
/
sizeof
(
wxString
);
m_drillShapeOpt
=
new
wxChoice
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
m_drillShapeOptNChoices
,
m_drillShapeOptChoices
,
0
);
m_drillShapeOpt
=
new
wxChoice
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
m_drillShapeOptNChoices
,
m_drillShapeOptChoices
,
0
);
m_drillShapeOpt
->
SetSelection
(
0
);
m_drillShapeOpt
->
SetSelection
(
0
);
bSizer15
->
Add
(
m_drillShapeOpt
,
0
,
wxEXPAND
,
5
);
bSizer15
->
Add
(
m_drillShapeOpt
,
0
,
wxEXPAND
|
wxLEFT
,
5
);
m_staticText12
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Scaling:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticText12
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Scaling:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticText12
->
Wrap
(
-
1
);
m_staticText12
->
Wrap
(
-
1
);
...
@@ -145,7 +136,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
...
@@ -145,7 +136,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
int
m_scaleOptNChoices
=
sizeof
(
m_scaleOptChoices
)
/
sizeof
(
wxString
);
int
m_scaleOptNChoices
=
sizeof
(
m_scaleOptChoices
)
/
sizeof
(
wxString
);
m_scaleOpt
=
new
wxChoice
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
m_scaleOptNChoices
,
m_scaleOptChoices
,
0
);
m_scaleOpt
=
new
wxChoice
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
m_scaleOptNChoices
,
m_scaleOptChoices
,
0
);
m_scaleOpt
->
SetSelection
(
0
);
m_scaleOpt
->
SetSelection
(
0
);
bSizer15
->
Add
(
m_scaleOpt
,
0
,
wxEXPAND
,
5
);
bSizer15
->
Add
(
m_scaleOpt
,
0
,
wxEXPAND
|
wxLEFT
,
5
);
m_staticText13
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Plot mode:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticText13
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Plot mode:"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_staticText13
->
Wrap
(
-
1
);
m_staticText13
->
Wrap
(
-
1
);
...
@@ -155,7 +146,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
...
@@ -155,7 +146,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
int
m_plotModeOptNChoices
=
sizeof
(
m_plotModeOptChoices
)
/
sizeof
(
wxString
);
int
m_plotModeOptNChoices
=
sizeof
(
m_plotModeOptChoices
)
/
sizeof
(
wxString
);
m_plotModeOpt
=
new
wxChoice
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
m_plotModeOptNChoices
,
m_plotModeOptChoices
,
0
);
m_plotModeOpt
=
new
wxChoice
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
m_plotModeOptNChoices
,
m_plotModeOptChoices
,
0
);
m_plotModeOpt
->
SetSelection
(
0
);
m_plotModeOpt
->
SetSelection
(
0
);
bSizer15
->
Add
(
m_plotModeOpt
,
0
,
wxEXPAND
,
5
);
bSizer15
->
Add
(
m_plotModeOpt
,
0
,
wxEXPAND
|
wxLEFT
,
5
);
m_textDefaultPenSize
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Default linewidth"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_textDefaultPenSize
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Default linewidth"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_textDefaultPenSize
->
Wrap
(
-
1
);
m_textDefaultPenSize
->
Wrap
(
-
1
);
...
@@ -166,7 +157,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
...
@@ -166,7 +157,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_linesWidth
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_linesWidth
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_linesWidth
->
SetToolTip
(
_
(
"Line width for, e.g., sheet references."
)
);
m_linesWidth
->
SetToolTip
(
_
(
"Line width for, e.g., sheet references."
)
);
bSizer15
->
Add
(
m_linesWidth
,
0
,
wx
EXPAND
|
wxBOTTOM
|
wxRIGHT
|
wxLEFT
,
5
);
bSizer15
->
Add
(
m_linesWidth
,
0
,
wx
BOTTOM
|
wxEXPAND
|
wxLEFT
,
5
);
bSizer14
->
Add
(
bSizer15
,
1
,
wxALL
,
3
);
bSizer14
->
Add
(
bSizer15
,
1
,
wxALL
,
3
);
...
@@ -316,9 +307,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
...
@@ -316,9 +307,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_plotButton
->
SetDefault
();
m_plotButton
->
SetDefault
();
bSizer191
->
Add
(
m_plotButton
,
0
,
wxALL
,
5
);
bSizer191
->
Add
(
m_plotButton
,
0
,
wxALL
,
5
);
m_buttonSaveOpt
=
new
wxButton
(
this
,
ID_SAVE_OPT_PLOT
,
_
(
"Apply Settings"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bSizer191
->
Add
(
m_buttonSaveOpt
,
0
,
wxALL
,
5
);
m_buttonDrill
=
new
wxButton
(
this
,
ID_CREATE_DRILL_FILE
,
_
(
"Generate Drill File"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonDrill
=
new
wxButton
(
this
,
ID_CREATE_DRILL_FILE
,
_
(
"Generate Drill File"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bSizer191
->
Add
(
m_buttonDrill
,
0
,
wxALL
,
5
);
bSizer191
->
Add
(
m_buttonDrill
,
0
,
wxALL
,
5
);
...
@@ -340,7 +328,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
...
@@ -340,7 +328,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_browseButton
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnOutputDirectoryBrowseClicked
),
NULL
,
this
);
m_browseButton
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnOutputDirectoryBrowseClicked
),
NULL
,
this
);
m_scaleOpt
->
Connect
(
wxEVT_COMMAND_CHOICE_SELECTED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnSetScaleOpt
),
NULL
,
this
);
m_scaleOpt
->
Connect
(
wxEVT_COMMAND_CHOICE_SELECTED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnSetScaleOpt
),
NULL
,
this
);
m_plotButton
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
Plot
),
NULL
,
this
);
m_plotButton
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
Plot
),
NULL
,
this
);
m_buttonSaveOpt
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
applyPlotSettings
),
NULL
,
this
);
m_buttonDrill
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
CreateDrillFile
),
NULL
,
this
);
m_buttonDrill
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
CreateDrillFile
),
NULL
,
this
);
m_buttonQuit
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnQuit
),
NULL
,
this
);
m_buttonQuit
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnQuit
),
NULL
,
this
);
}
}
...
@@ -354,7 +341,6 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
...
@@ -354,7 +341,6 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
m_browseButton
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnOutputDirectoryBrowseClicked
),
NULL
,
this
);
m_browseButton
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnOutputDirectoryBrowseClicked
),
NULL
,
this
);
m_scaleOpt
->
Disconnect
(
wxEVT_COMMAND_CHOICE_SELECTED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnSetScaleOpt
),
NULL
,
this
);
m_scaleOpt
->
Disconnect
(
wxEVT_COMMAND_CHOICE_SELECTED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnSetScaleOpt
),
NULL
,
this
);
m_plotButton
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
Plot
),
NULL
,
this
);
m_plotButton
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
Plot
),
NULL
,
this
);
m_buttonSaveOpt
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
applyPlotSettings
),
NULL
,
this
);
m_buttonDrill
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
CreateDrillFile
),
NULL
,
this
);
m_buttonDrill
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
CreateDrillFile
),
NULL
,
this
);
m_buttonQuit
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnQuit
),
NULL
,
this
);
m_buttonQuit
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_PLOT_BASE
::
OnQuit
),
NULL
,
this
);
...
...
pcbnew/dialogs/dialog_plot_base.fbp
View file @
c087883d
This diff is collapsed.
Click to expand it.
pcbnew/dialogs/dialog_plot_base.h
View file @
c087883d
...
@@ -39,7 +39,6 @@ class DIALOG_PLOT_BASE : public wxDialog
...
@@ -39,7 +39,6 @@ class DIALOG_PLOT_BASE : public wxDialog
ID_ALLOW_PRINT_PAD_ON_SILKSCREEN
=
1000
,
ID_ALLOW_PRINT_PAD_ON_SILKSCREEN
=
1000
,
ID_PRINT_REF
,
ID_PRINT_REF
,
ID_MIROR_OPT
,
ID_MIROR_OPT
,
ID_SAVE_OPT_PLOT
,
ID_CREATE_DRILL_FILE
,
ID_CREATE_DRILL_FILE
,
};
};
...
@@ -49,8 +48,7 @@ class DIALOG_PLOT_BASE : public wxDialog
...
@@ -49,8 +48,7 @@ class DIALOG_PLOT_BASE : public wxDialog
wxStaticText
*
m_staticTextDir
;
wxStaticText
*
m_staticTextDir
;
wxTextCtrl
*
m_outputDirectoryName
;
wxTextCtrl
*
m_outputDirectoryName
;
wxButton
*
m_browseButton
;
wxButton
*
m_browseButton
;
wxStaticBoxSizer
*
m_CopperLayersBoxSizer
;
wxStaticBoxSizer
*
m_LayersSizer
;
wxStaticBoxSizer
*
m_TechnicalLayersBoxSizer
;
wxBoxSizer
*
m_PlotOptionsSizer
;
wxBoxSizer
*
m_PlotOptionsSizer
;
wxCheckBox
*
m_plotSheetRef
;
wxCheckBox
*
m_plotSheetRef
;
wxCheckBox
*
m_plotPads_on_Silkscreen
;
wxCheckBox
*
m_plotPads_on_Silkscreen
;
...
@@ -90,7 +88,6 @@ class DIALOG_PLOT_BASE : public wxDialog
...
@@ -90,7 +88,6 @@ class DIALOG_PLOT_BASE : public wxDialog
wxTextCtrl
*
m_messagesBox
;
wxTextCtrl
*
m_messagesBox
;
wxButton
*
m_plotButton
;
wxButton
*
m_plotButton
;
wxButton
*
m_buttonSaveOpt
;
wxButton
*
m_buttonDrill
;
wxButton
*
m_buttonDrill
;
wxButton
*
m_buttonQuit
;
wxButton
*
m_buttonQuit
;
...
@@ -101,7 +98,6 @@ class DIALOG_PLOT_BASE : public wxDialog
...
@@ -101,7 +98,6 @@ class DIALOG_PLOT_BASE : public wxDialog
virtual
void
OnOutputDirectoryBrowseClicked
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
OnOutputDirectoryBrowseClicked
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
OnSetScaleOpt
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
OnSetScaleOpt
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
Plot
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
Plot
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
applyPlotSettings
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
CreateDrillFile
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
CreateDrillFile
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
OnQuit
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
OnQuit
(
wxCommandEvent
&
event
)
{
event
.
Skip
();
}
...
...
pcbnew/pcbplot.cpp
View file @
c087883d
...
@@ -57,7 +57,8 @@ class DIALOG_PLOT : public DIALOG_PLOT_BASE
...
@@ -57,7 +57,8 @@ class DIALOG_PLOT : public DIALOG_PLOT_BASE
public
:
public
:
WinEDA_PcbFrame
*
m_Parent
;
WinEDA_PcbFrame
*
m_Parent
;
wxConfig
*
m_Config
;
wxConfig
*
m_Config
;
wxCheckBox
*
m_BoxSelectLayer
[
LAYER_COUNT
];
// wxCheckBox list to select/deselec layers to plot
std
::
vector
<
int
>
layerList
;
// List to hold CheckListBox layer numbers
wxCheckListBox
*
layerCheckListBox
;
double
m_XScaleAdjust
;
double
m_XScaleAdjust
;
double
m_YScaleAdjust
;
double
m_YScaleAdjust
;
...
@@ -102,7 +103,7 @@ private:
...
@@ -102,7 +103,7 @@ private:
void
OnOutputDirectoryBrowseClicked
(
wxCommandEvent
&
event
);
void
OnOutputDirectoryBrowseClicked
(
wxCommandEvent
&
event
);
void
SetPlotFormat
(
wxCommandEvent
&
event
);
void
SetPlotFormat
(
wxCommandEvent
&
event
);
void
OnSetScaleOpt
(
wxCommandEvent
&
event
);
void
OnSetScaleOpt
(
wxCommandEvent
&
event
);
void
applyPlotSettings
(
wxCommandEvent
&
event
);
void
applyPlotSettings
();
void
CreateDrillFile
(
wxCommandEvent
&
event
);
void
CreateDrillFile
(
wxCommandEvent
&
event
);
};
};
...
@@ -115,6 +116,10 @@ DIALOG_PLOT::DIALOG_PLOT( WinEDA_PcbFrame* parent ) :
...
@@ -115,6 +116,10 @@ DIALOG_PLOT::DIALOG_PLOT( WinEDA_PcbFrame* parent ) :
m_Parent
=
parent
;
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
layerCheckListBox
=
new
wxCheckListBox
(
this
,
wxID_ANY
);
m_LayersSizer
->
Add
(
layerCheckListBox
,
0
,
wxGROW
|
wxALL
,
1
);
Init_Dialog
();
Init_Dialog
();
GetSizer
()
->
Fit
(
this
);
GetSizer
()
->
Fit
(
this
);
...
@@ -169,40 +174,24 @@ void DIALOG_PLOT::Init_Dialog()
...
@@ -169,40 +174,24 @@ void DIALOG_PLOT::Init_Dialog()
m_plotPSNegativeOpt
->
SetValue
(
g_PcbPlotOptions
.
m_PlotPSNegative
);
m_plotPSNegativeOpt
->
SetValue
(
g_PcbPlotOptions
.
m_PlotPSNegative
);
// Create layer list.
int
layer
;
for
(
layer
=
0
;
layer
<
NB_LAYERS
;
++
layer
)
{
if
(
!
board
->
IsLayerEnabled
(
layer
)
)
m_BoxSelectLayer
[
layer
]
=
NULL
;
else
m_BoxSelectLayer
[
layer
]
=
new
wxCheckBox
(
this
,
-
1
,
board
->
GetLayerName
(
layer
)
);
}
// Add wxCheckBoxes in layers lists dialog
// List layers in same order than in setup layers dialog
// List layers in same order than in setup layers dialog
// (Front or Top to Back or Bottom)
// (Front or Top to Back or Bottom)
DECLARE_LAYERS_ORDER_LIST
(
layersOrder
);
DECLARE_LAYERS_ORDER_LIST
(
layersOrder
);
int
layer
_idx
;
int
layer
Index
,
checkIndex
,
layer
;
for
(
layer
_idx
=
0
;
layer_idx
<
NB_LAYERS
;
++
layer_idx
)
for
(
layer
Index
=
0
;
layerIndex
<
NB_LAYERS
;
layerIndex
++
)
{
{
layer
=
layersOrder
[
layer
_id
x
];
layer
=
layersOrder
[
layer
Inde
x
];
wxASSERT
(
layer
<
NB_LAYERS
);
wxASSERT
(
layer
<
NB_LAYERS
);
if
(
m_BoxSelectLayer
[
layer
]
==
NULL
)
if
(
!
board
->
IsLayerEnabled
(
layer
)
)
continue
;
continue
;
if
(
layer
<
NB_COPPER_LAYERS
)
layerList
.
push_back
(
layer
);
m_CopperLayersBoxSizer
->
Add
(
m_BoxSelectLayer
[
layer
],
checkIndex
=
layerCheckListBox
->
Append
(
board
->
GetLayerName
(
layer
)
);
0
,
wxGROW
|
wxALL
,
1
);
else
m_TechnicalLayersBoxSizer
->
Add
(
m_BoxSelectLayer
[
layer
],
0
,
wxGROW
|
wxALL
,
1
);
if
(
g_PcbPlotOptions
.
GetLayerSelection
()
&
(
1
<<
layer
)
)
if
(
g_PcbPlotOptions
.
GetLayerSelection
()
&
(
1
<<
layer
)
)
m_BoxSelectLayer
[
layer
]
->
SetValue
(
true
);
layerCheckListBox
->
Check
(
checkIndex
);
}
}
// Option for using proper Gerber extensions
// Option for using proper Gerber extensions
...
@@ -269,6 +258,7 @@ void DIALOG_PLOT::OnQuit( wxCommandEvent& event )
...
@@ -269,6 +258,7 @@ void DIALOG_PLOT::OnQuit( wxCommandEvent& event )
void
DIALOG_PLOT
::
OnClose
(
wxCloseEvent
&
event
)
void
DIALOG_PLOT
::
OnClose
(
wxCloseEvent
&
event
)
{
{
applyPlotSettings
();
EndModal
(
0
);
EndModal
(
0
);
}
}
...
@@ -438,7 +428,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
...
@@ -438,7 +428,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
}
}
void
DIALOG_PLOT
::
applyPlotSettings
(
wxCommandEvent
&
event
)
void
DIALOG_PLOT
::
applyPlotSettings
()
{
{
PCB_PLOT_PARAMS
tempOptions
;
PCB_PLOT_PARAMS
tempOptions
;
...
@@ -549,14 +539,11 @@ void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event )
...
@@ -549,14 +539,11 @@ void DIALOG_PLOT::applyPlotSettings( wxCommandEvent& event )
tempOptions
.
m_PlotFormat
=
m_plotFormatOpt
->
GetSelection
();
tempOptions
.
m_PlotFormat
=
m_plotFormatOpt
->
GetSelection
();
long
selectedLayers
=
0
;
long
selectedLayers
=
0
;
long
mask
=
1
;
unsigned
int
i
;
int
layer
;
for
(
i
=
0
;
i
<
layerList
.
size
();
i
++
)
for
(
layer
=
0
;
layer
<
NB_LAYERS
;
layer
++
,
mask
<<=
1
)
{
{
if
(
m_BoxSelectLayer
[
layer
]
==
NULL
)
if
(
layerCheckListBox
->
IsChecked
(
i
)
)
continue
;
selectedLayers
|=
(
1
<<
layerList
[
i
]);
if
(
m_BoxSelectLayer
[
layer
]
->
GetValue
()
)
selectedLayers
|=
mask
;
}
}
tempOptions
.
SetLayerSelection
(
selectedLayers
);
tempOptions
.
SetLayerSelection
(
selectedLayers
);
...
@@ -584,7 +571,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
...
@@ -584,7 +571,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
BOARD
*
board
=
m_Parent
->
GetBoard
();
BOARD
*
board
=
m_Parent
->
GetBoard
();
applyPlotSettings
(
event
);
applyPlotSettings
();
// Create output directory if it does not exist
// Create output directory if it does not exist
wxFileName
outputDir
=
wxFileName
::
DirName
(
m_outputDirectoryName
->
GetValue
()
);
wxFileName
outputDir
=
wxFileName
::
DirName
(
m_outputDirectoryName
->
GetValue
()
);
...
@@ -680,14 +667,13 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
...
@@ -680,14 +667,13 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
DisplayInfoMessage
(
this
,
DisplayInfoMessage
(
this
,
_
(
"Warning: Scale option set to a very large value"
)
);
_
(
"Warning: Scale option set to a very large value"
)
);
long
mask
=
1
;
unsigned
int
i
;
for
(
layer
=
0
;
layer
<
NB_LAYERS
;
layer
++
,
mask
<<=
1
)
for
(
i
=
0
;
i
<
layerList
.
size
();
i
++
)
{
{
if
(
m_BoxSelectLayer
[
layer
]
==
NULL
)
continue
;
bool
success
=
false
;
bool
success
=
false
;
if
(
m_BoxSelectLayer
[
layer
]
->
GetValue
(
)
)
if
(
layerCheckListBox
->
IsChecked
(
i
)
)
{
{
layer
=
layerList
[
i
];
fn
=
m_Parent
->
GetScreen
()
->
GetFileName
();
fn
=
m_Parent
->
GetScreen
()
->
GetFileName
();
fn
.
SetPath
(
outputDir
.
GetPath
()
);
fn
.
SetPath
(
outputDir
.
GetPath
()
);
...
...
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