From eefbd1610e779c7b26b5ab0dbfa1998a3594e8da Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 16 Dec 2012 12:36:18 +0100 Subject: [PATCH] eeschema: make new netlist format (S expr netlist format) the default for Pcbnew netlists in dialog netlist. Also move netlist_control.* to dialogs/dialog_netlist.*, to be consistent with other file dialogs. --- eeschema/CMakeLists.txt | 2 +- .../dialog_netlist.cpp} | 22 +++++++++++-------- .../dialog_netlist.h} | 13 ++++++----- eeschema/eeschema_config.cpp | 2 -- eeschema/netform.cpp | 9 ++++---- eeschema/schframe.cpp | 3 +-- 6 files changed, 26 insertions(+), 25 deletions(-) rename eeschema/{netlist_control.cpp => dialogs/dialog_netlist.cpp} (97%) rename eeschema/{netlist_control.h => dialogs/dialog_netlist.h} (96%) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index aa0e4dc40e..768d7c08bf 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -41,6 +41,7 @@ set(EESCHEMA_DLGS dialogs/dialog_lib_edit_pin_base.cpp dialogs/dialog_lib_new_component.cpp dialogs/dialog_lib_new_component_base.cpp + dialogs/dialog_netlist.cpp dialogs/dialog_netlist_base.cpp dialogs/dialog_plot_schematic_base.cpp dialogs/dialog_plot_schematic.cpp @@ -111,7 +112,6 @@ set(EESCHEMA_SRCS menubar.cpp menubar_libedit.cpp netform.cpp - netlist_control.cpp netlist.cpp onleftclick.cpp onrightclick.cpp diff --git a/eeschema/netlist_control.cpp b/eeschema/dialogs/dialog_netlist.cpp similarity index 97% rename from eeschema/netlist_control.cpp rename to eeschema/dialogs/dialog_netlist.cpp index 30ce04ef22..fe0b330545 100644 --- a/eeschema/netlist_control.cpp +++ b/eeschema/dialogs/dialog_netlist.cpp @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #include @@ -73,6 +73,8 @@ int TestDuplicateSheetNames( bool aCreateMarker ); #define NETLIST_USE_DEFAULT_NETNAME wxT( "NetlistUseDefaultNetname" ) #define NETLIST_PSPICE_USE_NETNAME wxT( "SpiceUseNetNames" ) +#define NETLIST_PCBNEW_LEGACY wxT("LegacyPcbnew" ) +#define NETLIST_PCBNEW_NEWFMT wxT("PcbnewAdvanced" ) BEGIN_EVENT_TABLE( NETLIST_DIALOG, NETLIST_DIALOG_BASE ) @@ -96,7 +98,8 @@ END_EVENT_TABLE() NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& title, NETLIST_TYPE_ID id_NetType ) : - wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxBORDER_SUNKEN ) + wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, + wxTAB_TRAVERSAL | wxBORDER_SUNKEN ) { m_IdNetType = id_NetType; m_pageNetFmtName = title; @@ -108,19 +111,19 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, m_NetOption = NULL; wxString netfmtName = ((NETLIST_DIALOG*)parent->GetParent())->m_NetFmtName; - int fmtOption = 0; + int fmtOption = 1; // Default Pcbnew netlist fmt is advanced fmt bool selected = m_pageNetFmtName == netfmtName; // PCBNEW Format is a special type: if( id_NetType == NET_TYPE_PCBNEW ) { - if( netfmtName.IsEmpty() ) + if( netfmtName.IsEmpty() || netfmtName == NETLIST_PCBNEW_NEWFMT ) selected = true; - if( netfmtName == wxT("PcbnewAdvanced" ) ) + if( netfmtName == NETLIST_PCBNEW_LEGACY ) { selected = true; - fmtOption = 1; + fmtOption = 0; } } @@ -151,7 +154,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, if( id_NetType == NET_TYPE_PCBNEW ) { - wxString netlist_opt[2] = { _( "Pcbnew Format" ), _( "Advanced Format" ) }; + wxString netlist_opt[2] = { _( "Legacy Format" ), _( "Advanced Format" ) }; m_NetOption = new wxRadioBox( this, -1, _( "Netlist Options:" ), wxDefaultPosition, wxDefaultSize, 2, netlist_opt, 1, @@ -167,10 +170,11 @@ const wxString NETLIST_PAGE_DIALOG::GetPageNetFmtName() if( m_IdNetType == NET_TYPE_PCBNEW ) { if( m_NetOption->GetSelection() ) - return wxT( "PcbnewAdvanced" ); + return NETLIST_PCBNEW_NEWFMT; else - return wxT( "Pcbnew" ); + return NETLIST_PCBNEW_LEGACY; } + return m_pageNetFmtName; } diff --git a/eeschema/netlist_control.h b/eeschema/dialogs/dialog_netlist.h similarity index 96% rename from eeschema/netlist_control.h rename to eeschema/dialogs/dialog_netlist.h index c06d630aac..182fb95542 100644 --- a/eeschema/netlist_control.h +++ b/eeschema/dialogs/dialog_netlist.h @@ -1,5 +1,5 @@ /** - * @file netlist_control.h + * @file dialog_netlist.h */ /* @@ -27,8 +27,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef _NETLIST_CONTROL_H_ -#define _NETLIST_CONTROL_H_ +#ifndef _DIALOG_NETLIST_H_ +#define _DIALOG_NETLIST_H_ #include @@ -98,8 +98,9 @@ public: * function GetPageNetFmtName * @return the name of the netlist format for this page * This is usually the page label. - * For the pcbnew netlist, this is the page label when the "old" format is selected - * and "PcbnewAdvanced" when the advanced format is selected + * For the pcbnew netlist, this is "LegacyPcbnew" + * when the "old" format is selected + * and "PcbnewAdvanced" when the advanced format (S expr fmt)is selected */ const wxString GetPageNetFmtName(); @@ -204,4 +205,4 @@ private: void OnBrowsePlugins( wxCommandEvent& event ); }; -#endif /* _NETLIST_CONTROL_H_ */ +#endif /* _DIALOG_NETLIST_H_ */ diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 1654853751..c02750d2c7 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -34,8 +34,6 @@ #include #include -#include -#include #include #include #include diff --git a/eeschema/netform.cpp b/eeschema/netform.cpp index bfea8ce59f..38ffa0e079 100644 --- a/eeschema/netform.cpp +++ b/eeschema/netform.cpp @@ -1,9 +1,9 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 1992-2009 jean-pierre.charras@gipsa-lab.inpg.fr - * Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 1992-2010 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 1992-2012 jp.charras at wanadoo.fr + * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck + * Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -37,8 +37,7 @@ #include #include -#include -#include +#include #include #include #include diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index f5f236cf48..029f6ef705 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -35,7 +35,6 @@ #include #include -#include #include #include #include @@ -44,7 +43,7 @@ #include #include -#include +#include #include #include #include