2007-11-05 06:14:55 +00:00
|
|
|
/**********************************/
|
|
|
|
/* Dialog box for netlist outputs */
|
|
|
|
/**********************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
/* Functions relatives to the dialog creating the netlist for pcbnew.
|
2009-11-04 20:46:53 +00:00
|
|
|
* The dialog is a notebook with 4 fixed netlist format:
|
2007-11-10 14:35:04 +00:00
|
|
|
* PCBNEW ORCADPCB2 CADSTAR and SPICE
|
|
|
|
* and up to CUSTOMPANEL_COUNTMAX (see netlist.h) user programmable format
|
|
|
|
* calling an external converter with convert an intermediate format to the
|
|
|
|
* user specific format.
|
2009-11-04 20:46:53 +00:00
|
|
|
* these external converters are referred there as plugins,
|
2007-11-10 14:35:04 +00:00
|
|
|
* but there are not really plugins, there are only external binaries
|
|
|
|
*/
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "fctsys.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "appl_wxstruct.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "common.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
#include "confirm.h"
|
|
|
|
#include "gestfich.h"
|
2010-11-10 15:30:12 +00:00
|
|
|
#include "wxEeschemaStruct.h"
|
|
|
|
#include "class_sch_screen.h"
|
2009-09-25 18:49:04 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "general.h"
|
2007-11-10 14:35:04 +00:00
|
|
|
#include "netlist.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "protos.h"
|
2010-11-11 21:10:27 +00:00
|
|
|
#include "sch_sheet.h"
|
2010-11-18 21:16:28 +00:00
|
|
|
#include "dialog_helpers.h"
|
|
|
|
#include "netlist_control.h"
|
2011-01-10 17:47:50 +00:00
|
|
|
#include "dialogs/annotate_dialog.h"
|
2010-11-10 15:30:12 +00:00
|
|
|
|
2008-02-27 19:38:16 +00:00
|
|
|
|
2010-06-28 13:11:14 +00:00
|
|
|
//Imported function:
|
2010-07-14 13:24:36 +00:00
|
|
|
int TestDuplicateSheetNames( bool aCreateMarker );
|
2009-09-25 18:49:04 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
// ID for configuration:
|
2007-11-10 14:35:04 +00:00
|
|
|
#define CUSTOM_NETLIST_TITLE wxT( "CustomNetlistTitle" )
|
|
|
|
#define CUSTOM_NETLIST_COMMAND wxT( "CustomNetlistCommand" )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
|
|
|
* Function ReturnUserNetlistTypeName
|
2007-11-10 14:35:04 +00:00
|
|
|
* to retrieve user netlist type names
|
2010-12-14 15:56:30 +00:00
|
|
|
* @param first_item = true: return first name of the list, false = return next
|
2007-11-10 14:35:04 +00:00
|
|
|
* @return a wxString : name of the type netlist or empty string
|
|
|
|
* this function must be called first with "first_item" = true
|
|
|
|
* and after with "first_item" = false to get all the other existing netlist names
|
|
|
|
*/
|
2010-12-14 15:56:30 +00:00
|
|
|
wxString ReturnUserNetlistTypeName( bool first_item )
|
2007-11-10 14:35:04 +00:00
|
|
|
{
|
|
|
|
static int index;
|
|
|
|
wxString name, msg;
|
|
|
|
|
|
|
|
if( first_item )
|
|
|
|
index = 0;
|
|
|
|
else
|
|
|
|
index++;
|
|
|
|
|
|
|
|
msg = CUSTOM_NETLIST_TITLE;
|
|
|
|
msg << index + 1;
|
|
|
|
|
2008-12-08 15:27:13 +00:00
|
|
|
if( wxGetApp().m_EDA_Config )
|
|
|
|
name = wxGetApp().m_EDA_Config->Read( msg );
|
2007-11-10 14:35:04 +00:00
|
|
|
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE( WinEDA_NetlistFrame, wxDialog )
|
2010-12-14 15:56:30 +00:00
|
|
|
EVT_BUTTON( wxID_CANCEL, WinEDA_NetlistFrame::OnCancelClick )
|
|
|
|
EVT_BUTTON( ID_CREATE_NETLIST, WinEDA_NetlistFrame::GenNetlist )
|
|
|
|
EVT_BUTTON( ID_SETUP_PLUGIN, WinEDA_NetlistFrame::SetupPluginData )
|
|
|
|
EVT_BUTTON( ID_DELETE_PLUGIN, WinEDA_NetlistFrame::DeletePluginPanel )
|
|
|
|
EVT_BUTTON( ID_VALIDATE_PLUGIN, WinEDA_NetlistFrame::ValidatePluginPanel )
|
|
|
|
EVT_CHECKBOX( ID_CURRENT_FORMAT_IS_DEFAULT,
|
|
|
|
WinEDA_NetlistFrame::SelectNetlistType )
|
|
|
|
EVT_BUTTON( ID_RUN_SIMULATOR, WinEDA_NetlistFrame::RunSimulator )
|
2007-11-10 14:35:04 +00:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************/
|
|
|
|
/* Functions for these classes */
|
|
|
|
/*******************************/
|
|
|
|
|
|
|
|
|
2010-12-29 17:47:32 +00:00
|
|
|
/* Contructor to create a setup page for one netlist format.
|
2007-11-05 06:14:55 +00:00
|
|
|
* Used in Netlist format Dialog box creation
|
|
|
|
*/
|
2010-12-14 15:56:30 +00:00
|
|
|
EDA_NoteBookPage::EDA_NoteBookPage( wxNotebook* parent,
|
|
|
|
const wxString& title,
|
|
|
|
int id_NetType,
|
|
|
|
int idCheckBox,
|
|
|
|
int idCreateFile,
|
|
|
|
bool selected ) :
|
|
|
|
wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_SUNKEN )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-11-05 06:14:55 +00:00
|
|
|
m_IdNetType = id_NetType;
|
|
|
|
m_CommandStringCtrl = NULL;
|
2007-11-10 14:35:04 +00:00
|
|
|
m_TitleStringCtrl = NULL;
|
|
|
|
m_IsCurrentFormat = NULL;
|
2007-11-05 06:14:55 +00:00
|
|
|
m_ButtonCancel = NULL;
|
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
parent->AddPage( this, title, selected );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
SetSizer( MainBoxSizer );
|
|
|
|
wxBoxSizer* UpperBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
|
|
|
m_LowBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
MainBoxSizer->Add( UpperBoxSizer, 0, wxGROW | wxALL, 5 );
|
|
|
|
MainBoxSizer->Add( m_LowBoxSizer, 0, wxGROW | wxALL, 5 );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
m_LeftBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
m_RightBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
m_RightOptionsBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
UpperBoxSizer->Add( m_LeftBoxSizer, 0, wxGROW | wxALL, 5 );
|
|
|
|
UpperBoxSizer->Add( m_RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
|
2008-12-08 15:27:13 +00:00
|
|
|
UpperBoxSizer->Add( m_RightOptionsBoxSizer,
|
|
|
|
0,
|
|
|
|
wxALIGN_CENTER_VERTICAL | wxALL,
|
|
|
|
5 );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
|
|
|
if( idCheckBox )
|
|
|
|
{
|
2007-11-10 14:35:04 +00:00
|
|
|
wxStaticText* text = new wxStaticText( this, -1, _( "Options:" ) );
|
|
|
|
m_LeftBoxSizer->Add( text, 0, wxGROW | wxALL, 5 );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2008-12-08 15:27:13 +00:00
|
|
|
m_IsCurrentFormat =
|
|
|
|
new wxCheckBox( this, idCheckBox, _( "Default format" ) );
|
2007-11-10 14:35:04 +00:00
|
|
|
m_LeftBoxSizer->Add( m_IsCurrentFormat, 0, wxGROW | wxALL, 5 );
|
2009-04-29 17:09:00 +00:00
|
|
|
m_IsCurrentFormat->SetValue( selected );
|
2007-11-05 06:14:55 +00:00
|
|
|
}
|
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
/* Create the buttons: Create Neltist or browse Plugin and Cancel
|
|
|
|
* and a third button for plugins : Remove or Ok button */
|
|
|
|
if( idCreateFile )
|
2007-11-05 06:14:55 +00:00
|
|
|
{
|
2007-11-10 14:35:04 +00:00
|
|
|
wxButton* Button;
|
|
|
|
if( idCreateFile == ID_SETUP_PLUGIN ) /* This is the "add plugin" panel */
|
|
|
|
Button = new wxButton( this, idCreateFile, _( "&Browse Plugin" ) );
|
2007-11-05 06:14:55 +00:00
|
|
|
else
|
2007-11-10 14:35:04 +00:00
|
|
|
Button = new wxButton( this, idCreateFile, _( "&Netlist" ) );
|
|
|
|
m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
|
|
|
m_ButtonCancel =
|
2008-12-08 15:27:13 +00:00
|
|
|
Button = new wxButton( this, wxID_CANCEL, _( "&Cancel" ) );
|
2007-11-10 14:35:04 +00:00
|
|
|
m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
/* Add special buttons to plugin panels:
|
|
|
|
* for panel plugins: added the "delete" button
|
|
|
|
* for the last panel (add plugin) a Ok button is added
|
|
|
|
*/
|
|
|
|
if( idCreateFile == ID_SETUP_PLUGIN ) /* This is the "add plugin" panel: add Ok button */
|
|
|
|
{
|
|
|
|
Button = new wxButton( this, ID_VALIDATE_PLUGIN, _( "&Ok" ) );
|
|
|
|
m_RightOptionsBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
|
|
|
|
}
|
|
|
|
else if( id_NetType >= PANELCUSTOMBASE ) /* This is a plugin panel: add delete button */
|
|
|
|
{
|
|
|
|
Button = new wxButton( this, ID_DELETE_PLUGIN, _( "&Delete" ) );
|
|
|
|
m_RightOptionsBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
|
|
|
|
}
|
2007-11-05 06:14:55 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*************************************************************************************/
|
2010-12-08 20:12:46 +00:00
|
|
|
WinEDA_NetlistFrame::WinEDA_NetlistFrame( SCH_EDIT_FRAME* parent ) :
|
2008-02-27 19:38:16 +00:00
|
|
|
wxDialog( parent, -1, _( "Netlist" ), wxDefaultPosition,
|
2007-11-10 14:35:04 +00:00
|
|
|
wxDefaultSize, DIALOG_STYLE | MAYBE_RESIZE_BORDER )
|
2007-06-05 12:10:51 +00:00
|
|
|
/*************************************************************************************/
|
2007-11-10 14:35:04 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/* Constructor for the netlist generation dialog box
|
2007-11-05 06:14:55 +00:00
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-11-10 14:35:04 +00:00
|
|
|
int ii;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
m_Parent = parent;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
|
2007-11-05 06:14:55 +00:00
|
|
|
{
|
|
|
|
m_PanelNetType[ii] = NULL;
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
wxBoxSizer* GeneralBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
SetSizer( GeneralBoxSizer );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
m_NoteBook = new wxNotebook( this, ID_NETLIST_NOTEBOOK,
|
2010-08-11 15:32:44 +00:00
|
|
|
wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxNB_TOP ); // @todo: tabs on top are being hidden on linux
|
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
GeneralBoxSizer->Add( m_NoteBook, 0, wxGROW | wxALL, 5 );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
// Add notebook pages:
|
2007-11-05 06:14:55 +00:00
|
|
|
|
|
|
|
// Add Panel FORMAT PCBNEW
|
2009-04-29 17:09:00 +00:00
|
|
|
m_PanelNetType[PANELPCBNEW] =
|
|
|
|
new EDA_NoteBookPage( m_NoteBook,
|
|
|
|
wxT( "Pcbnew" ),
|
|
|
|
NET_TYPE_PCBNEW,
|
|
|
|
ID_CURRENT_FORMAT_IS_DEFAULT,
|
|
|
|
ID_CREATE_NETLIST,
|
|
|
|
m_Parent->m_NetlistFormat == NET_TYPE_PCBNEW );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
|
|
|
// Add Panel FORMAT ORCADPCB2
|
2009-04-29 17:09:00 +00:00
|
|
|
m_PanelNetType[PANELORCADPCB2] =
|
|
|
|
new EDA_NoteBookPage( m_NoteBook,
|
|
|
|
wxT( "OrcadPCB2" ),
|
|
|
|
NET_TYPE_ORCADPCB2,
|
|
|
|
ID_CURRENT_FORMAT_IS_DEFAULT,
|
|
|
|
ID_CREATE_NETLIST,
|
|
|
|
m_Parent->m_NetlistFormat == NET_TYPE_ORCADPCB2 );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
|
|
|
// Add Panel FORMAT CADSTAR
|
2009-04-29 17:09:00 +00:00
|
|
|
m_PanelNetType[PANELCADSTAR] =
|
|
|
|
new EDA_NoteBookPage( m_NoteBook,
|
|
|
|
wxT( "CadStar" ),
|
|
|
|
NET_TYPE_CADSTAR,
|
|
|
|
ID_CURRENT_FORMAT_IS_DEFAULT,
|
|
|
|
ID_CREATE_NETLIST,
|
|
|
|
m_Parent->m_NetlistFormat == NET_TYPE_CADSTAR );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
// Add Panel spice
|
|
|
|
InstallPageSpice();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
// Add custom panels:
|
|
|
|
InstallCustomPages();
|
|
|
|
|
2010-08-11 14:47:16 +00:00
|
|
|
// GetSizer()->Fit( this );
|
2007-11-10 14:35:04 +00:00
|
|
|
GetSizer()->SetSizeHints( this );
|
2010-08-11 15:32:44 +00:00
|
|
|
|
2010-07-14 13:24:36 +00:00
|
|
|
Centre();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************/
|
2007-09-13 11:55:46 +00:00
|
|
|
void WinEDA_NetlistFrame::InstallPageSpice()
|
2007-06-05 12:10:51 +00:00
|
|
|
/*************************************************/
|
2007-11-10 14:35:04 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/* Create the spice page
|
2007-11-05 06:14:55 +00:00
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-11-10 14:35:04 +00:00
|
|
|
wxButton* Button;
|
|
|
|
EDA_NoteBookPage* page;
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
page = m_PanelNetType[PANELSPICE] =
|
2010-07-14 13:24:36 +00:00
|
|
|
new EDA_NoteBookPage( m_NoteBook,
|
|
|
|
wxT( "Spice" ),
|
|
|
|
NET_TYPE_SPICE,
|
|
|
|
0, 0,
|
|
|
|
m_Parent->m_NetlistFormat == NET_TYPE_SPICE );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2008-12-08 15:27:13 +00:00
|
|
|
page->m_IsCurrentFormat =
|
|
|
|
new wxCheckBox( page, ID_CURRENT_FORMAT_IS_DEFAULT,
|
2010-07-14 13:24:36 +00:00
|
|
|
_( "Default format" ) );
|
2009-04-29 17:09:00 +00:00
|
|
|
page->m_IsCurrentFormat->SetValue( m_Parent->m_NetlistFormat == NET_TYPE_SPICE );
|
2007-11-10 14:35:04 +00:00
|
|
|
page->m_LeftBoxSizer->Add( page->m_IsCurrentFormat, 0, wxGROW | wxALL, 5 );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
wxString netlist_opt[2] = { _( "Use Net Names" ), _( "Use Net Numbers" ) };
|
|
|
|
m_UseNetNamesInNetlist = new wxRadioBox( page, -1, _( "Netlist Options:" ),
|
|
|
|
wxDefaultPosition, wxDefaultSize,
|
2008-12-08 15:27:13 +00:00
|
|
|
2, netlist_opt, 1,
|
|
|
|
wxRA_SPECIFY_COLS );
|
2007-11-10 14:35:04 +00:00
|
|
|
if( !g_OptNetListUseNames )
|
|
|
|
m_UseNetNamesInNetlist->SetSelection( 1 );
|
|
|
|
page->m_LeftBoxSizer->Add( m_UseNetNamesInNetlist, 0, wxGROW | wxALL, 5 );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
|
|
|
page->m_CommandStringCtrl = new WinEDA_EnterText( page,
|
2008-12-08 15:27:13 +00:00
|
|
|
_( "Simulator command:" ),
|
2007-11-10 14:35:04 +00:00
|
|
|
g_SimulatorCommandLine,
|
2008-12-08 15:27:13 +00:00
|
|
|
page->m_LowBoxSizer,
|
|
|
|
wxDefaultSize );
|
2007-11-10 14:35:04 +00:00
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
// Add buttons
|
2007-11-10 14:35:04 +00:00
|
|
|
Button = new wxButton( page, ID_CREATE_NETLIST, _( "Netlist" ) );
|
|
|
|
page->m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
Button = new wxButton( page, ID_RUN_SIMULATOR, _( "&Run Simulator" ) );
|
|
|
|
page->m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
Button = new wxButton( page, wxID_CANCEL, _( "&Cancel" ) );
|
|
|
|
page->m_RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/*************************************************/
|
2007-09-13 11:55:46 +00:00
|
|
|
void WinEDA_NetlistFrame::InstallCustomPages()
|
2007-06-05 12:10:51 +00:00
|
|
|
/*************************************************/
|
2007-11-10 14:35:04 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/* create the pages for custom netlist format selection:
|
2007-11-05 06:14:55 +00:00
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2010-07-14 13:24:36 +00:00
|
|
|
bool selected;
|
|
|
|
int ii, CustomCount;
|
2007-11-10 14:35:04 +00:00
|
|
|
wxString title, previoustitle, msg;
|
|
|
|
EDA_NoteBookPage* CurrPage;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
CustomCount = CUSTOMPANEL_COUNTMAX;
|
|
|
|
previoustitle = wxT( "dummy_title" );
|
2007-11-05 06:14:55 +00:00
|
|
|
for( ii = 0; ii < CustomCount; ii++ )
|
|
|
|
{
|
2007-11-10 14:35:04 +00:00
|
|
|
title = ReturnUserNetlistTypeName( ii == 0 ? true : false );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
|
|
|
if( title.IsEmpty() && previoustitle.IsEmpty() )
|
2007-11-10 14:35:04 +00:00
|
|
|
break; // No more panel to install
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
selected = m_Parent->m_NetlistFormat == ( NET_TYPE_CUSTOM1 + ii );
|
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
/* Install the panel "Add Plugin" after
|
2009-11-04 20:46:53 +00:00
|
|
|
* the last initialized panel */
|
2007-11-05 06:14:55 +00:00
|
|
|
previoustitle = title;
|
|
|
|
if( title.IsEmpty() )
|
2007-11-10 14:35:04 +00:00
|
|
|
CurrPage =
|
|
|
|
m_PanelNetType[PANELCUSTOMBASE + ii] =
|
2008-12-08 15:27:13 +00:00
|
|
|
new EDA_NoteBookPage( m_NoteBook,
|
|
|
|
_( "Add Plugin" ),
|
2007-11-10 14:35:04 +00:00
|
|
|
NET_TYPE_CUSTOM1 + ii,
|
2008-12-08 15:27:13 +00:00
|
|
|
ID_CURRENT_FORMAT_IS_DEFAULT,
|
2009-04-29 17:09:00 +00:00
|
|
|
ID_SETUP_PLUGIN,
|
|
|
|
selected );
|
2007-11-10 14:35:04 +00:00
|
|
|
else /* Install a plugin panel */
|
|
|
|
CurrPage =
|
|
|
|
m_PanelNetType[PANELCUSTOMBASE + ii] =
|
2008-12-08 15:27:13 +00:00
|
|
|
new EDA_NoteBookPage( m_NoteBook,
|
|
|
|
title,
|
2007-11-10 14:35:04 +00:00
|
|
|
NET_TYPE_CUSTOM1 + ii,
|
2008-12-08 15:27:13 +00:00
|
|
|
ID_CURRENT_FORMAT_IS_DEFAULT,
|
2009-04-29 17:09:00 +00:00
|
|
|
ID_CREATE_NETLIST,
|
|
|
|
selected );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
|
|
|
msg = CUSTOM_NETLIST_COMMAND;
|
|
|
|
msg << ii + 1;
|
2008-12-08 15:27:13 +00:00
|
|
|
wxString Command = wxGetApp().m_EDA_Config->Read( msg );
|
2007-11-10 14:35:04 +00:00
|
|
|
CurrPage->m_CommandStringCtrl =
|
|
|
|
new WinEDA_EnterText( CurrPage,
|
|
|
|
_( "Netlist command:" ), Command,
|
|
|
|
CurrPage->m_LowBoxSizer,
|
|
|
|
wxDefaultSize );
|
|
|
|
|
|
|
|
CurrPage->m_TitleStringCtrl =
|
|
|
|
new WinEDA_EnterText( CurrPage,
|
|
|
|
_( "Title:" ), title,
|
|
|
|
CurrPage->m_LowBoxSizer,
|
|
|
|
wxDefaultSize );
|
2007-11-05 06:14:55 +00:00
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************/
|
2007-11-10 14:35:04 +00:00
|
|
|
void WinEDA_NetlistFrame::SetupPluginData( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
/***********************************************************/
|
2007-11-10 14:35:04 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/* Browse the plugin files and set the m_CommandStringCtrl field
|
2007-11-05 06:14:55 +00:00
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-11-10 14:35:04 +00:00
|
|
|
wxString FullFileName, Mask, Path;
|
|
|
|
|
|
|
|
Mask = wxT( "*" );
|
2008-12-08 15:27:13 +00:00
|
|
|
Path = wxGetApp().m_BinDir;
|
2007-11-10 14:35:04 +00:00
|
|
|
FullFileName = EDA_FileSelector( _( "Plugin files:" ),
|
2009-11-04 20:46:53 +00:00
|
|
|
Path,
|
|
|
|
FullFileName,
|
|
|
|
wxEmptyString,
|
|
|
|
Mask,
|
2007-11-10 14:35:04 +00:00
|
|
|
this,
|
|
|
|
wxFD_OPEN,
|
|
|
|
TRUE
|
|
|
|
);
|
2007-11-05 06:14:55 +00:00
|
|
|
if( FullFileName.IsEmpty() )
|
|
|
|
return;
|
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
EDA_NoteBookPage* CurrPage;
|
|
|
|
CurrPage = (EDA_NoteBookPage*) m_NoteBook->GetCurrentPage();
|
2007-11-05 06:14:55 +00:00
|
|
|
if( CurrPage == NULL )
|
|
|
|
return;
|
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
CurrPage->m_CommandStringCtrl->SetValue( FullFileName );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
|
|
|
/* Get a title for this page */
|
|
|
|
wxString title = CurrPage->m_TitleStringCtrl->GetValue();
|
|
|
|
if( title.IsEmpty() )
|
2009-04-17 08:51:02 +00:00
|
|
|
DisplayInfoMessage( this,
|
2010-07-14 13:24:36 +00:00
|
|
|
_( "Do not forget to choose a title for this \
|
|
|
|
netlist control page" ) );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************/
|
2007-11-10 14:35:04 +00:00
|
|
|
void WinEDA_NetlistFrame::SelectNetlistType( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
/*****************************************************************/
|
2008-12-08 15:27:13 +00:00
|
|
|
|
2007-11-10 15:02:33 +00:00
|
|
|
/* Called when the check box "default format" is clicked
|
2008-12-08 15:27:13 +00:00
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-11-10 14:35:04 +00:00
|
|
|
int ii;
|
|
|
|
EDA_NoteBookPage* CurrPage;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
|
|
|
|
if( m_PanelNetType[ii] )
|
2007-11-10 14:35:04 +00:00
|
|
|
m_PanelNetType[ii]->m_IsCurrentFormat->SetValue( FALSE );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
CurrPage = (EDA_NoteBookPage*) m_NoteBook->GetCurrentPage();
|
2007-11-05 06:14:55 +00:00
|
|
|
if( CurrPage == NULL )
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-04-29 17:09:00 +00:00
|
|
|
m_Parent->m_NetlistFormat = CurrPage->m_IdNetType;
|
2007-11-10 14:35:04 +00:00
|
|
|
CurrPage->m_IsCurrentFormat->SetValue( TRUE );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/***********************************************/
|
2007-09-13 11:55:46 +00:00
|
|
|
void WinEDA_NetlistFrame::NetlistUpdateOpt()
|
2007-06-05 12:10:51 +00:00
|
|
|
/***********************************************/
|
|
|
|
{
|
2007-11-10 14:35:04 +00:00
|
|
|
int ii;
|
2007-11-05 06:14:55 +00:00
|
|
|
|
|
|
|
g_SimulatorCommandLine =
|
|
|
|
m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue();
|
2009-04-29 17:09:00 +00:00
|
|
|
m_Parent->m_NetlistFormat = NET_TYPE_PCBNEW;
|
2007-11-05 06:14:55 +00:00
|
|
|
|
|
|
|
for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
|
|
|
|
{
|
|
|
|
if( m_PanelNetType[ii] == NULL )
|
|
|
|
break;
|
|
|
|
if( m_PanelNetType[ii]->m_IsCurrentFormat->GetValue() == TRUE )
|
2009-04-29 17:09:00 +00:00
|
|
|
m_Parent->m_NetlistFormat = m_PanelNetType[ii]->m_IdNetType;
|
2007-11-05 06:14:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_OptNetListUseNames = TRUE; // Used for pspice, gnucap
|
|
|
|
if( m_UseNetNamesInNetlist->GetSelection() == 1 )
|
|
|
|
g_OptNetListUseNames = FALSE;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/**********************************************************/
|
2007-11-10 14:35:04 +00:00
|
|
|
void WinEDA_NetlistFrame::GenNetlist( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
/**********************************************************/
|
2007-11-10 14:35:04 +00:00
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
|
|
|
* Function GenNetlist
|
2007-11-10 14:35:04 +00:00
|
|
|
* Create the netlist file:
|
2009-11-04 20:46:53 +00:00
|
|
|
* calculate the filename with the suitable extensions
|
2007-11-10 14:35:04 +00:00
|
|
|
* and run the netlist creator
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2010-08-11 14:47:16 +00:00
|
|
|
wxFileName fn;
|
|
|
|
wxString fileWildcard;
|
|
|
|
wxString fileExt;
|
|
|
|
wxString title = _( "Save Netlist File" );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
NetlistUpdateOpt();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
EDA_NoteBookPage* CurrPage;
|
2010-07-14 13:24:36 +00:00
|
|
|
CurrPage = (EDA_NoteBookPage*) m_NoteBook->GetCurrentPage();
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
/* Calculate the netlist filename */
|
2011-01-20 16:34:57 +00:00
|
|
|
fn = g_RootSheet->GetScreen()->GetFileName();
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2010-07-14 13:24:36 +00:00
|
|
|
switch( CurrPage->m_IdNetType )
|
2007-11-05 06:14:55 +00:00
|
|
|
{
|
|
|
|
case NET_TYPE_SPICE:
|
2010-08-11 14:47:16 +00:00
|
|
|
fileExt = wxT( "cir" );
|
|
|
|
fileWildcard = _( "SPICE netlist file (.cir)|*.cir" );
|
2007-11-05 06:14:55 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case NET_TYPE_CADSTAR:
|
2010-08-11 14:47:16 +00:00
|
|
|
fileExt = wxT( "frp" );
|
|
|
|
fileWildcard = _( "CadStar netlist file (.frp)|*.frp" );
|
2007-11-05 06:14:55 +00:00
|
|
|
break;
|
|
|
|
|
2010-08-11 05:58:34 +00:00
|
|
|
case NET_TYPE_PCBNEW:
|
2010-08-11 14:47:16 +00:00
|
|
|
case NET_TYPE_ORCADPCB2:
|
|
|
|
fileExt = NetlistFileExtension;
|
|
|
|
fileWildcard = NetlistFileWildcard;
|
2007-11-05 06:14:55 +00:00
|
|
|
break;
|
2010-08-11 05:58:34 +00:00
|
|
|
|
2010-08-11 14:47:16 +00:00
|
|
|
default: // custom, NET_TYPE_CUSTOM1 and greater
|
|
|
|
fileExt = wxEmptyString; // wxT( "" );
|
|
|
|
fileWildcard = AllFilesWildcard;
|
|
|
|
title.Printf( _( "%s Export" ), CurrPage->m_TitleStringCtrl->GetValue().GetData() );
|
2007-11-05 06:14:55 +00:00
|
|
|
}
|
|
|
|
|
2010-08-11 14:47:16 +00:00
|
|
|
fn.SetExt( fileExt );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2010-08-11 05:58:34 +00:00
|
|
|
wxFileDialog dlg( this, title, fn.GetPath(),
|
2010-08-11 14:47:16 +00:00
|
|
|
fn.GetFullName(), fileWildcard,
|
2010-07-14 13:24:36 +00:00
|
|
|
wxFD_SAVE );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
|
|
|
if( dlg.ShowModal() == wxID_CANCEL )
|
2007-11-05 06:14:55 +00:00
|
|
|
return;
|
|
|
|
|
2009-10-14 19:43:31 +00:00
|
|
|
m_Parent->ClearMsgPanel();
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2010-07-14 13:24:36 +00:00
|
|
|
if( CurrPage->m_CommandStringCtrl )
|
|
|
|
g_NetListerCommandLine = CurrPage->m_CommandStringCtrl->GetValue();
|
|
|
|
else
|
|
|
|
g_NetListerCommandLine.Empty();
|
|
|
|
|
|
|
|
m_Parent->CreateNetlist( CurrPage->m_IdNetType, dlg.GetPath(), g_OptNetListUseNames );
|
|
|
|
|
|
|
|
WriteCurrentNetlistSetup();
|
|
|
|
|
|
|
|
EndModal( NET_OK );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
|
|
|
* Function CreateNetlist
|
2010-07-14 13:24:36 +00:00
|
|
|
* Create a netlist file:
|
|
|
|
* build netlist info
|
|
|
|
* test issues
|
|
|
|
* create file
|
|
|
|
* @param aFormat = netlist format (NET_TYPE_PCBNEW ...)
|
|
|
|
* @param aFullFileName = full netlist file name
|
|
|
|
* @param aUse_netnames = bool. if true, use net names from labels in schematic
|
|
|
|
* if false, use net numbers (net codes)
|
|
|
|
* bool aUse_netnames is used only for Spice netlist
|
|
|
|
* @return true if success.
|
|
|
|
*/
|
2010-12-08 20:12:46 +00:00
|
|
|
bool SCH_EDIT_FRAME::CreateNetlist( int aFormat, const wxString& aFullFileName,
|
|
|
|
bool aUse_netnames )
|
2010-07-14 13:24:36 +00:00
|
|
|
{
|
2010-12-31 19:47:39 +00:00
|
|
|
SCH_SHEET_LIST sheets;
|
|
|
|
sheets.AnnotatePowerSymbols();
|
2010-07-14 13:24:36 +00:00
|
|
|
|
|
|
|
// Performs some controls:
|
|
|
|
if( CheckAnnotate( NULL, 0 ) )
|
2007-11-05 06:14:55 +00:00
|
|
|
{
|
2011-01-10 17:47:50 +00:00
|
|
|
if( !IsOK( NULL, _( "Some items are not annotated\n\
|
|
|
|
Do you want to annotate schematic?" ) ) )
|
|
|
|
return false;
|
|
|
|
// Schematic must be annotated: call Annotate dialog:
|
|
|
|
wxCommandEvent event;
|
|
|
|
OnAnnotate( event );
|
|
|
|
if( CheckAnnotate( NULL, 0 ) )
|
2010-07-14 13:24:36 +00:00
|
|
|
return false;
|
2007-11-05 06:14:55 +00:00
|
|
|
}
|
|
|
|
|
2010-06-28 13:11:14 +00:00
|
|
|
// Test duplicate sheet names:
|
2010-07-14 13:24:36 +00:00
|
|
|
if( TestDuplicateSheetNames( false ) > 0 )
|
2010-06-28 13:11:14 +00:00
|
|
|
{
|
2010-07-14 13:24:36 +00:00
|
|
|
if( !IsOK( NULL, _( "Error: duplicate sheet names. Continue?" ) ) )
|
|
|
|
return false;
|
2010-06-28 13:11:14 +00:00
|
|
|
}
|
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
/* Cleanup the entire hierarchy */
|
2010-12-31 19:47:39 +00:00
|
|
|
SCH_SCREENS screens;
|
|
|
|
screens.SchematicCleanUp();
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2010-07-14 13:24:36 +00:00
|
|
|
BuildNetListBase();
|
|
|
|
bool success = WriteNetListFile( aFormat, aFullFileName, g_OptNetListUseNames );
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2010-07-14 13:24:36 +00:00
|
|
|
return success;
|
2007-11-10 14:35:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WinEDA_NetlistFrame::OnCancelClick( wxCommandEvent& event )
|
|
|
|
{
|
|
|
|
EndModal( NET_ABORT );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WinEDA_NetlistFrame::RunSimulator( wxCommandEvent& event )
|
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
wxFileName fn;
|
2010-07-14 13:24:36 +00:00
|
|
|
wxString ExecFile, CommandLine;
|
2007-11-10 14:35:04 +00:00
|
|
|
|
2010-12-31 19:47:39 +00:00
|
|
|
g_SimulatorCommandLine = m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue();
|
2007-11-10 14:35:04 +00:00
|
|
|
g_SimulatorCommandLine.Trim( FALSE );
|
|
|
|
g_SimulatorCommandLine.Trim( TRUE );
|
|
|
|
ExecFile = g_SimulatorCommandLine.BeforeFirst( ' ' );
|
|
|
|
|
|
|
|
CommandLine = g_SimulatorCommandLine.AfterFirst( ' ' );
|
|
|
|
|
|
|
|
/* Calculate the netlist filename */
|
2011-01-20 16:34:57 +00:00
|
|
|
fn = g_RootSheet->GetScreen()->GetFileName();
|
2009-04-05 20:49:15 +00:00
|
|
|
fn.SetExt( wxT( "cir" ) );
|
|
|
|
CommandLine += wxT( " \"" ) + fn.GetFullPath() + wxT( "\"" );
|
2007-11-10 14:35:04 +00:00
|
|
|
|
2010-07-14 13:24:36 +00:00
|
|
|
g_OptNetListUseNames = m_UseNetNamesInNetlist->GetSelection() == 0;
|
|
|
|
EDA_NoteBookPage* CurrPage;
|
|
|
|
CurrPage = (EDA_NoteBookPage*) m_NoteBook->GetCurrentPage();
|
|
|
|
|
|
|
|
if( ! m_Parent->CreateNetlist( CurrPage->m_IdNetType, fn.GetFullPath(), g_OptNetListUseNames ) )
|
|
|
|
return;
|
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
ExecuteFile( this, ExecFile, CommandLine );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************/
|
|
|
|
void WinEDA_NetlistFrame::WriteCurrentNetlistSetup( void )
|
|
|
|
/*********************************************************/
|
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
|
|
|
* Function WriteCurrentNetlistSetup
|
2007-11-10 14:35:04 +00:00
|
|
|
* Write the current netlist options setup in the configuration
|
|
|
|
*/
|
|
|
|
{
|
2010-07-14 13:24:36 +00:00
|
|
|
wxString msg, Command;
|
2008-12-08 15:27:13 +00:00
|
|
|
wxConfig* config = wxGetApp().m_EDA_Config;
|
2007-11-10 14:35:04 +00:00
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
NetlistUpdateOpt();
|
2007-11-10 14:35:04 +00:00
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
// Update the new titles
|
|
|
|
for( int ii = 0; ii < CUSTOMPANEL_COUNTMAX; ii++ )
|
|
|
|
{
|
2007-11-10 14:35:04 +00:00
|
|
|
EDA_NoteBookPage* CurrPage = m_PanelNetType[ii + PANELCUSTOMBASE];
|
2007-11-05 06:14:55 +00:00
|
|
|
if( CurrPage == NULL )
|
|
|
|
break;
|
2007-11-10 14:35:04 +00:00
|
|
|
msg = wxT( "Custom" );
|
2007-11-05 06:14:55 +00:00
|
|
|
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;
|
2008-12-08 15:27:13 +00:00
|
|
|
config->Write( msg, title );
|
2007-11-05 06:14:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( CurrPage->m_CommandStringCtrl )
|
|
|
|
{
|
|
|
|
Command = CurrPage->m_CommandStringCtrl->GetValue();
|
2008-12-08 15:27:13 +00:00
|
|
|
msg = CUSTOM_NETLIST_COMMAND;
|
2007-11-05 06:14:55 +00:00
|
|
|
msg << ii + 1;
|
2008-12-08 15:27:13 +00:00
|
|
|
config->Write( msg, Command );
|
2007-11-05 06:14:55 +00:00
|
|
|
}
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-11-05 06:14:55 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
/******************************************************************/
|
|
|
|
void WinEDA_NetlistFrame::DeletePluginPanel( wxCommandEvent& event )
|
|
|
|
/******************************************************************/
|
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
|
|
|
* Function DeletePluginPanel
|
2007-11-10 14:35:04 +00:00
|
|
|
* Remove a panel relative to a netlist plugin
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2008-12-08 15:27:13 +00:00
|
|
|
EDA_NoteBookPage* CurrPage =
|
|
|
|
(EDA_NoteBookPage*) m_NoteBook->GetCurrentPage();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
CurrPage->m_CommandStringCtrl->SetValue( wxEmptyString );
|
|
|
|
CurrPage->m_TitleStringCtrl->SetValue( wxEmptyString );
|
|
|
|
if( CurrPage->m_IsCurrentFormat->IsChecked() )
|
|
|
|
{
|
|
|
|
CurrPage->m_IsCurrentFormat->SetValue( FALSE );
|
|
|
|
m_PanelNetType[PANELPCBNEW]->m_IsCurrentFormat->SetValue( TRUE );
|
|
|
|
}
|
|
|
|
WriteCurrentNetlistSetup();
|
|
|
|
EndModal( NET_PLUGIN_CHANGE );
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
/******************************************************************/
|
|
|
|
void WinEDA_NetlistFrame::ValidatePluginPanel( wxCommandEvent& event )
|
|
|
|
/******************************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2010-11-12 16:36:43 +00:00
|
|
|
/**
|
|
|
|
* Function ValidatePluginPanel
|
2007-11-10 14:35:04 +00:00
|
|
|
* Validate the panel info relative to a new netlist plugin
|
|
|
|
*/
|
|
|
|
{
|
2008-12-08 15:27:13 +00:00
|
|
|
EDA_NoteBookPage* CurrPage =
|
|
|
|
(EDA_NoteBookPage*) m_NoteBook->GetCurrentPage();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
if( CurrPage->m_CommandStringCtrl->GetValue() == wxEmptyString )
|
|
|
|
{
|
|
|
|
DisplayError( this, _( "Error. You must provide a command String" ) );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if( CurrPage->m_TitleStringCtrl->GetValue() == wxEmptyString )
|
|
|
|
{
|
|
|
|
DisplayError( this, _( "Error. You must provide a Title" ) );
|
|
|
|
return;
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-11-10 14:35:04 +00:00
|
|
|
WriteCurrentNetlistSetup();
|
|
|
|
EndModal( NET_PLUGIN_CHANGE );
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|