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
67feced1
Commit
67feced1
authored
Nov 05, 2007
by
g_harland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update "Swap Layers:" and "Layer selection" dialog boxes again
parent
82d17cc2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
444 additions
and
393 deletions
+444
-393
change_log.txt
change_log.txt
+20
-0
netlist_control.cpp
eeschema/netlist_control.cpp
+393
-383
select_layers_to_pcb.cpp
gerbview/select_layers_to_pcb.cpp
+15
-5
swap_layers.cpp
pcbnew/swap_layers.cpp
+16
-5
No files found.
change_log.txt
View file @
67feced1
...
@@ -4,6 +4,26 @@ Started 2007-June-11
...
@@ -4,6 +4,26 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.
2007-Nov-05 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
+ eeschema
* The previously provided "Close" button within the "Netlist" dialog box has
now been replaced with a "Cancel" button, and this dialog can now (otherwise)
be cancelled by pressing the "Esc" key. General cleanup and beautification of
eeschema/netlist_control.cpp.
+ pcbnew
* The color of each text string provided within the "Swap Layers:" dialog box is
now set to blue for each string specifying that the associated layer is *not*
being swapped with any other layer, or to fushia for each string specifying that
the associated layer *is* being swapped with another layer. (This change was
made after being suggested by Dick Hollenbeck.)
+ gerbview
* The color of each text string provided within the "Layer selection" dialog box
is similarly now set to blue for each string specifying that the associated
Gerber layer is *not* being exported to any pcbnew layer, or to fushia for each
string specifying that the associated Gerber layer *is* being exported to a
pcbnew layer.
2007-Nov-2 UPDATE Dick Hollenbeck <dick@softplc.com>
2007-Nov-2 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
...
...
eeschema/netlist_control.cpp
View file @
67feced1
/**********************************/
/**********************************/
/* Dila
og box for netlist outputs */
/* Dial
og box for netlist outputs */
/**********************************/
/**********************************/
#include "fctsys.h"
#include "fctsys.h"
//#include "gr_basic.h"
//
#include "gr_basic.h"
#include "common.h"
#include "common.h"
#include "program.h"
#include "program.h"
#include "libcmp.h"
#include "libcmp.h"
#include "general.h"
#include "general.h"
#include "netlist.h"
/* Definitions generales liees au calcul de netliste */
#include "netlist.h"
/* Definitions generales liees au calcul de netliste */
#include "protos.h"
#include "protos.h"
...
@@ -24,142 +24,134 @@
...
@@ -24,142 +24,134 @@
enum
id_netlist
{
enum
id_netlist
{
ID_CREATE_NETLIST
=
1550
,
ID_CREATE_NETLIST
=
1550
,
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CLOSE_NETLIST
,
ID_RUN_SIMULATOR
,
ID_RUN_SIMULATOR
,
ID_SETUP_PLUGIN
,
ID_SETUP_PLUGIN
,
ID_NETLIST_NOTEBOOK
ID_NETLIST_NOTEBOOK
};
};
enum
panel_netlist_index
{
enum
panel_netlist_index
{
PANELPCBNEW
=
0
,
// Create Netlist format Pcbnew
PANELPCBNEW
=
0
,
// Create Netlist format Pcbnew
PANELORCADPCB2
,
// Create Netlis format OracdPcb2
PANELORCADPCB2
,
// Create Netlis format OracdPcb2
PANELCADSTAR
,
// Create Netlis format OracdPcb2
PANELCADSTAR
,
// Create Netlis format OracdPcb2
PANELSPICE
,
// Create Netlis format Pspice
PANELSPICE
,
// Create Netlis format Pspice
PANELCUSTOMBASE
// Start auxiliary panels (custom netlists)
PANELCUSTOMBASE
// Start auxiliary panels (custom netlists)
};
};
/* wxPanels for creating the NoteBook pages for each netlist format:
/* wxPanels for creating the NoteBook pages for each netlist format:
*/
*/
class
EDA_NoteBookPage
:
public
wxPanel
class
EDA_NoteBookPage
:
public
wxPanel
{
{
public
:
public
:
int
m_IdNetType
;
int
m_IdNetType
;
wxCheckBox
*
m_IsCurrentFormat
;
wxCheckBox
*
m_IsCurrentFormat
;
WinEDA_EnterText
*
m_CommandStringCtrl
;
WinEDA_EnterText
*
m_CommandStringCtrl
;
WinEDA_EnterText
*
m_TitleStringCtrl
;
WinEDA_EnterText
*
m_TitleStringCtrl
;
wxButton
*
m_ButtonCancel
;
wxButton
*
m_ButtonCancel
;
wxBoxSizer
*
m_LeftBoxSizer
;
wxBoxSizer
*
m_LeftBoxSizer
;
wxBoxSizer
*
m_RightBoxSizer
;
wxBoxSizer
*
m_RightBoxSizer
;
wxBoxSizer
*
m_LowBoxSizer
;
wxBoxSizer
*
m_LowBoxSizer
;
EDA_NoteBookPage
(
wxNotebook
*
parent
,
const
wxString
&
title
,
EDA_NoteBookPage
(
wxNotebook
*
parent
,
const
wxString
&
title
,
int
id_NetType
,
int
idCheckBox
,
int
idCreateFile
);
int
id_NetType
,
int
idCheckBox
,
int
idCreateFile
);
~
EDA_NoteBookPage
()
{};
~
EDA_NoteBookPage
()
{};
};
};
/*****************************************************************************/
/*****************************************************************************/
EDA_NoteBookPage
::
EDA_NoteBookPage
(
wxNotebook
*
parent
,
const
wxString
&
title
,
EDA_NoteBookPage
::
EDA_NoteBookPage
(
wxNotebook
*
parent
,
const
wxString
&
title
,
int
id_NetType
,
int
idCheckBox
,
int
idCreateFile
)
:
int
id_NetType
,
int
idCheckBox
,
int
idCreateFile
)
:
wxPanel
(
parent
,
-
1
)
wxPanel
(
parent
,
-
1
)
/*****************************************************************************/
/*****************************************************************************/
/* Contructor to create a setup page for one netlist format.
/* Contructor to create a setup page for one netlist format.
Used in Netlist format Dialog box creation
*
Used in Netlist format Dialog box creation
*/
*/
{
{
SetFont
(
*
g_DialogFont
);
SetFont
(
*
g_DialogFont
);
m_IdNetType
=
id_NetType
;
m_IdNetType
=
id_NetType
;
m_CommandStringCtrl
=
NULL
;
m_CommandStringCtrl
=
NULL
;
m_TitleStringCtrl
=
NULL
;
m_TitleStringCtrl
=
NULL
;
m_IsCurrentFormat
=
NULL
;
m_IsCurrentFormat
=
NULL
;
m_ButtonCancel
=
NULL
;
m_ButtonCancel
=
NULL
;
parent
->
AddPage
(
this
,
title
,
g_NetFormat
==
m_IdNetType
);
parent
->
AddPage
(
this
,
title
,
g_NetFormat
==
m_IdNetType
);
wxBoxSizer
*
MainBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
wxBoxSizer
*
MainBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
SetSizer
(
MainBoxSizer
);
SetSizer
(
MainBoxSizer
);
wxBoxSizer
*
UpperBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxBoxSizer
*
UpperBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
m_LowBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_LowBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
MainBoxSizer
->
Add
(
UpperBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
MainBoxSizer
->
Add
(
UpperBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
MainBoxSizer
->
Add
(
m_LowBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
MainBoxSizer
->
Add
(
m_LowBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
m_LeftBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_LeftBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_RightBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_RightBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
UpperBoxSizer
->
Add
(
m_LeftBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
UpperBoxSizer
->
Add
(
m_LeftBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
UpperBoxSizer
->
Add
(
m_RightBoxSizer
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxALL
,
5
);
UpperBoxSizer
->
Add
(
m_RightBoxSizer
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxALL
,
5
);
if
(
idCheckBox
)
if
(
idCheckBox
)
{
{
wxStaticText
*
text
=
new
wxStaticText
(
this
,
-
1
,
_
(
"Options:"
));
wxStaticText
*
text
=
new
wxStaticText
(
this
,
-
1
,
_
(
"Options:"
));
m_LeftBoxSizer
->
Add
(
text
,
0
,
wxGROW
|
wxALL
,
5
);
m_LeftBoxSizer
->
Add
(
text
,
0
,
wxGROW
|
wxALL
,
5
);
m_IsCurrentFormat
=
new
wxCheckBox
(
this
,
idCheckBox
,
m_IsCurrentFormat
=
new
wxCheckBox
(
this
,
idCheckBox
,
_
(
"Default format"
));
_
(
"Default format"
));
m_LeftBoxSizer
->
Add
(
m_IsCurrentFormat
,
0
,
wxGROW
|
wxALL
,
5
);
m_LeftBoxSizer
->
Add
(
m_IsCurrentFormat
,
0
,
wxGROW
|
wxALL
,
5
);
if
(
g_NetFormat
==
m_IdNetType
)
if
(
g_NetFormat
==
m_IdNetType
)
m_IsCurrentFormat
->
SetValue
(
TRUE
);
m_IsCurrentFormat
->
SetValue
(
TRUE
);
}
}
if
(
idCreateFile
)
// Create the 2 standard buttons: Create File and Cancel
{
if
(
idCreateFile
)
// Create the 2 standard buttons: Create File ans Cancel
wxButton
*
Button
;
{
if
(
idCreateFile
==
ID_SETUP_PLUGIN
)
wxButton
*
Button
;
Button
=
new
wxButton
(
this
,
idCreateFile
,
_
(
"&Browse Plugin"
));
if
(
idCreateFile
==
ID_SETUP_PLUGIN
)
else
{
Button
=
new
wxButton
(
this
,
idCreateFile
,
_
(
"&Netlist"
));
Button
=
new
wxButton
(
this
,
idCreateFile
,
Button
->
SetForegroundColour
(
*
wxRED
);
_
(
"&Browse Plugin"
));
m_RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
}
else
m_ButtonCancel
=
{
Button
=
new
wxButton
(
this
,
wxID_CANCEL
,
_
(
"&Cancel"
));
Button
=
new
wxButton
(
this
,
idCreateFile
,
Button
->
SetForegroundColour
(
*
wxBLUE
);
_
(
"&Netlist"
));
m_RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
}
}
Button
->
SetForegroundColour
(
*
wxRED
);
m_RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
m_ButtonCancel
=
Button
=
new
wxButton
(
this
,
ID_CLOSE_NETLIST
,
_
(
"&Close"
));
Button
->
SetForegroundColour
(
*
wxBLUE
);
m_RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
}
}
}
#define CUSTOMPANEL_COUNTMAX 8
#define CUSTOMPANEL_COUNTMAX 8
/* Dialog frame for creating netlists */
/* Dialog frame for creating netlists */
class
WinEDA_NetlistFrame
:
public
wxDialog
class
WinEDA_NetlistFrame
:
public
wxDialog
{
{
public
:
public
:
WinEDA_SchematicFrame
*
m_Parent
;
WinEDA_SchematicFrame
*
m_Parent
;
wxNotebook
*
m_NoteBook
;
wxNotebook
*
m_NoteBook
;
EDA_NoteBookPage
*
m_PanelNetType
[
4
+
CUSTOMPANEL_COUNTMAX
];
EDA_NoteBookPage
*
m_PanelNetType
[
4
+
CUSTOMPANEL_COUNTMAX
];
wxRadioBox
*
m_UseNetNamesInNetlist
;
wxRadioBox
*
m_UseNetNamesInNetlist
;
public
:
public
:
// Constructor and destructor
// Constructor and destructor
WinEDA_NetlistFrame
(
WinEDA_SchematicFrame
*
parent
,
wxPoint
&
pos
);
WinEDA_NetlistFrame
(
WinEDA_SchematicFrame
*
parent
,
wxPoint
&
pos
);
~
WinEDA_NetlistFrame
()
{};
~
WinEDA_NetlistFrame
()
{};
private
:
private
:
void
InstallCustomPages
();
void
InstallCustomPages
();
void
InstallPageSpice
();
void
InstallPageSpice
();
void
GenNetlist
(
wxCommandEvent
&
event
);
void
GenNetlist
(
wxCommandEvent
&
event
);
void
RunSimulator
(
wxCommandEvent
&
event
);
void
RunSimulator
(
wxCommandEvent
&
event
);
void
NetlistUpdateOpt
();
void
NetlistUpdateOpt
();
void
NetlistExit
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
SelectNetlistType
(
wxCommandEvent
&
event
);
void
SelectNetlistType
(
wxCommandEvent
&
event
);
void
SetupPlugin
(
wxCommandEvent
&
event
);
void
SetupPlugin
(
wxCommandEvent
&
event
);
DECLARE_EVENT_TABLE
()};
DECLARE_EVENT_TABLE
()};
BEGIN_EVENT_TABLE
(
WinEDA_NetlistFrame
,
wxDialog
)
BEGIN_EVENT_TABLE
(
WinEDA_NetlistFrame
,
wxDialog
)
EVT_BUTTON
(
ID_CLOSE_NETLIST
,
WinEDA_NetlistFrame
::
NetlistExit
)
EVT_BUTTON
(
wxID_CANCEL
,
WinEDA_NetlistFrame
::
OnCancelClick
)
EVT_BUTTON
(
ID_CREATE_NETLIST
,
WinEDA_NetlistFrame
::
GenNetlist
)
EVT_BUTTON
(
ID_CREATE_NETLIST
,
WinEDA_NetlistFrame
::
GenNetlist
)
EVT_BUTTON
(
ID_SETUP_PLUGIN
,
WinEDA_NetlistFrame
::
SetupPlugin
)
EVT_BUTTON
(
ID_SETUP_PLUGIN
,
WinEDA_NetlistFrame
::
SetupPlugin
)
EVT_CHECKBOX
(
ID_CURRENT_FORMAT_IS_DEFAULT
,
WinEDA_NetlistFrame
::
SelectNetlistType
)
EVT_CHECKBOX
(
ID_CURRENT_FORMAT_IS_DEFAULT
,
WinEDA_NetlistFrame
::
SelectNetlistType
)
EVT_BUTTON
(
ID_RUN_SIMULATOR
,
WinEDA_NetlistFrame
::
RunSimulator
)
EVT_BUTTON
(
ID_RUN_SIMULATOR
,
WinEDA_NetlistFrame
::
RunSimulator
)
END_EVENT_TABLE
()
END_EVENT_TABLE
()
...
@@ -167,71 +159,73 @@ END_EVENT_TABLE()
...
@@ -167,71 +159,73 @@ END_EVENT_TABLE()
void
InstallNetlistFrame
(
WinEDA_SchematicFrame
*
parent
,
wxPoint
&
pos
)
void
InstallNetlistFrame
(
WinEDA_SchematicFrame
*
parent
,
wxPoint
&
pos
)
/****************************************************************/
/****************************************************************/
/* Installator for the netlist generation dialog box
/* Installator for the netlist generation dialog box
*/
*/
{
{
WinEDA_NetlistFrame
*
frame
=
new
WinEDA_NetlistFrame
(
parent
,
pos
);
WinEDA_NetlistFrame
*
frame
=
new
WinEDA_NetlistFrame
(
parent
,
pos
);
frame
->
ShowModal
();
frame
->
Destroy
();
frame
->
ShowModal
();
frame
->
Destroy
();
}
}
#define H_SIZE 370
#define H_SIZE 370
#define V_SIZE 300
#define V_SIZE 300
/*************************************************************************************/
/*************************************************************************************/
WinEDA_NetlistFrame
::
WinEDA_NetlistFrame
(
WinEDA_SchematicFrame
*
parent
,
wxPoint
&
framepos
)
:
WinEDA_NetlistFrame
::
WinEDA_NetlistFrame
(
WinEDA_SchematicFrame
*
parent
,
wxPoint
&
framepos
)
:
wxDialog
(
parent
,
-
1
,
_
(
"Netlist"
),
framepos
,
wxSize
(
H_SIZE
,
V_SIZE
),
DIALOG_STYLE
|
MAYBE_RESIZE_BORDER
)
wxDialog
(
parent
,
-
1
,
_
(
"Netlist"
),
framepos
,
wxSize
(
H_SIZE
,
V_SIZE
),
DIALOG_STYLE
|
MAYBE_RESIZE_BORDER
)
/*************************************************************************************/
/*************************************************************************************/
/* Constructor for the netlist generation dialog box
/* Constructor for the netlist generation dialog box
*/
*/
{
{
int
ii
;
int
ii
;
m_Parent
=
parent
;
m_Parent
=
parent
;
SetFont
(
*
g_DialogFont
);
SetFont
(
*
g_DialogFont
);
if
(
g_NetFormat
==
NET_TYPE_NOT_INIT
)
if
(
g_NetFormat
==
NET_TYPE_NOT_INIT
)
g_NetFormat
=
NET_TYPE_PCBNEW
;
g_NetFormat
=
NET_TYPE_PCBNEW
;
for
(
ii
=
0
;
ii
<
PANELCUSTOMBASE
+
CUSTOMPANEL_COUNTMAX
;
ii
++
)
for
(
ii
=
0
;
ii
<
PANELCUSTOMBASE
+
CUSTOMPANEL_COUNTMAX
;
ii
++
)
{
{
m_PanelNetType
[
ii
]
=
NULL
;
m_PanelNetType
[
ii
]
=
NULL
;
}
}
if
(
(
framepos
.
x
==
-
1
)
&&
(
framepos
.
x
==
-
1
)
)
Centre
();
if
(
(
framepos
.
x
==
-
1
)
&&
(
framepos
.
y
==
-
1
)
)
Centre
();
wxBoxSizer
*
GeneralBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
wxBoxSizer
*
GeneralBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
SetSizer
(
GeneralBoxSizer
);
SetSizer
(
GeneralBoxSizer
);
m_NoteBook
=
new
wxNotebook
(
this
,
ID_NETLIST_NOTEBOOK
,
m_NoteBook
=
new
wxNotebook
(
this
,
ID_NETLIST_NOTEBOOK
,
wxDefaultPosition
,
wxSize
(
H_SIZE
-
6
,
V_SIZE
-
28
)
);
wxDefaultPosition
,
wxSize
(
H_SIZE
-
6
,
V_SIZE
-
28
)
);
m_NoteBook
->
SetFont
(
*
g_DialogFont
);
m_NoteBook
->
SetFont
(
*
g_DialogFont
);
GeneralBoxSizer
->
Add
(
m_NoteBook
,
0
,
wxGROW
|
wxALL
,
5
);
GeneralBoxSizer
->
Add
(
m_NoteBook
,
0
,
wxGROW
|
wxALL
,
5
);
// Add panels
// Add panels
// Add Panel FORMAT PCBNEW
// Add Panel FORMAT PCBNEW
m_PanelNetType
[
PANELPCBNEW
]
=
new
EDA_NoteBookPage
(
m_NoteBook
,
wxT
(
"Pcbnew"
),
NET_TYPE_PCBNEW
,
m_PanelNetType
[
PANELPCBNEW
]
=
new
EDA_NoteBookPage
(
m_NoteBook
,
wxT
(
"Pcbnew"
),
NET_TYPE_PCBNEW
,
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CREATE_NETLIST
);
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CREATE_NETLIST
);
// Add Panel FORMAT ORCADPCB2
// Add Panel FORMAT ORCADPCB2
m_PanelNetType
[
PANELORCADPCB2
]
=
new
EDA_NoteBookPage
(
m_NoteBook
,
wxT
(
"OrcadPCB2"
),
NET_TYPE_ORCADPCB2
,
m_PanelNetType
[
PANELORCADPCB2
]
=
new
EDA_NoteBookPage
(
m_NoteBook
,
wxT
(
"OrcadPCB2"
),
NET_TYPE_ORCADPCB2
,
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CREATE_NETLIST
);
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CREATE_NETLIST
);
// Add Panel FORMAT CADSTAR
// Add Panel FORMAT CADSTAR
m_PanelNetType
[
PANELCADSTAR
]
=
new
EDA_NoteBookPage
(
m_NoteBook
,
wxT
(
"CadStar"
),
NET_TYPE_CADSTAR
,
m_PanelNetType
[
PANELCADSTAR
]
=
new
EDA_NoteBookPage
(
m_NoteBook
,
wxT
(
"CadStar"
),
NET_TYPE_CADSTAR
,
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CREATE_NETLIST
);
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CREATE_NETLIST
);
// Add Panel spice
InstallPageSpice
();
// Add custom panels:
InstallCustomPages
();
// Problem in wxMSV >= 2.7.1 : we must call GetSizer for one notebook page
// to have a proper sizer commutation of all pages
m_PanelNetType
[
PANELPCBNEW
]
->
GetSizer
()
->
Fit
(
this
);
m_PanelNetType
[
PANELPCBNEW
]
->
GetSizer
()
->
SetSizeHints
(
this
);
// Add Panel spice
InstallPageSpice
();
GetSizer
()
->
Fit
(
this
);
// Add custom panels:
InstallCustomPages
();
// Problem in wxMSV >= 2.7.1 : we must call GetSizer for one notebook page
// to have a proper sizer commutation of all pages
m_PanelNetType
[
PANELPCBNEW
]
->
GetSizer
()
->
Fit
(
this
);
m_PanelNetType
[
PANELPCBNEW
]
->
GetSizer
()
->
SetSizeHints
(
this
);
GetSizer
()
->
Fit
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
}
}
...
@@ -240,84 +234,88 @@ int ii;
...
@@ -240,84 +234,88 @@ int ii;
void
WinEDA_NetlistFrame
::
InstallPageSpice
()
void
WinEDA_NetlistFrame
::
InstallPageSpice
()
/*************************************************/
/*************************************************/
/* Create the spice page
/* Create the spice page
*/
*/
{
{
wxButton
*
Button
;
wxButton
*
Button
;
EDA_NoteBookPage
*
page
;
EDA_NoteBookPage
*
page
;
page
=
m_PanelNetType
[
PANELSPICE
]
=
new
EDA_NoteBookPage
(
m_NoteBook
,
wxT
(
"Spice"
),
NET_TYPE_SPICE
,
0
,
0
);
page
=
m_PanelNetType
[
PANELSPICE
]
=
new
EDA_NoteBookPage
(
m_NoteBook
,
wxT
(
"Spice"
),
NET_TYPE_SPICE
,
0
,
0
);
page
->
m_IsCurrentFormat
=
new
wxCheckBox
(
page
,
ID_CURRENT_FORMAT_IS_DEFAULT
,
page
->
m_IsCurrentFormat
=
new
wxCheckBox
(
page
,
ID_CURRENT_FORMAT_IS_DEFAULT
,
_
(
"Default format"
));
_
(
"Default format"
));
page
->
m_IsCurrentFormat
->
SetValue
(
g_NetFormat
==
NET_TYPE_SPICE
);
page
->
m_IsCurrentFormat
->
SetValue
(
g_NetFormat
==
NET_TYPE_SPICE
);
page
->
m_LeftBoxSizer
->
Add
(
page
->
m_IsCurrentFormat
,
0
,
wxGROW
|
wxALL
,
5
);
page
->
m_LeftBoxSizer
->
Add
(
page
->
m_IsCurrentFormat
,
0
,
wxGROW
|
wxALL
,
5
);
wxString
netlist_opt
[
2
]
=
{
_
(
"Use Net Names"
),
_
(
"Use Net Numbers"
)
};
wxString
netlist_opt
[
2
]
=
{
_
(
"Use Net Names"
),
_
(
"Use Net Numbers"
)
};
m_UseNetNamesInNetlist
=
new
wxRadioBox
(
page
,
-
1
,
_
(
"Netlist Options:"
),
m_UseNetNamesInNetlist
=
new
wxRadioBox
(
page
,
-
1
,
_
(
"Netlist Options:"
),
wxDefaultPosition
,
wxDefaultSize
,
wxDefaultPosition
,
wxDefaultSize
,
2
,
netlist_opt
,
1
,
wxRA_SPECIFY_COLS
);
2
,
netlist_opt
,
1
,
wxRA_SPECIFY_COLS
);
if
(
!
g_OptNetListUseNames
)
m_UseNetNamesInNetlist
->
SetSelection
(
1
);
if
(
!
g_OptNetListUseNames
)
page
->
m_LeftBoxSizer
->
Add
(
m_UseNetNamesInNetlist
,
0
,
wxGROW
|
wxALL
,
5
);
m_UseNetNamesInNetlist
->
SetSelection
(
1
);
page
->
m_LeftBoxSizer
->
Add
(
m_UseNetNamesInNetlist
,
0
,
wxGROW
|
wxALL
,
5
);
page
->
m_CommandStringCtrl
=
new
WinEDA_EnterText
(
page
,
_
(
"Simulator command:"
),
g_SimulatorCommandLine
,
page
->
m_CommandStringCtrl
=
new
WinEDA_EnterText
(
page
,
page
->
m_LowBoxSizer
,
wxSize
(
H_SIZE
-
10
,
-
1
)
);
_
(
"Simulator command:"
),
g_SimulatorCommandLine
,
// Add buttons
page
->
m_LowBoxSizer
,
wxSize
(
H_SIZE
-
10
,
-
1
)
);
Button
=
new
wxButton
(
page
,
ID_CREATE_NETLIST
,
_
(
"Netlist"
)
);
// Add buttons
Button
->
SetForegroundColour
(
*
wxRED
);
Button
=
new
wxButton
(
page
,
ID_CREATE_NETLIST
,
_
(
"Netlist"
)
);
page
->
m_RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
Button
->
SetForegroundColour
(
*
wxRED
);
page
->
m_RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
Button
=
new
wxButton
(
page
,
ID_RUN_SIMULATOR
,
_
(
"&Run Simulator"
));
Button
->
SetForegroundColour
(
wxColour
(
0
,
100
,
0
));
Button
=
new
wxButton
(
page
,
ID_RUN_SIMULATOR
,
_
(
"&Run Simulator"
));
page
->
m_RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
Button
->
SetForegroundColour
(
wxColour
(
0
,
100
,
0
)
);
page
->
m_RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
Button
=
new
wxButton
(
page
,
ID_CLOSE_NETLIST
,
_
(
"&Close"
));
Button
->
SetForegroundColour
(
*
wxBLUE
);
Button
=
new
wxButton
(
page
,
wxID_CANCEL
,
_
(
"&Cancel"
));
page
->
m_RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
Button
->
SetForegroundColour
(
*
wxBLUE
);
page
->
m_RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
}
}
/*************************************************/
/*************************************************/
void
WinEDA_NetlistFrame
::
InstallCustomPages
()
void
WinEDA_NetlistFrame
::
InstallCustomPages
()
/*************************************************/
/*************************************************/
/* create the pages for custom netlist format selection:
/* create the pages for custom netlist format selection:
*/
*/
{
{
int
ii
,
CustomCount
;
int
ii
,
CustomCount
;
wxString
title
,
previoustitle
,
msg
;
wxString
title
,
previoustitle
,
msg
;
EDA_NoteBookPage
*
CurrPage
;
EDA_NoteBookPage
*
CurrPage
;
CustomCount
=
CUSTOMPANEL_COUNTMAX
;
CustomCount
=
CUSTOMPANEL_COUNTMAX
;
previoustitle
=
wxT
(
"dummy_title"
);
previoustitle
=
wxT
(
"dummy_title"
);
for
(
ii
=
0
;
ii
<
CustomCount
;
ii
++
)
for
(
ii
=
0
;
ii
<
CustomCount
;
ii
++
)
{
{
msg
=
CUSTOM_NETLIST_TITLE
;
msg
<<
ii
+
1
;
msg
=
CUSTOM_NETLIST_TITLE
;
title
=
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
msg
);
msg
<<
ii
+
1
;
title
=
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
msg
);
// Install the panel only if it is the first panel not initialised
if
(
(
title
.
IsEmpty
())
&&
(
previoustitle
.
IsEmpty
()
)
)
break
;
// Install the panel only if it is the first panel not initialised
if
(
title
.
IsEmpty
()
&&
previoustitle
.
IsEmpty
()
)
previoustitle
=
title
;
break
;
if
(
title
.
IsEmpty
()
)
CurrPage
=
m_PanelNetType
[
PANELCUSTOMBASE
+
ii
]
=
previoustitle
=
title
;
new
EDA_NoteBookPage
(
m_NoteBook
,
_
(
"Add Plugin"
),
if
(
title
.
IsEmpty
()
)
NET_TYPE_CUSTOM1
+
ii
,
CurrPage
=
m_PanelNetType
[
PANELCUSTOMBASE
+
ii
]
=
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_SETUP_PLUGIN
);
new
EDA_NoteBookPage
(
m_NoteBook
,
_
(
"Add Plugin"
),
else
NET_TYPE_CUSTOM1
+
ii
,
CurrPage
=
m_PanelNetType
[
PANELCUSTOMBASE
+
ii
]
=
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_SETUP_PLUGIN
);
new
EDA_NoteBookPage
(
m_NoteBook
,
title
,
else
NET_TYPE_CUSTOM1
+
ii
,
CurrPage
=
m_PanelNetType
[
PANELCUSTOMBASE
+
ii
]
=
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CREATE_NETLIST
);
new
EDA_NoteBookPage
(
m_NoteBook
,
title
,
NET_TYPE_CUSTOM1
+
ii
,
msg
=
CUSTOM_NETLIST_COMMAND
;
msg
<<
ii
+
1
;
ID_CURRENT_FORMAT_IS_DEFAULT
,
ID_CREATE_NETLIST
);
wxString
Command
=
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
msg
);
CurrPage
->
m_CommandStringCtrl
=
new
WinEDA_EnterText
(
CurrPage
,
msg
=
CUSTOM_NETLIST_COMMAND
;
_
(
"Netlist command:"
),
Command
,
msg
<<
ii
+
1
;
CurrPage
->
m_LowBoxSizer
,
wxSize
(
H_SIZE
-
10
,
-
1
)
);
wxString
Command
=
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
msg
);
CurrPage
->
m_CommandStringCtrl
=
new
WinEDA_EnterText
(
CurrPage
,
CurrPage
->
m_TitleStringCtrl
=
new
WinEDA_EnterText
(
CurrPage
,
_
(
"Netlist command:"
),
Command
,
_
(
"Title:"
),
title
,
CurrPage
->
m_LowBoxSizer
,
wxSize
(
H_SIZE
-
10
,
-
1
)
);
CurrPage
->
m_LowBoxSizer
,
wxSize
(
H_SIZE
-
10
,
-
1
)
);
}
CurrPage
->
m_TitleStringCtrl
=
new
WinEDA_EnterText
(
CurrPage
,
_
(
"Title:"
),
title
,
CurrPage
->
m_LowBoxSizer
,
wxSize
(
H_SIZE
-
10
,
-
1
)
);
}
}
}
...
@@ -325,32 +323,34 @@ EDA_NoteBookPage * CurrPage;
...
@@ -325,32 +323,34 @@ EDA_NoteBookPage * CurrPage;
void
WinEDA_NetlistFrame
::
SetupPlugin
(
wxCommandEvent
&
event
)
void
WinEDA_NetlistFrame
::
SetupPlugin
(
wxCommandEvent
&
event
)
/***********************************************************/
/***********************************************************/
/* Browse the plugin files and set the m_CommandStringCtrl field
/* Browse the plugin files and set the m_CommandStringCtrl field
*/
*/
{
{
wxString
FullFileName
,
Mask
,
Path
;
wxString
FullFileName
,
Mask
,
Path
;
Mask
=
wxT
(
"*"
);
Mask
=
wxT
(
"*"
);
Path
=
g_EDA_Appl
->
m_BinDir
;
Path
=
g_EDA_Appl
->
m_BinDir
;
FullFileName
=
EDA_FileSelector
(
_
(
"Plugin files:"
),
FullFileName
=
EDA_FileSelector
(
_
(
"Plugin files:"
),
Path
,
/* Chemin par defaut */
Path
,
/* Chemin par defaut */
FullFileName
,
/* nom fichier par defaut */
FullFileName
,
/* nom fichier par defaut */
wxEmptyString
,
/* extension par defaut */
wxEmptyString
,
/* extension par defaut */
Mask
,
/* Masque d'affichage */
Mask
,
/* Masque d'affichage */
this
,
this
,
wxFD_OPEN
,
wxFD_OPEN
,
TRUE
TRUE
);
);
if
(
FullFileName
.
IsEmpty
()
)
return
;
if
(
FullFileName
.
IsEmpty
()
)
return
;
EDA_NoteBookPage
*
CurrPage
;
EDA_NoteBookPage
*
CurrPage
;
CurrPage
=
(
EDA_NoteBookPage
*
)
m_NoteBook
->
GetCurrentPage
();
CurrPage
=
(
EDA_NoteBookPage
*
)
m_NoteBook
->
GetCurrentPage
();
if
(
CurrPage
==
NULL
)
return
;
if
(
CurrPage
==
NULL
)
return
;
CurrPage
->
m_CommandStringCtrl
->
SetValue
(
FullFileName
);
CurrPage
->
m_CommandStringCtrl
->
SetValue
(
FullFileName
);
/* Get a title for thgis page */
wxString
title
=
CurrPage
->
m_TitleStringCtrl
->
GetValue
();
/* Get a title for this page */
if
(
title
.
IsEmpty
()
)
wxString
title
=
CurrPage
->
m_TitleStringCtrl
->
GetValue
();
DisplayInfo
(
this
,
_
(
"Now, you must choose a title for this netlist control page
\n
and close the dialog box"
));
if
(
title
.
IsEmpty
()
)
DisplayInfo
(
this
,
_
(
"Now, you must choose a title for this netlist control page
\n
and close the dialog box"
));
}
}
...
@@ -362,164 +362,175 @@ void WinEDA_NetlistFrame::SelectNetlistType(wxCommandEvent& event)
...
@@ -362,164 +362,175 @@ void WinEDA_NetlistFrame::SelectNetlistType(wxCommandEvent& event)
int
ii
;
int
ii
;
EDA_NoteBookPage
*
CurrPage
;
EDA_NoteBookPage
*
CurrPage
;
for
(
ii
=
0
;
ii
<
PANELCUSTOMBASE
+
CUSTOMPANEL_COUNTMAX
;
ii
++
)
for
(
ii
=
0
;
ii
<
PANELCUSTOMBASE
+
CUSTOMPANEL_COUNTMAX
;
ii
++
)
if
(
m_PanelNetType
[
ii
]
)
if
(
m_PanelNetType
[
ii
]
)
m_PanelNetType
[
ii
]
->
m_IsCurrentFormat
->
SetValue
(
FALSE
);
m_PanelNetType
[
ii
]
->
m_IsCurrentFormat
->
SetValue
(
FALSE
);
CurrPage
=
(
EDA_NoteBookPage
*
)
m_NoteBook
->
GetCurrentPage
();
CurrPage
=
(
EDA_NoteBookPage
*
)
m_NoteBook
->
GetCurrentPage
();
if
(
CurrPage
==
NULL
)
return
;
if
(
CurrPage
==
NULL
)
return
;
g_NetFormat
=
CurrPage
->
m_IdNetType
;
CurrPage
->
m_IsCurrentFormat
->
SetValue
(
TRUE
);
g_NetFormat
=
CurrPage
->
m_IdNetType
;
CurrPage
->
m_IsCurrentFormat
->
SetValue
(
TRUE
);
}
}
/***********************************************/
/***********************************************/
void
WinEDA_NetlistFrame
::
NetlistUpdateOpt
()
void
WinEDA_NetlistFrame
::
NetlistUpdateOpt
()
/***********************************************/
/***********************************************/
{
{
int
ii
;
int
ii
;
g_SimulatorCommandLine
=
g_SimulatorCommandLine
=
m_PanelNetType
[
PANELSPICE
]
->
m_CommandStringCtrl
->
GetValue
();
m_PanelNetType
[
PANELSPICE
]
->
m_CommandStringCtrl
->
GetValue
();
g_NetFormat
=
NET_TYPE_PCBNEW
;
g_NetFormat
=
NET_TYPE_PCBNEW
;
for
(
ii
=
0
;
ii
<
PANELCUSTOMBASE
+
CUSTOMPANEL_COUNTMAX
;
ii
++
)
for
(
ii
=
0
;
ii
<
PANELCUSTOMBASE
+
CUSTOMPANEL_COUNTMAX
;
ii
++
)
{
{
if
(
m_PanelNetType
[
ii
]
==
NULL
)
break
;
if
(
m_PanelNetType
[
ii
]
==
NULL
)
if
(
m_PanelNetType
[
ii
]
->
m_IsCurrentFormat
->
GetValue
()
==
TRUE
)
break
;
g_NetFormat
=
m_PanelNetType
[
ii
]
->
m_IdNetType
;
if
(
m_PanelNetType
[
ii
]
->
m_IsCurrentFormat
->
GetValue
()
==
TRUE
)
}
g_NetFormat
=
m_PanelNetType
[
ii
]
->
m_IdNetType
;
}
g_OptNetListUseNames
=
TRUE
;
// Used for pspice, gnucap
if
(
m_UseNetNamesInNetlist
->
GetSelection
()
==
1
)
g_OptNetListUseNames
=
TRUE
;
// Used for pspice, gnucap
g_OptNetListUseNames
=
FALSE
;
if
(
m_UseNetNamesInNetlist
->
GetSelection
()
==
1
)
g_OptNetListUseNames
=
FALSE
;
}
}
/**********************************************************/
/**********************************************************/
void
WinEDA_NetlistFrame
::
GenNetlist
(
wxCommandEvent
&
event
)
void
WinEDA_NetlistFrame
::
GenNetlist
(
wxCommandEvent
&
event
)
/**********************************************************/
/**********************************************************/
{
{
wxString
FullFileName
,
FileExt
,
Mask
;
wxString
FullFileName
,
FileExt
,
Mask
;
wxString
msg
,
Command
;
int
netformat_tmp
=
g_NetFormat
;
int
netformat_tmp
=
g_NetFormat
;
NetlistUpdateOpt
();
NetlistUpdateOpt
();
EDA_NoteBookPage
*
CurrPage
;
EDA_NoteBookPage
*
CurrPage
;
CurrPage
=
(
EDA_NoteBookPage
*
)
m_NoteBook
->
GetCurrentPage
();
CurrPage
=
(
EDA_NoteBookPage
*
)
m_NoteBook
->
GetCurrentPage
();
g_NetFormat
=
CurrPage
->
m_IdNetType
;
g_NetFormat
=
CurrPage
->
m_IdNetType
;
/* Calcul du nom du fichier netlist */
/* Calcul du nom du fichier netlist */
FullFileName
=
ScreenSch
->
m_FileName
;
FullFileName
=
ScreenSch
->
m_FileName
;
switch
(
g_NetFormat
)
switch
(
g_NetFormat
)
{
{
case
NET_TYPE_SPICE
:
case
NET_TYPE_SPICE
:
FileExt
=
wxT
(
".cir"
);
FileExt
=
wxT
(
".cir"
);
break
;
break
;
case
NET_TYPE_CADSTAR
:
FileExt
=
wxT
(
".frp"
);
case
NET_TYPE_CADSTAR
:
break
;
FileExt
=
wxT
(
".frp"
);
default
:
break
;
FileExt
=
g_NetExtBuffer
;
break
;
default
:
}
FileExt
=
g_NetExtBuffer
;
break
;
Mask
=
wxT
(
"*"
)
+
FileExt
+
wxT
(
"*"
);
}
ChangeFileNameExt
(
FullFileName
,
FileExt
);
Mask
=
wxT
(
"*"
)
+
FileExt
+
wxT
(
"*"
);
FullFileName
=
EDA_FileSelector
(
_
(
"Netlist files:"
),
ChangeFileNameExt
(
FullFileName
,
FileExt
);
wxEmptyString
,
/* Chemin par defaut */
FullFileName
,
/* nom fichier par defaut */
FullFileName
=
EDA_FileSelector
(
_
(
"Netlist files:"
),
FileExt
,
/* extension par defaut */
wxEmptyString
,
/* Chemin par defaut */
Mask
,
/* Masque d'affichage */
FullFileName
,
/* nom fichier par defaut */
this
,
FileExt
,
/* extension par defaut */
wxFD_SAVE
,
Mask
,
/* Masque d'affichage */
TRUE
this
,
);
wxFD_SAVE
,
if
(
FullFileName
.
IsEmpty
()
)
return
;
TRUE
);
m_Parent
->
MsgPanel
->
EraseMsgBox
();
if
(
FullFileName
.
IsEmpty
()
)
return
;
ReAnnotatePowerSymbolsOnly
();
if
(
CheckAnnotate
(
m_Parent
,
0
)
)
m_Parent
->
MsgPanel
->
EraseMsgBox
();
{
if
(
!
IsOK
(
this
,
_
(
"Must be Annotated, Continue ?"
))
)
ReAnnotatePowerSymbolsOnly
();
return
;
if
(
CheckAnnotate
(
m_Parent
,
0
)
)
}
{
if
(
!
IsOK
(
this
,
_
(
"Must be Annotated, Continue ?"
)
)
)
/* Cleanup the entire hierarchy */
return
;
EDA_ScreenList
ScreenList
(
NULL
);
}
for
(
SCH_SCREEN
*
screen
=
ScreenList
.
GetFirst
();
screen
!=
NULL
;
screen
=
ScreenList
.
GetNext
()
)
{
/* Cleanup the entire hierarchy */
bool
ModifyWires
;
EDA_ScreenList
ScreenList
(
NULL
);
ModifyWires
=
screen
->
SchematicCleanUp
(
NULL
);
for
(
SCH_SCREEN
*
screen
=
ScreenList
.
GetFirst
();
screen
!=
NULL
;
screen
=
ScreenList
.
GetNext
()
)
/* if wire list has changed, delete the Undo Redo list to avoid
{
pointer problems with deleted data */
bool
ModifyWires
;
if
(
ModifyWires
)
ModifyWires
=
screen
->
SchematicCleanUp
(
NULL
);
screen
->
ClearUndoRedoList
();
// if wire list has changed, delete the Undo Redo list to avoid
}
// pointer problems with deleted data
if
(
ModifyWires
)
m_Parent
->
BuildNetListBase
();
screen
->
ClearUndoRedoList
();
if
(
CurrPage
->
m_CommandStringCtrl
)
}
g_NetListerCommandLine
=
CurrPage
->
m_CommandStringCtrl
->
GetValue
();
else
g_NetListerCommandLine
.
Empty
();
m_Parent
->
BuildNetListBase
();
if
(
CurrPage
->
m_CommandStringCtrl
)
switch
(
g_NetFormat
)
g_NetListerCommandLine
=
CurrPage
->
m_CommandStringCtrl
->
GetValue
();
{
else
default
:
g_NetListerCommandLine
.
Empty
();
WriteNetList
(
m_Parent
,
FullFileName
,
TRUE
);
break
;
switch
(
g_NetFormat
)
{
case
NET_TYPE_CADSTAR
:
default
:
case
NET_TYPE_ORCADPCB2
:
WriteNetList
(
m_Parent
,
FullFileName
,
TRUE
);
WriteNetList
(
m_Parent
,
FullFileName
,
FALSE
);
break
;
case
NET_TYPE_SPICE
:
case
NET_TYPE_CADSTAR
:
g_OptNetListUseNames
=
TRUE
;
// Used for pspice, gnucap
case
NET_TYPE_ORCADPCB2
:
if
(
m_UseNetNamesInNetlist
->
GetSelection
()
==
1
)
WriteNetList
(
m_Parent
,
FullFileName
,
FALSE
);
g_OptNetListUseNames
=
FALSE
;
WriteNetList
(
m_Parent
,
FullFileName
,
g_OptNetListUseNames
);
case
NET_TYPE_SPICE
:
break
;
g_OptNetListUseNames
=
TRUE
;
// Used for pspice, gnucap
}
if
(
m_UseNetNamesInNetlist
->
GetSelection
()
==
1
)
FreeTabNetList
(
g_TabObjNet
,
g_NbrObjNet
);
g_OptNetListUseNames
=
FALSE
;
g_NetFormat
=
netformat_tmp
;
WriteNetList
(
m_Parent
,
FullFileName
,
g_OptNetListUseNames
);
break
;
NetlistExit
(
event
);
}
FreeTabNetList
(
g_TabObjNet
,
g_NbrObjNet
);
g_NetFormat
=
netformat_tmp
;
NetlistUpdateOpt
();
// Update the new titles
for
(
int
ii
=
0
;
ii
<
CUSTOMPANEL_COUNTMAX
;
ii
++
)
{
EDA_NoteBookPage
*
CurrPage
=
m_PanelNetType
[
ii
+
PANELCUSTOMBASE
];
if
(
CurrPage
==
NULL
)
break
;
msg
=
wxT
(
"Custom"
);
msg
<<
ii
+
1
;
if
(
CurrPage
->
m_TitleStringCtrl
)
{
wxString
title
=
CurrPage
->
m_TitleStringCtrl
->
GetValue
();
if
(
msg
!=
title
)
// Title has changed, Update config
{
msg
=
CUSTOM_NETLIST_TITLE
;
msg
<<
ii
+
1
;
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
msg
,
title
);
}
}
if
(
CurrPage
->
m_CommandStringCtrl
)
{
Command
=
CurrPage
->
m_CommandStringCtrl
->
GetValue
();
msg
=
CUSTOM_NETLIST_COMMAND
;
msg
<<
ii
+
1
;
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
msg
,
Command
);
}
}
EndModal
(
0
);
}
}
/***********************************************************/
/***********************************************************/
void
WinEDA_NetlistFrame
::
NetlistExit
(
wxCommandEvent
&
event
)
void
WinEDA_NetlistFrame
::
OnCancelClick
(
wxCommandEvent
&
event
)
/***********************************************************/
/***********************************************************/
{
{
wxString
msg
,
Command
;
EndModal
(
-
1
);
NetlistUpdateOpt
();
// Update the new titles
for
(
int
ii
=
0
;
ii
<
CUSTOMPANEL_COUNTMAX
;
ii
++
)
{
EDA_NoteBookPage
*
CurrPage
=
m_PanelNetType
[
ii
+
PANELCUSTOMBASE
];
if
(
CurrPage
==
NULL
)
break
;
msg
=
wxT
(
"Custom"
);
msg
<<
ii
+
1
;
if
(
CurrPage
->
m_TitleStringCtrl
)
{
wxString
title
=
CurrPage
->
m_TitleStringCtrl
->
GetValue
();
if
(
msg
!=
title
)
// Title has changed, Update config
{
msg
=
CUSTOM_NETLIST_TITLE
;
msg
<<
ii
+
1
;
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
msg
,
title
);
}
}
if
(
CurrPage
->
m_CommandStringCtrl
)
{
Command
=
CurrPage
->
m_CommandStringCtrl
->
GetValue
();
msg
=
CUSTOM_NETLIST_COMMAND
;
msg
<<
ii
+
1
;
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
msg
,
Command
);
}
}
Close
();
}
}
...
@@ -529,20 +540,19 @@ void WinEDA_NetlistFrame::RunSimulator(wxCommandEvent& event)
...
@@ -529,20 +540,19 @@ void WinEDA_NetlistFrame::RunSimulator(wxCommandEvent& event)
{
{
wxString
NetlistFullFileName
,
ExecFile
,
CommandLine
;
wxString
NetlistFullFileName
,
ExecFile
,
CommandLine
;
g_SimulatorCommandLine
=
g_SimulatorCommandLine
=
m_PanelNetType
[
PANELSPICE
]
->
m_CommandStringCtrl
->
GetValue
();
m_PanelNetType
[
PANELSPICE
]
->
m_CommandStringCtrl
->
GetValue
();
g_SimulatorCommandLine
.
Trim
(
FALSE
);
g_SimulatorCommandLine
.
Trim
(
FALSE
);
g_SimulatorCommandLine
.
Trim
(
TRUE
);
g_SimulatorCommandLine
.
Trim
(
TRUE
);
ExecFile
=
g_SimulatorCommandLine
.
BeforeFirst
(
' '
);
ExecFile
=
g_SimulatorCommandLine
.
BeforeFirst
(
' '
);
CommandLine
=
g_SimulatorCommandLine
.
AfterFirst
(
' '
);
CommandLine
=
g_SimulatorCommandLine
.
AfterFirst
(
' '
);
/* Calcul du nom du fichier netlist */
/* Calcul du nom du fichier netlist */
NetlistFullFileName
=
ScreenSch
->
m_FileName
;
NetlistFullFileName
=
ScreenSch
->
m_FileName
;
ChangeFileNameExt
(
NetlistFullFileName
,
wxT
(
".cir"
));
ChangeFileNameExt
(
NetlistFullFileName
,
wxT
(
".cir"
));
AddDelimiterString
(
NetlistFullFileName
);
AddDelimiterString
(
NetlistFullFileName
);
CommandLine
+=
wxT
(
" "
)
+
NetlistFullFileName
;
CommandLine
+=
wxT
(
" "
)
+
NetlistFullFileName
;
ExecuteFile
(
this
,
ExecFile
,
CommandLine
);
ExecuteFile
(
this
,
ExecFile
,
CommandLine
);
}
}
gerbview/select_layers_to_pcb.cpp
View file @
67feced1
...
@@ -176,8 +176,8 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent) :
...
@@ -176,8 +176,8 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent) :
// pcbnew layer that the Gerber layer has been mapped to). Each of those items are
// pcbnew layer that the Gerber layer has been mapped to). Each of those items are
// placed into the left hand column, middle column, and right hand column
// placed into the left hand column, middle column, and right hand column
// (respectively) of the Flexgrid sizer, and the color of the second text string
// (respectively) of the Flexgrid sizer, and the color of the second text string
// is set to
blue (to indicate that the actual text changes depending upon which
// is set to
fushia or blue (to respectively indicate whether the Gerber layer has
//
pcbnew layer has been selected by the child dialog box
).
//
been mapped to a pcbnew layer or is not being exported at all
).
// (Experimentation has shown that if a text control is used to depict which
// (Experimentation has shown that if a text control is used to depict which
// pcbnew layer that each Gerber layer is mapped to (instead of a static text
// pcbnew layer that each Gerber layer is mapped to (instead of a static text
// string), then those controls do not behave in a fully satisfactory manner in
// string), then those controls do not behave in a fully satisfactory manner in
...
@@ -224,7 +224,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent) :
...
@@ -224,7 +224,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent) :
// Provide another text string to specify which pcbnew layer that this
// Provide another text string to specify which pcbnew layer that this
// Gerber layer is initially mapped to, and set the initial text to
// Gerber layer is initially mapped to, and set the initial text to
// specify the appropriate pcbnew layer, and set the foreground color
// specify the appropriate pcbnew layer, and set the foreground color
// of the text to
blue (to indicate that the text can be chang
ed).
// of the text to
fushia (to indicate that the layer is being export
ed).
item_ID
=
ID_TEXT_0
+
ii
;
item_ID
=
ID_TEXT_0
+
ii
;
// When the first of these text strings is being added, determine what size is necessary to
// When the first of these text strings is being added, determine what size is necessary to
...
@@ -252,7 +252,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent) :
...
@@ -252,7 +252,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent) :
text
=
new
wxStaticText
(
this
,
item_ID
,
msg
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
text
=
new
wxStaticText
(
this
,
item_ID
,
msg
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
}
}
text
->
SetMinSize
(
goodSize
);
text
->
SetMinSize
(
goodSize
);
text
->
SetForegroundColour
(
*
wxBLUE
);
text
->
SetForegroundColour
(
wxColour
(
255
,
0
,
128
)
);
FlexColumnBoxSizer
->
Add
(
text
,
1
,
wxALIGN_LEFT
|
wxALIGN_CENTER_VERTICAL
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
,
5
);
FlexColumnBoxSizer
->
Add
(
text
,
1
,
wxALIGN_LEFT
|
wxALIGN_CENTER_VERTICAL
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
,
5
);
layer_list
[
ii
]
=
text
;
layer_list
[
ii
]
=
text
;
...
@@ -278,7 +278,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent) :
...
@@ -278,7 +278,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent) :
// using that type of sizer results in those buttons being automatically
// using that type of sizer results in those buttons being automatically
// located in positions appropriate for each (OS) version of KiCad.
// located in positions appropriate for each (OS) version of KiCad.
StdDialogButtonSizer
=
new
wxStdDialogButtonSizer
;
StdDialogButtonSizer
=
new
wxStdDialogButtonSizer
;
OuterBoxSizer
->
Add
(
StdDialogButtonSizer
,
0
,
wx
ALIGN_RIGHT
|
wxALL
,
10
);
OuterBoxSizer
->
Add
(
StdDialogButtonSizer
,
0
,
wx
GROW
|
wxALL
,
10
);
Button
=
new
wxButton
(
this
,
wxID_OK
,
_
(
"&OK"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
Button
=
new
wxButton
(
this
,
wxID_OK
,
_
(
"&OK"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
Button
->
SetForegroundColour
(
*
wxRED
);
Button
->
SetForegroundColour
(
*
wxRED
);
...
@@ -323,9 +323,19 @@ void WinEDA_SwapLayerFrame::Sel_Layer(wxCommandEvent& event)
...
@@ -323,9 +323,19 @@ void WinEDA_SwapLayerFrame::Sel_Layer(wxCommandEvent& event)
{
{
LayerLookUpTable
[
ButtonTable
[
ii
]]
=
jj
;
LayerLookUpTable
[
ButtonTable
[
ii
]]
=
jj
;
if
(
jj
==
NB_LAYERS
)
if
(
jj
==
NB_LAYERS
)
{
layer_list
[
ii
]
->
SetLabel
(
_
(
"Do not export"
)
);
layer_list
[
ii
]
->
SetLabel
(
_
(
"Do not export"
)
);
// Change the text color to blue (to highlight
// that this layer is *not* being exported)
layer_list
[
ii
]
->
SetForegroundColour
(
*
wxBLUE
);
}
else
else
{
layer_list
[
ii
]
->
SetLabel
(
ReturnPcbLayerName
(
jj
)
);
layer_list
[
ii
]
->
SetLabel
(
ReturnPcbLayerName
(
jj
)
);
// Change the text color to fushia (to highlight
// that this layer *is* being exported)
layer_list
[
ii
]
->
SetForegroundColour
(
wxColour
(
255
,
0
,
128
)
);
}
}
}
}
}
...
...
pcbnew/swap_layers.cpp
View file @
67feced1
...
@@ -125,9 +125,9 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
...
@@ -125,9 +125,9 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
// layer is mapped to), and a second static text string (to depict which layer
// layer is mapped to), and a second static text string (to depict which layer
// that the layer has been mapped to). Each of those items are placed into
// that the layer has been mapped to). Each of those items are placed into
// the left hand column, middle column, and right hand column (respectively)
// the left hand column, middle column, and right hand column (respectively)
// of the Flexgrid sizer, and the color of the second text string is set to
blue
// of the Flexgrid sizer, and the color of the second text string is set to
//
(to indicate that the actual text changes depending upon which
layer has been
//
fushia or blue (to respectively indicate whether the
layer has been
// s
elected by the child dialog box
).
// s
wapped to another layer or is not being swapped at all
).
// (Experimentation has shown that if a text control is used to depict which
// (Experimentation has shown that if a text control is used to depict which
// layer that each layer is mapped to (instead of a static text string), then
// layer that each layer is mapped to (instead of a static text string), then
// those controls do not behave in a fully satisfactory manner in the Linux
// those controls do not behave in a fully satisfactory manner in the Linux
...
@@ -165,7 +165,8 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
...
@@ -165,7 +165,8 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
// Provide another text string to specify which layer that this layer is
// Provide another text string to specify which layer that this layer is
// mapped to, set the initial text to "No Change" (to indicate that this
// mapped to, set the initial text to "No Change" (to indicate that this
// layer is currently unmapped to any other layer), and set the foreground
// layer is currently unmapped to any other layer), and set the foreground
// color of the text to blue (to indicate that the text can be changed).
// color of the text to blue (which also indicates that the layer is
// currently unmapped to any other layer).
item_ID
=
ID_TEXT_0
+
ii
;
item_ID
=
ID_TEXT_0
+
ii
;
// When the first of these text strings is being added, determine what size is necessary to
// When the first of these text strings is being added, determine what size is necessary to
...
@@ -213,7 +214,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
...
@@ -213,7 +214,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
// using that type of sizer results in those buttons being automatically
// using that type of sizer results in those buttons being automatically
// located in positions appropriate for each (OS) version of KiCad.
// located in positions appropriate for each (OS) version of KiCad.
StdDialogButtonSizer
=
new
wxStdDialogButtonSizer
;
StdDialogButtonSizer
=
new
wxStdDialogButtonSizer
;
OuterBoxSizer
->
Add
(
StdDialogButtonSizer
,
0
,
wx
ALIGN_RIGHT
|
wxALL
,
10
);
OuterBoxSizer
->
Add
(
StdDialogButtonSizer
,
0
,
wx
GROW
|
wxALL
,
10
);
Button
=
new
wxButton
(
this
,
wxID_OK
,
_
(
"&OK"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
Button
=
new
wxButton
(
this
,
wxID_OK
,
_
(
"&OK"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
Button
->
SetForegroundColour
(
*
wxRED
);
Button
->
SetForegroundColour
(
*
wxRED
);
...
@@ -270,9 +271,19 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event )
...
@@ -270,9 +271,19 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event )
{
{
New_Layer
[
ii
]
=
jj
;
New_Layer
[
ii
]
=
jj
;
if
(
jj
==
NB_LAYERS
)
if
(
jj
==
NB_LAYERS
)
{
layer_list
[
ii
]
->
SetLabel
(
_
(
"No Change"
)
);
layer_list
[
ii
]
->
SetLabel
(
_
(
"No Change"
)
);
// Change the text color to blue (to highlight
// that this layer is *not* being swapped)
layer_list
[
ii
]
->
SetForegroundColour
(
*
wxBLUE
);
}
else
else
{
layer_list
[
ii
]
->
SetLabel
(
ReturnPcbLayerName
(
jj
)
);
layer_list
[
ii
]
->
SetLabel
(
ReturnPcbLayerName
(
jj
)
);
// Change the text color to fushia (to highlight
// that this layer *is* being swapped)
layer_list
[
ii
]
->
SetForegroundColour
(
wxColour
(
255
,
0
,
128
)
);
}
}
}
}
}
...
...
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