From fb3aa446e1800d26f8cbc793bf6a9542346f312c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 4 Aug 2019 15:43:23 -0600 Subject: [PATCH] Remove Run Simulator command from Export Spice Netlist. Also cleans up the Export Netlist dialog to be more platform compliant. Fixes: lp:1591777 * https://bugs.launchpad.net/kicad/+bug/1591777 --- eeschema/dialogs/dialog_netlist.cpp | 344 +++---- eeschema/dialogs/dialog_netlist_base.cpp | 136 ++- eeschema/dialogs/dialog_netlist_base.fbp | 1101 +++++++++++----------- eeschema/dialogs/dialog_netlist_base.h | 66 +- eeschema/eeschema_config.cpp | 7 - eeschema/sch_edit_frame.cpp | 2 +- eeschema/sch_edit_frame.h | 8 +- 7 files changed, 775 insertions(+), 889 deletions(-) diff --git a/eeschema/dialogs/dialog_netlist.cpp b/eeschema/dialogs/dialog_netlist.cpp index a04d8a1182..c69e060d7c 100644 --- a/eeschema/dialogs/dialog_netlist.cpp +++ b/eeschema/dialogs/dialog_netlist.cpp @@ -23,19 +23,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file eeschema/dialogs/dialog_netlist.cpp - * @brief Dialog box for creating netlists. - */ - -/* Functions relative to the dialog creating the netlist for Pcbnew. - * The dialog is a notebook with 4 fixed netlist format: - * 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. - * these external converters are referred there as plugins, - * but there are not really plugins, there are only external binaries +/* Functions relative to the dialog creating the netlist for Pcbnew. The dialog is a notebook + * with 4 fixed netlist formats: + * Pcbnew + * ORCADPCB2 + * CADSTAR + * SPICE + * and up to CUSTOMPANEL_COUNTMAX user programmable formats. These external converters are + * referred to as plugins, but they are really just external binaries. */ #include @@ -43,14 +38,10 @@ #include #include #include - #include #include -#include -#include #include #include -#include #include #include @@ -79,10 +70,9 @@ public: NETLIST_TYPE_ID m_IdNetType; wxCheckBox* m_IsCurrentFormat; // opt to reformat passive component values (e.g. 1M -> 1Meg): - wxCheckBox* m_SpiceAjustPassiveValues; + wxCheckBox* m_AdjustPassiveValues; wxTextCtrl* m_CommandStringCtrl; wxTextCtrl* m_TitleStringCtrl; - wxButton* m_ButtonCancel; wxBoxSizer* m_LeftBoxSizer; wxBoxSizer* m_RightBoxSizer; wxBoxSizer* m_RightOptionsBoxSizer; @@ -107,10 +97,7 @@ public: * @return the name of the netlist format for this page * This is also the page label. */ - const wxString GetPageNetFmtName() - { - return m_pageNetFmtName; - } + const wxString GetPageNetFmtName() { return m_pageNetFmtName; } }; @@ -120,51 +107,45 @@ class NETLIST_DIALOG : public NETLIST_DIALOG_BASE friend class NETLIST_PAGE_DIALOG; public: - SCH_EDIT_FRAME* m_Parent; - wxString m_DefaultNetFmtName; + SCH_EDIT_FRAME* m_Parent; + wxString m_DefaultNetFmtName; NETLIST_PAGE_DIALOG* m_PanelNetType[4 + CUSTOMPANEL_COUNTMAX]; protected: - bool m_asFormatSelected; - -private: - wxConfigBase* m_config; + bool m_asFormatSelected; + wxConfigBase* m_config; public: - // Constructor and destructor NETLIST_DIALOG( SCH_EDIT_FRAME* parent ); ~NETLIST_DIALOG() { }; private: - void InstallCustomPages(); + void InstallCustomPages(); NETLIST_PAGE_DIALOG* AddOneCustomPage( const wxString & aTitle, const wxString & aCommandString, NETLIST_TYPE_ID aNetTypeId ); - void InstallPageSpice(); - void GenNetlist( wxCommandEvent& event ) override; - void RunSimulator( wxCommandEvent& event ); - void NetlistUpdateOpt(); + void InstallPageSpice(); + bool TransferDataFromWindow() override; + void NetlistUpdateOpt(); - // Called when changing the notebook page, therefore the current - // netlist format - void OnNetlistTypeSelection( wxNotebookEvent& event ) override; + // Called when changing the notebook page (and therefore the current netlist format) + void OnNetlistTypeSelection( wxNotebookEvent& event ) override; - // called when checking the "Default format" wxCheckBox - // in the current page of the notbook - void SelectDefaultNetlistType( wxCommandEvent& event ); + // called when checking the "Default format" wxCheckBox in the current page of the notbook + void SelectDefaultNetlistType( wxCommandEvent& event ); /** * Function OnAddGenerator * Add a new panel for a new netlist plugin */ - void OnAddGenerator( wxCommandEvent& event ) override; + void OnAddGenerator( wxCommandEvent& event ) override; /** * Function OnDelGenerator * Remove a panel relative to a netlist plugin */ - void OnDelGenerator( wxCommandEvent& event ) override; + void OnDelGenerator( wxCommandEvent& event ) override; /** * Function WriteCurrentNetlistSetup @@ -186,12 +167,12 @@ private: * Function FilenamePrms * returns the filename extension and the wildcard string for this curr * or a void name if there is no default name - * @param aNetTypeId = the netlist type ( NET_TYPE_PCBNEW ... ) + * @param aType = the netlist type ( NET_TYPE_PCBNEW ... ) * @param aExt = a reference to a wxString to return the default file ext. * @param aWildCard = reference to a wxString to return the default wildcard. * @return true for known netlist type, false for custom formats */ - bool FilenamePrms( NETLIST_TYPE_ID aNetTypeId, + bool FilenamePrms( NETLIST_TYPE_ID aType, wxString * aExt, wxString * aWildCard ); DECLARE_EVENT_TABLE() @@ -205,17 +186,11 @@ private: public: NETLIST_DIALOG_ADD_GENERATOR( NETLIST_DIALOG* parent ); - const wxString GetGeneratorTitle() - { - return m_textCtrlName->GetValue(); - } - const wxString GetGeneratorTCommandLine() - { - return m_textCtrlCommand->GetValue(); - } + + const wxString GetGeneratorTitle() { return m_textCtrlName->GetValue(); } + const wxString GetGeneratorTCommandLine() { return m_textCtrlCommand->GetValue(); } private: - /** * Function OnOKClick * Validate info relative to a new netlist plugin @@ -233,7 +208,6 @@ private: enum id_netlist { ID_CREATE_NETLIST = ID_END_EESCHEMA_ID_LIST + 1, ID_CURRENT_FORMAT_IS_DEFAULT, - ID_RUN_SIMULATOR, ID_ADD_SUBCIRCUIT_PREFIX, ID_USE_NETCODE_AS_NETNAME }; @@ -247,10 +221,7 @@ enum id_netlist { BEGIN_EVENT_TABLE( NETLIST_DIALOG, NETLIST_DIALOG_BASE ) - EVT_BUTTON( ID_CREATE_NETLIST, NETLIST_DIALOG::GenNetlist ) - EVT_CHECKBOX( ID_CURRENT_FORMAT_IS_DEFAULT, - NETLIST_DIALOG::SelectDefaultNetlistType ) - EVT_BUTTON( ID_RUN_SIMULATOR, NETLIST_DIALOG::RunSimulator ) + EVT_CHECKBOX( ID_CURRENT_FORMAT_IS_DEFAULT, NETLIST_DIALOG::SelectDefaultNetlistType ) END_EVENT_TABLE() @@ -260,13 +231,12 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, NETLIST_TYPE_ID id_NetType ) : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ) { - m_IdNetType = id_NetType; - m_pageNetFmtName = title; - m_CommandStringCtrl = NULL; - m_TitleStringCtrl = NULL; - m_IsCurrentFormat = NULL; - m_SpiceAjustPassiveValues = NULL; - m_ButtonCancel = NULL; + m_IdNetType = id_NetType; + m_pageNetFmtName = title; + m_CommandStringCtrl = NULL; + m_TitleStringCtrl = NULL; + m_IsCurrentFormat = NULL; + m_AdjustPassiveValues = NULL; wxString netfmtName = ((NETLIST_DIALOG*)parent->GetParent())->m_DefaultNetFmtName; @@ -311,33 +281,22 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : m_config->Read( NETLIST_USE_DEFAULT_NETNAME, &tmp, 0l ); m_DefaultNetFmtName = m_Parent->GetNetListFormatName(); - for( int ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ ) - { - m_PanelNetType[ii] = NULL; - } + for( NETLIST_PAGE_DIALOG*& page : m_PanelNetType) + page = NULL; // Add notebook pages: m_asFormatSelected = false; // Will be set to true, if a format is selected - // Add Panel FORMAT PCBNEW - m_PanelNetType[PANELPCBNEW] = - new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "Pcbnew" ), - NET_TYPE_PCBNEW ); + m_PanelNetType[PANELPCBNEW] = new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "Pcbnew" ), + NET_TYPE_PCBNEW ); - // Add Panel FORMAT ORCADPCB2 - m_PanelNetType[PANELORCADPCB2] = - new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "OrcadPCB2" ), - NET_TYPE_ORCADPCB2 ); + m_PanelNetType[PANELORCADPCB2] = new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "OrcadPCB2" ), + NET_TYPE_ORCADPCB2 ); - // Add Panel FORMAT CADSTAR - m_PanelNetType[PANELCADSTAR] = - new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "CadStar" ), - NET_TYPE_CADSTAR ); + m_PanelNetType[PANELCADSTAR] = new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "CadStar" ), + NET_TYPE_CADSTAR ); - // Add Panel spice InstallPageSpice(); - - // Add custom panels: InstallCustomPages(); // Ensure a netlist format is selected: @@ -352,7 +311,12 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : OnNetlistTypeSelection( event ); } - SetDefaultItem( m_buttonNetlist ); + // We use a sdbSizer here to get the order right, which is platform-dependent + m_sdbSizer2OK->SetLabel( _( "Export Netlist" ) ); + m_sdbSizer2Cancel->SetLabel( _( "Close" ) ); + m_buttonSizer->Layout(); + + m_sdbSizer2OK->SetDefault(); // Now all widgets have the size fixed, call FinishDialogSettings FinishDialogSettings(); @@ -362,61 +326,36 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) : const wxString NETLIST_DIALOG::UserNetlistTypeName( bool first_item ) { static int index; - wxString name, msg; if( first_item ) index = 0; else index++; - msg = CUSTOM_NETLIST_TITLE; + wxString msg = CUSTOM_NETLIST_TITLE; msg << index + 1; - name = m_config->Read( msg ); - - return name; + return m_config->Read( msg ); } void NETLIST_DIALOG::InstallPageSpice() { - wxButton* Button; - NETLIST_PAGE_DIALOG* page; - wxString title = wxT( "Spice" ); + NETLIST_PAGE_DIALOG* page = m_PanelNetType[PANELSPICE] = + new NETLIST_PAGE_DIALOG( m_NoteBook, wxT( "Spice" ), NET_TYPE_SPICE ); - page = m_PanelNetType[PANELSPICE] = - new NETLIST_PAGE_DIALOG( m_NoteBook, title, NET_TYPE_SPICE ); - - page->m_SpiceAjustPassiveValues = new wxCheckBox( page, ID_USE_NETCODE_AS_NETNAME, - _( "Reformat passive symbol values" ) ); - page->m_SpiceAjustPassiveValues->SetToolTip( - _( "Reformat passive symbol values e.g. 1M -> 1Meg" ) ); - page->m_SpiceAjustPassiveValues->SetValue( m_Parent->GetSpiceAjustPassiveValues() ); - page->m_LeftBoxSizer->Add( page->m_SpiceAjustPassiveValues, 0, - wxGROW | wxBOTTOM | wxRIGHT, 5 ); - - page->m_LowBoxSizer->Add( new wxStaticText( page, -1, _( "Simulator command:" ) ), 0, - wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); - - page->m_CommandStringCtrl = new wxTextCtrl( page, -1, m_Parent->GetSimulatorCommand(), - wxDefaultPosition, wxDefaultSize ); - - page->m_CommandStringCtrl->SetInsertionPoint( 1 ); - page->m_LowBoxSizer->Add( page->m_CommandStringCtrl, - 0, - wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, - 5 ); - - // Add buttons - Button = new wxButton( page, ID_RUN_SIMULATOR, _( "&Run Simulator" ) ); - page->m_LowBoxSizer->Add( Button, 0, wxGROW | wxBOTTOM | wxLEFT | wxRIGHT, 5 ); + page->m_AdjustPassiveValues = new wxCheckBox( page, ID_USE_NETCODE_AS_NETNAME, + _( "Reformat passive symbol values" ) ); + page->m_AdjustPassiveValues->SetToolTip( _( "Reformat passive symbol values e.g. 1M -> 1Meg" ) ); + page->m_AdjustPassiveValues->SetValue( m_Parent->GetSpiceAjustPassiveValues() ); + page->m_LeftBoxSizer->Add( page->m_AdjustPassiveValues, 0, wxGROW | wxBOTTOM | wxRIGHT, 5 ); } void NETLIST_DIALOG::InstallCustomPages() { - int ii; - wxString title, msg; + int ii; + wxString title; NETLIST_PAGE_DIALOG* currPage; for( ii = 0; ii < CUSTOMPANEL_COUNTMAX; ii++ ) @@ -427,12 +366,11 @@ void NETLIST_DIALOG::InstallCustomPages() break; // No more panel to install // Install a plugin panel - msg = CUSTOM_NETLIST_COMMAND; + wxString msg = CUSTOM_NETLIST_COMMAND; msg << ii + 1; wxString command = m_config->Read( msg ); - currPage = AddOneCustomPage( title, command, - (NETLIST_TYPE_ID)(NET_TYPE_CUSTOM1 + ii) ); + currPage = AddOneCustomPage( title, command, (NETLIST_TYPE_ID)(NET_TYPE_CUSTOM1 + ii) ); m_PanelNetType[PANELCUSTOMBASE + ii] = currPage; } } @@ -442,50 +380,41 @@ NETLIST_PAGE_DIALOG* NETLIST_DIALOG::AddOneCustomPage( const wxString & aTitle, const wxString & aCommandString, NETLIST_TYPE_ID aNetTypeId ) { - NETLIST_PAGE_DIALOG* currPage; + NETLIST_PAGE_DIALOG* currPage = new NETLIST_PAGE_DIALOG( m_NoteBook, aTitle, aNetTypeId ); - currPage = new NETLIST_PAGE_DIALOG( m_NoteBook, aTitle, aNetTypeId ); - - - currPage->m_LowBoxSizer->Add( new wxStaticText( currPage, - -1, _( "Netlist command:" ) ), 0, - wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); - - currPage->m_CommandStringCtrl = new wxTextCtrl( currPage, -1, aCommandString, - wxDefaultPosition, wxDefaultSize ); - - currPage->m_CommandStringCtrl->SetInsertionPoint( 1 ); - currPage->m_LowBoxSizer->Add( currPage->m_CommandStringCtrl, - 0, - wxGROW | wxTOP | wxLEFT | wxRIGHT | wxBOTTOM, - 5 ); - - currPage->m_LowBoxSizer->Add( new wxStaticText( currPage, - -1, _( "Title:" ) ), 0, + currPage->m_LowBoxSizer->Add( new wxStaticText( currPage, -1, _( "Title:" ) ), 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); currPage->m_TitleStringCtrl = new wxTextCtrl( currPage, -1, aTitle, wxDefaultPosition, wxDefaultSize ); currPage->m_TitleStringCtrl->SetInsertionPoint( 1 ); - currPage->m_LowBoxSizer->Add( currPage->m_TitleStringCtrl, - 0, - wxGROW | wxTOP | wxLEFT | wxRIGHT | wxBOTTOM, - 5 ); + currPage->m_LowBoxSizer->Add( currPage->m_TitleStringCtrl, 0, + wxGROW | wxTOP | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); + + currPage->m_LowBoxSizer->Add( new wxStaticText( currPage, -1, _( "Netlist command:" ) ), 0, + wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); + + currPage->m_CommandStringCtrl = new wxTextCtrl( currPage, -1, aCommandString, + wxDefaultPosition, wxDefaultSize ); + + currPage->m_CommandStringCtrl->SetInsertionPoint( 1 ); + currPage->m_LowBoxSizer->Add( currPage->m_CommandStringCtrl, 0, + wxGROW | wxTOP | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); + return currPage; } void NETLIST_DIALOG::SelectDefaultNetlistType( wxCommandEvent& event ) { - int ii; - NETLIST_PAGE_DIALOG* currPage; + for( NETLIST_PAGE_DIALOG*& page : m_PanelNetType) + { + if( page ) + page->m_IsCurrentFormat->SetValue( false ); + } - for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ ) - if( m_PanelNetType[ii] ) - m_PanelNetType[ii]->m_IsCurrentFormat->SetValue( false ); - - currPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); + NETLIST_PAGE_DIALOG* currPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); if( currPage == NULL ) return; @@ -509,24 +438,23 @@ void NETLIST_DIALOG::OnNetlistTypeSelection( wxNotebookEvent& event ) void NETLIST_DIALOG::NetlistUpdateOpt() { - int ii; + bool adjust = m_PanelNetType[ PANELSPICE ]->m_AdjustPassiveValues->IsChecked(); - m_Parent->SetSpiceAjustPassiveValues( m_PanelNetType[PANELSPICE]->m_SpiceAjustPassiveValues->IsChecked() ); - m_Parent->SetSimulatorCommand( m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue() ); + m_Parent->SetSpiceAdjustPassiveValues( adjust ); m_Parent->SetNetListFormatName( wxEmptyString ); - for( ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ ) + for( NETLIST_PAGE_DIALOG*& page : m_PanelNetType) { - if( m_PanelNetType[ii] == NULL ) + if( page == NULL ) break; - if( m_PanelNetType[ii]->m_IsCurrentFormat->GetValue() == true ) - m_Parent->SetNetListFormatName( m_PanelNetType[ii]->GetPageNetFmtName() ); + if( page->m_IsCurrentFormat->GetValue() == true ) + m_Parent->SetNetListFormatName( page->GetPageNetFmtName() ); } } -void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event ) +bool NETLIST_DIALOG::TransferDataFromWindow() { wxFileName fn; wxString fileWildcard; @@ -549,7 +477,7 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event ) { case NET_TYPE_SPICE: // Set spice netlist options: - if( currPage->m_SpiceAjustPassiveValues->GetValue() ) + if( currPage->m_AdjustPassiveValues->GetValue() ) netlist_opt |= NET_ADJUST_PASSIVE_VALS; break; @@ -588,7 +516,7 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event ) wxFileDialog dlg( this, title, path, fullname, fileWildcard, wxFD_SAVE ); if( dlg.ShowModal() == wxID_CANCEL ) - return; + return false; fullpath = dlg.GetPath(); // directory + filename @@ -604,24 +532,21 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event ) if( netlist == nullptr ) wxMessageBox( _( "Schematic netlist not available" ) ); else - m_Parent->WriteNetListFile( netlist, currPage->m_IdNetType, - fullpath, netlist_opt, NULL ); + m_Parent->WriteNetListFile( netlist, currPage->m_IdNetType, fullpath, netlist_opt, NULL ); WriteCurrentNetlistSetup(); - EndModal( wxID_OK ); + return true; } -bool NETLIST_DIALOG::FilenamePrms( NETLIST_TYPE_ID aNetTypeId, - wxString * aExt, wxString * aWildCard ) +bool NETLIST_DIALOG::FilenamePrms( NETLIST_TYPE_ID aType, wxString * aExt, wxString * aWildCard ) { wxString fileExt; wxString fileWildcard; + bool ret = true; - bool ret = true; - - switch( aNetTypeId ) + switch( aType ) { case NET_TYPE_SPICE: fileExt = wxT( "cir" ); @@ -654,47 +579,9 @@ bool NETLIST_DIALOG::FilenamePrms( NETLIST_TYPE_ID aNetTypeId, } -void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event ) -{ - wxFileName fn; - wxString ExecFile, CommandLine; - - NetlistUpdateOpt(); - - wxString tmp = m_PanelNetType[PANELSPICE]->m_CommandStringCtrl->GetValue(); - tmp.Trim( false ); - tmp.Trim( true ); - m_Parent->SetSimulatorCommand( tmp ); - ExecFile = tmp.BeforeFirst( ' ' ); - CommandLine = tmp.AfterFirst( ' ' ); - - // Calculate the netlist filename - fn = g_RootSheet->GetScreen()->GetFileName(); - fn.SetExt( wxT( "cir" ) ); - CommandLine += wxT( " \"" ) + fn.GetFullPath() + wxT( "\"" ); - - NETLIST_PAGE_DIALOG* currPage; - currPage = (NETLIST_PAGE_DIALOG*) m_NoteBook->GetCurrentPage(); - - // Set spice netlist options: - unsigned netlist_opt = 0; - - if( currPage->m_SpiceAjustPassiveValues && currPage->m_SpiceAjustPassiveValues->GetValue() ) - netlist_opt |= NET_ADJUST_PASSIVE_VALS; - - auto netlist = m_Parent->CreateNetlist( false, false ); - - if( ! m_Parent->WriteNetListFile( netlist, currPage->m_IdNetType, - fn.GetFullPath(), netlist_opt, NULL ) ) - return; - - ExecuteFile( this, ExecFile, CommandLine ); -} - - void NETLIST_DIALOG::WriteCurrentNetlistSetup() { - wxString msg, Command; + wxString msg; NetlistUpdateOpt(); @@ -716,21 +603,21 @@ void NETLIST_DIALOG::WriteCurrentNetlistSetup() msg << jj + 1; m_config->Write( msg, title ); - Command = currPage->m_CommandStringCtrl->GetValue(); - msg = CUSTOM_NETLIST_COMMAND; + wxString Command = currPage->m_CommandStringCtrl->GetValue(); + msg = CUSTOM_NETLIST_COMMAND; msg << jj + 1; m_config->Write( msg, Command ); jj++; } // Ensure all other pages are void - for(; jj < CUSTOMPANEL_COUNTMAX; jj++ ) + for( ; jj < CUSTOMPANEL_COUNTMAX; jj++ ) { msg = CUSTOM_NETLIST_TITLE; msg << jj + 1; m_config->Write( msg, wxEmptyString ); - msg = CUSTOM_NETLIST_COMMAND; + msg = CUSTOM_NETLIST_COMMAND; msg << jj + 1; m_config->Write( msg, wxEmptyString ); } @@ -758,6 +645,7 @@ void NETLIST_DIALOG::OnDelGenerator( wxCommandEvent& event ) void NETLIST_DIALOG::OnAddGenerator( wxCommandEvent& event ) { NETLIST_DIALOG_ADD_GENERATOR dlg( this ); + if( dlg.ShowModal() != wxID_OK ) return; @@ -767,6 +655,7 @@ void NETLIST_DIALOG::OnAddGenerator( wxCommandEvent& event ) // Verify it does not exists int netTypeId = PANELCUSTOMBASE; // the first not used type id NETLIST_PAGE_DIALOG* currPage; + for( int ii = 0; ii < CUSTOMPANEL_COUNTMAX; ii++ ) { netTypeId = PANELCUSTOMBASE + ii; @@ -777,7 +666,7 @@ void NETLIST_DIALOG::OnAddGenerator( wxCommandEvent& event ) if( currPage->GetPageNetFmtName() == title ) { - wxMessageBox( _("This plugin already exists. Abort") ); + wxMessageBox( _("This plugin already exists.") ); return; } } @@ -796,6 +685,7 @@ NETLIST_DIALOG_ADD_GENERATOR::NETLIST_DIALOG_ADD_GENERATOR( NETLIST_DIALOG* pare NETLIST_DIALOG_ADD_GENERATOR_BASE( parent ) { m_Parent = parent; + m_sdbSizerOK->SetDefault(); GetSizer()->SetSizeHints( this ); } @@ -827,21 +717,14 @@ void NETLIST_DIALOG_ADD_GENERATOR::OnBrowseGenerators( wxCommandEvent& event ) #else Path = GetOSXKicadDataDir() + wxT( "/plugins" ); #endif - FullFileName = EDA_FILE_SELECTOR( _( "Generator files:" ), - Path, - FullFileName, - wxEmptyString, - wxFileSelectorDefaultWildcardStr, - this, - wxFD_OPEN, - true - ); + FullFileName = EDA_FILE_SELECTOR( _( "Generator files:" ), Path, FullFileName, + wxEmptyString, wxFileSelectorDefaultWildcardStr, + this, wxFD_OPEN, true ); if( FullFileName.IsEmpty() ) return; - // Creates a default command line, suitable for external tool xslproc or python - // try to build a default command line depending on plugin extension - // "xsl" or "exe" or "py" + // Creates a default command line, suitable for external tool xslproc or python, based on + // the plugin extension ("xsl" or "exe" or "py") wxString cmdLine; wxFileName fn( FullFileName ); wxString ext = fn.GetExt(); @@ -873,8 +756,7 @@ int InvokeDialogNetList( SCH_EDIT_FRAME* aCaller ) int ret = dlg.ShowModal(); - // Ensure the default netlist is up to date, and store it in prj config - // if its was explicitely changed. + // Update the default netlist and store it in prj config if it was explicitely changed. aCaller->SetNetListFormatName( dlg.m_DefaultNetFmtName ); // can have temporary changed if( curr_default_netformat != dlg.m_DefaultNetFmtName ) diff --git a/eeschema/dialogs/dialog_netlist_base.cpp b/eeschema/dialogs/dialog_netlist_base.cpp index 643ad3fc3f..3494a373b1 100644 --- a/eeschema/dialogs/dialog_netlist_base.cpp +++ b/eeschema/dialogs/dialog_netlist_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 1 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -11,8 +11,6 @@ BEGIN_EVENT_TABLE( NETLIST_DIALOG_BASE, DIALOG_SHIM ) EVT_NOTEBOOK_PAGE_CHANGED( ID_CHANGE_NOTEBOOK_PAGE, NETLIST_DIALOG_BASE::_wxFB_OnNetlistTypeSelection ) - EVT_BUTTON( ID_CREATE_NETLIST, NETLIST_DIALOG_BASE::_wxFB_GenNetlist ) - EVT_BUTTON( wxID_CANCEL, NETLIST_DIALOG_BASE::_wxFB_OnCancelClick ) EVT_BUTTON( ID_ADD_PLUGIN, NETLIST_DIALOG_BASE::_wxFB_OnAddGenerator ) EVT_BUTTON( ID_DEL_PLUGIN, NETLIST_DIALOG_BASE::_wxFB_OnDelGenerator ) END_EVENT_TABLE() @@ -20,55 +18,47 @@ END_EVENT_TABLE() NETLIST_DIALOG_BASE::NETLIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - + wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bUpperSizer; - bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bRightSizer; - bRightSizer = new wxBoxSizer( wxVERTICAL ); - + bUpperSizer = new wxBoxSizer( wxVERTICAL ); + m_NoteBook = new wxNotebook( this, ID_CHANGE_NOTEBOOK_PAGE, wxDefaultPosition, wxDefaultSize, 0 ); - - bRightSizer->Add( m_NoteBook, 1, wxEXPAND | wxALL, 5 ); - - - bUpperSizer->Add( bRightSizer, 5, wxEXPAND, 5 ); - - wxBoxSizer* bLeftSizer; - bLeftSizer = new wxBoxSizer( wxVERTICAL ); - - - bLeftSizer->Add( 0, 0, 0, wxTOP, 15 ); - - m_buttonNetlist = new wxButton( this, ID_CREATE_NETLIST, _("Generate Netlist"), wxDefaultPosition, wxDefaultSize, 0 ); - bLeftSizer->Add( m_buttonNetlist, 0, wxALL|wxEXPAND, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - bLeftSizer->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 ); - - m_buttonAddGenerator = new wxButton( this, ID_ADD_PLUGIN, _("Add Generator..."), wxDefaultPosition, wxDefaultSize, 0 ); - bLeftSizer->Add( m_buttonAddGenerator, 0, wxALL|wxEXPAND, 5 ); - - m_buttonDelGenerator = new wxButton( this, ID_DEL_PLUGIN, _("Remove Generator..."), wxDefaultPosition, wxDefaultSize, 0 ); - bLeftSizer->Add( m_buttonDelGenerator, 0, wxALL|wxEXPAND, 5 ); - - - bLeftSizer->Add( 0, 0, 1, wxBOTTOM, 10 ); - - - bUpperSizer->Add( bLeftSizer, 2, wxEXPAND, 5 ); - - + m_NoteBook->SetMinSize( wxSize( 540,-1 ) ); + + + bUpperSizer->Add( m_NoteBook, 1, wxEXPAND | wxALL, 5 ); + + bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 ); - - + + m_buttonSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonAddGenerator = new wxButton( this, ID_ADD_PLUGIN, _("Add Generator..."), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSizer->Add( m_buttonAddGenerator, 0, wxALL|wxEXPAND, 5 ); + + m_buttonDelGenerator = new wxButton( this, ID_DEL_PLUGIN, _("Remove Generator"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSizer->Add( m_buttonDelGenerator, 0, wxALL|wxEXPAND, 5 ); + + m_sdbSizer2 = new wxStdDialogButtonSizer(); + m_sdbSizer2OK = new wxButton( this, wxID_OK ); + m_sdbSizer2->AddButton( m_sdbSizer2OK ); + m_sdbSizer2Cancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer2->AddButton( m_sdbSizer2Cancel ); + m_sdbSizer2->Realize(); + + m_buttonSizer->Add( m_sdbSizer2, 1, wxEXPAND, 5 ); + + + bMainSizer->Add( m_buttonSizer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + this->SetSizer( bMainSizer ); this->Layout(); bMainSizer->Fit( this ); - + this->Centre( wxBOTH ); } @@ -85,57 +75,55 @@ END_EVENT_TABLE() NETLIST_DIALOG_ADD_GENERATOR_BASE::NETLIST_DIALOG_ADD_GENERATOR_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - + wxBoxSizer* bSizerMain; bSizerMain = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bSizerTop; bSizerTop = new wxBoxSizer( wxVERTICAL ); - - m_staticTextCmd = new wxStaticText( this, wxID_ANY, _("Command line to run the generator:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextCmd->Wrap( -1 ); - bSizerTop->Add( m_staticTextCmd, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_textCtrlCommand = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_textCtrlCommand->SetMinSize( wxSize( 300,-1 ) ); - - bSizerTop->Add( m_textCtrlCommand, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - + m_staticTextName = new wxStaticText( this, wxID_ANY, _("Name:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextName->Wrap( -1 ); bSizerTop->Add( m_staticTextName, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - + m_textCtrlName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); bSizerTop->Add( m_textCtrlName, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerTop->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); - - - bSizerMain->Add( bSizerTop, 1, wxEXPAND, 5 ); - + + m_staticTextCmd = new wxStaticText( this, wxID_ANY, _("Command line to run the generator:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCmd->Wrap( -1 ); + bSizerTop->Add( m_staticTextCmd, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_textCtrlCommand = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_textCtrlCommand->SetMinSize( wxSize( 500,-1 ) ); + + bSizerTop->Add( m_textCtrlCommand, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizerMain->Add( bSizerTop, 1, wxEXPAND|wxALL, 5 ); + wxBoxSizer* bSizerBottom; bSizerBottom = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonGenerator = new wxButton( this, wxID_BROWSE_PLUGINS, _("Browse Generators"), wxDefaultPosition, wxDefaultSize, 0 ); + + m_buttonGenerator = new wxButton( this, wxID_BROWSE_PLUGINS, _("Browse Generators..."), wxDefaultPosition, wxDefaultSize, 0 ); bSizerBottom->Add( m_buttonGenerator, 0, wxALL|wxEXPAND, 5 ); - + m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); m_sdbSizer->AddButton( m_sdbSizerOK ); m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); - + bSizerBottom->Add( m_sdbSizer, 1, wxEXPAND, 5 ); - - - bSizerMain->Add( bSizerBottom, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - + + + bSizerMain->Add( bSizerBottom, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + this->SetSizer( bSizerMain ); this->Layout(); - + bSizerMain->Fit( this ); + this->Centre( wxBOTH ); } diff --git a/eeschema/dialogs/dialog_netlist_base.fbp b/eeschema/dialogs/dialog_netlist_base.fbp index 701e3e52bd..2b828c8a95 100644 --- a/eeschema/dialogs/dialog_netlist_base.fbp +++ b/eeschema/dialogs/dialog_netlist_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,7 +14,6 @@ dialog_netlist_base 1000 none - 1 dialog_netlist_base @@ -48,11 +47,47 @@ -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h - Netlist + Export Netlist + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer @@ -65,400 +100,303 @@ bUpperSizer - wxHORIZONTAL + wxVERTICAL none - + 5 - wxEXPAND - 5 - + wxEXPAND | wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_CHANGE_NOTEBOOK_PAGE + + 0 + + + 0 + 540,-1 + 1 + m_NoteBook + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + + + + + + + + + + + + + + + + + OnNetlistTypeSelection + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT + 0 + + + m_buttonSizer + wxHORIZONTAL + protected + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_ADD_PLUGIN + Add Generator... + + 0 + + + 0 - bRightSizer - wxVERTICAL - none - - 5 - wxEXPAND | wxALL - 1 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_CHANGE_NOTEBOOK_PAGE - - 0 - - - 0 - - 1 - m_NoteBook - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - OnNetlistTypeSelection - - + 1 + m_buttonAddGenerator + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnAddGenerator + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_DEL_PLUGIN + Remove Generator + + 0 + + + 0 + + 1 + m_buttonDelGenerator + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnDelGenerator + + + + + + + + + + + + + + + + + + + + + + + 5 wxEXPAND - 2 - + 1 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 - bLeftSizer - wxVERTICAL - none - - 15 - wxTOP - 0 - - 0 - protected - 0 - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - ID_CREATE_NETLIST - Generate Netlist - - 0 - - 0 - - - 0 - - 1 - m_buttonNetlist - 1 - - - protected - 1 - - - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - GenNetlist - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_CANCEL - Close - - 0 - - 0 - - - 0 - - 1 - m_buttonCancel - 1 - - - protected - 1 - - - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnCancelClick - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - ID_ADD_PLUGIN - Add Generator... - - 0 - - 0 - - - 0 - - 1 - m_buttonAddGenerator - 1 - - - protected - 1 - - - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnAddGenerator - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - ID_DEL_PLUGIN - Remove Generator... - - 0 - - 0 - - - 0 - - 1 - m_buttonDelGenerator - 1 - - - protected - 1 - - - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnDelGenerator - - - - 10 - wxBOTTOM - 1 - - 0 - protected - 0 - - + m_sdbSizer2 + protected + + + + + + + + @@ -483,7 +421,7 @@ NETLIST_DIALOG_ADD_GENERATOR_BASE - 359,170 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Script Generator Properties @@ -491,6 +429,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerMain @@ -498,138 +472,13 @@ none 5 - wxEXPAND + wxEXPAND|wxALL 1 bSizerTop wxVERTICAL none - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Command line to run the generator: - 0 - - 0 - - - 0 - - 1 - m_staticTextCmd - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - 300,-1 - 1 - m_textCtrlCommand - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - 5 wxTOP|wxRIGHT|wxLEFT @@ -663,7 +512,6 @@ 0 wxID_ANY Name: - 0 0 @@ -689,6 +537,29 @@ -1 + + + + + + + + + + + + + + + + + + + + + + + @@ -753,13 +624,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + - + 5 - wxEXPAND | wxALL + wxTOP|wxRIGHT|wxLEFT 0 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Command line to run the generator: + + 0 + + + 0 + + 1 + m_staticTextCmd + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + 1 1 1 @@ -790,11 +771,12 @@ 0 + 0 0 - + 500,-1 1 - m_staticline1 + m_textCtrlCommand 1 @@ -804,20 +786,52 @@ Resizable 1 - wxLI_HORIZONTAL - ; ; forward_declare + + 0 + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + wxEXPAND|wxTOP|wxBOTTOM|wxLEFT 0 @@ -839,31 +853,25 @@ - 1 0 1 1 - 0 0 - Dock 0 Left 1 1 - 0 0 wxID_BROWSE_PLUGINS - Browse Generators - - 0 + Browse Generators... 0 @@ -878,8 +886,6 @@ protected 1 - - Resizable 1 @@ -895,6 +901,29 @@ OnBrowseGenerators + + + + + + + + + + + + + + + + + + + + + + + @@ -913,8 +942,14 @@ m_sdbSizer protected + OnCancelClick + + + OnOKClick + + diff --git a/eeschema/dialogs/dialog_netlist_base.h b/eeschema/dialogs/dialog_netlist_base.h index dc439aafd3..8c3e51e2e4 100644 --- a/eeschema/dialogs/dialog_netlist_base.h +++ b/eeschema/dialogs/dialog_netlist_base.h @@ -1,11 +1,12 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 1 2018) +// C++ code generated with wxFormBuilder (version Dec 30 2017) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#pragma once +#ifndef __DIALOG_NETLIST_BASE_H__ +#define __DIALOG_NETLIST_BASE_H__ #include #include @@ -18,14 +19,10 @@ #include #include #include -#include -#include -#include #include #include #include #include -#include /////////////////////////////////////////////////////////////////////////// @@ -36,43 +33,40 @@ class NETLIST_DIALOG_BASE : public DIALOG_SHIM { DECLARE_EVENT_TABLE() private: - + // Private event handlers void _wxFB_OnNetlistTypeSelection( wxNotebookEvent& event ){ OnNetlistTypeSelection( event ); } - void _wxFB_GenNetlist( wxCommandEvent& event ){ GenNetlist( event ); } - void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); } void _wxFB_OnAddGenerator( wxCommandEvent& event ){ OnAddGenerator( event ); } void _wxFB_OnDelGenerator( wxCommandEvent& event ){ OnDelGenerator( event ); } - - + + protected: enum { ID_CHANGE_NOTEBOOK_PAGE = 1000, - ID_CREATE_NETLIST, ID_ADD_PLUGIN, ID_DEL_PLUGIN }; - + wxNotebook* m_NoteBook; - wxButton* m_buttonNetlist; - wxButton* m_buttonCancel; + wxBoxSizer* m_buttonSizer; wxButton* m_buttonAddGenerator; wxButton* m_buttonDelGenerator; - + wxStdDialogButtonSizer* m_sdbSizer2; + wxButton* m_sdbSizer2OK; + wxButton* m_sdbSizer2Cancel; + // Virtual event handlers, overide them in your derived class virtual void OnNetlistTypeSelection( wxNotebookEvent& event ) { event.Skip(); } - virtual void GenNetlist( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnAddGenerator( wxCommandEvent& event ) { event.Skip(); } virtual void OnDelGenerator( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - NETLIST_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Netlist"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + NETLIST_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Export Netlist"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~NETLIST_DIALOG_BASE(); - + }; /////////////////////////////////////////////////////////////////////////////// @@ -82,39 +76,39 @@ class NETLIST_DIALOG_ADD_GENERATOR_BASE : public DIALOG_SHIM { DECLARE_EVENT_TABLE() private: - + // Private event handlers void _wxFB_OnBrowseGenerators( wxCommandEvent& event ){ OnBrowseGenerators( event ); } void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); } void _wxFB_OnOKClick( wxCommandEvent& event ){ OnOKClick( event ); } - - + + protected: enum { wxID_BROWSE_PLUGINS = 1000 }; - - wxStaticText* m_staticTextCmd; - wxTextCtrl* m_textCtrlCommand; + wxStaticText* m_staticTextName; wxTextCtrl* m_textCtrlName; - wxStaticLine* m_staticline1; + wxStaticText* m_staticTextCmd; + wxTextCtrl* m_textCtrlCommand; wxButton* m_buttonGenerator; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; - + // Virtual event handlers, overide them in your derived class virtual void OnBrowseGenerators( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - NETLIST_DIALOG_ADD_GENERATOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Script Generator Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 359,170 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + NETLIST_DIALOG_ADD_GENERATOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Script Generator Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~NETLIST_DIALOG_ADD_GENERATOR_BASE(); - + }; +#endif //__DIALOG_NETLIST_BASE_H__ diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index cc801583b8..80f1532741 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -251,7 +251,6 @@ static const wxChar DefaultJctSizeEntry[] = wxT( "DefaultJunctionSize" ) static const wxChar ShowHiddenPinsEntry[] = wxT( "ShowHiddenPins" ); static const wxChar HorzVertLinesOnlyEntry[] = wxT( "HorizVertLinesOnly" ); static const wxChar FieldNamesEntry[] = wxT( "FieldNames" ); -static const wxChar SimulatorCommandEntry[] = wxT( "SimCmdLine" ); static const wxString ShowPageLimitsEntry = "ShowPageLimits"; static const wxString UnitsEntry = "Units"; static const wxString PrintMonochromeEntry = "PrintMonochrome"; @@ -342,9 +341,6 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg ) aCfg->Read( AutoplaceAlignEntry, &m_autoplaceAlign, false ); aCfg->Read( FootprintPreviewEntry, &m_footprintPreview, false ); - // Load netlists options: - aCfg->Read( SimulatorCommandEntry, &m_simulatorCommand ); - wxString templateFieldNames = aCfg->Read( FieldNamesEntry, wxEmptyString ); if( !templateFieldNames.IsEmpty() ) @@ -392,9 +388,6 @@ void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg ) aCfg->Write( AutoplaceAlignEntry, m_autoplaceAlign ); aCfg->Write( FootprintPreviewEntry, m_footprintPreview ); - // Save netlists options: - aCfg->Write( SimulatorCommandEntry, m_simulatorCommand ); - // Save template fieldnames STRING_FORMATTER sf; m_templateFieldNames.Format( &sf, 0 ); diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index a473820b59..4e1e2fa16a 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -250,7 +250,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ): m_findReplaceStatusPopup = nullptr; SetForceHVLines( true ); - SetSpiceAjustPassiveValues( false ); + SetSpiceAdjustPassiveValues( false ); // Give an icon wxIcon icon; diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index 3fb042d548..9562654a1d 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -112,8 +112,6 @@ private: SCH_ITEM* m_item_to_repeat; ///< Last item to insert by the repeat command. int m_repeatLabelDelta; ///< Repeat label number increment step. SCH_ITEM* m_undoItem; ///< Copy of the current item being edited. - wxString m_simulatorCommand; ///< Command line used to call the circuit - ///< simulator (gnucap, spice, ...) wxString m_netListerCommand; ///< Command line to call a custom net list ///< generator. int m_exec_flags; ///< Flags of the wxExecute() function @@ -214,7 +212,7 @@ public: void SetNetListFormatName( const wxString& aFormat ) { m_netListFormat = aFormat; } bool GetSpiceAjustPassiveValues() const { return m_spiceAjustPassiveValues; } - void SetSpiceAjustPassiveValues( bool aEnable ) { m_spiceAjustPassiveValues = aEnable; } + void SetSpiceAdjustPassiveValues( bool aEnable ) { m_spiceAjustPassiveValues = aEnable; } /// accessor to the destination directory to use when generating plot files. const wxString& GetPlotDirectoryName() const { return m_plotDirectoryName; } @@ -981,10 +979,6 @@ public: */ virtual void PrintPage( wxDC* aDC ) override; - void SetSimulatorCommand( const wxString& aCommand ) { m_simulatorCommand = aCommand; } - - wxString GetSimulatorCommand() const { return m_simulatorCommand; } - void SetNetListerCommand( const wxString& aCommand ) { m_netListerCommand = aCommand; } /**