Commit 4352edda authored by jean-pierre charras's avatar jean-pierre charras

eeschema: make new netlist format (S expr netlist format) the default for...

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.
parent 3c315005
...@@ -41,6 +41,7 @@ set(EESCHEMA_DLGS ...@@ -41,6 +41,7 @@ set(EESCHEMA_DLGS
dialogs/dialog_lib_edit_pin_base.cpp dialogs/dialog_lib_edit_pin_base.cpp
dialogs/dialog_lib_new_component.cpp dialogs/dialog_lib_new_component.cpp
dialogs/dialog_lib_new_component_base.cpp dialogs/dialog_lib_new_component_base.cpp
dialogs/dialog_netlist.cpp
dialogs/dialog_netlist_base.cpp dialogs/dialog_netlist_base.cpp
dialogs/dialog_plot_schematic_base.cpp dialogs/dialog_plot_schematic_base.cpp
dialogs/dialog_plot_schematic.cpp dialogs/dialog_plot_schematic.cpp
...@@ -111,7 +112,6 @@ set(EESCHEMA_SRCS ...@@ -111,7 +112,6 @@ set(EESCHEMA_SRCS
menubar.cpp menubar.cpp
menubar_libedit.cpp menubar_libedit.cpp
netform.cpp netform.cpp
netlist_control.cpp
netlist.cpp netlist.cpp
onleftclick.cpp onleftclick.cpp
onrightclick.cpp onrightclick.cpp
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include <protos.h> #include <protos.h>
#include <sch_sheet.h> #include <sch_sheet.h>
#include <dialog_helpers.h> #include <dialog_helpers.h>
#include <netlist_control.h> #include <dialog_netlist.h>
#include <dialogs/annotate_dialog.h> #include <dialogs/annotate_dialog.h>
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
...@@ -73,6 +73,8 @@ int TestDuplicateSheetNames( bool aCreateMarker ); ...@@ -73,6 +73,8 @@ int TestDuplicateSheetNames( bool aCreateMarker );
#define NETLIST_USE_DEFAULT_NETNAME wxT( "NetlistUseDefaultNetname" ) #define NETLIST_USE_DEFAULT_NETNAME wxT( "NetlistUseDefaultNetname" )
#define NETLIST_PSPICE_USE_NETNAME wxT( "SpiceUseNetNames" ) #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 ) BEGIN_EVENT_TABLE( NETLIST_DIALOG, NETLIST_DIALOG_BASE )
...@@ -96,7 +98,8 @@ END_EVENT_TABLE() ...@@ -96,7 +98,8 @@ END_EVENT_TABLE()
NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
const wxString& title, const wxString& title,
NETLIST_TYPE_ID id_NetType ) : 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_IdNetType = id_NetType;
m_pageNetFmtName = title; m_pageNetFmtName = title;
...@@ -108,19 +111,19 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, ...@@ -108,19 +111,19 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
m_NetOption = NULL; m_NetOption = NULL;
wxString netfmtName = ((NETLIST_DIALOG*)parent->GetParent())->m_NetFmtName; 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; bool selected = m_pageNetFmtName == netfmtName;
// PCBNEW Format is a special type: // PCBNEW Format is a special type:
if( id_NetType == NET_TYPE_PCBNEW ) if( id_NetType == NET_TYPE_PCBNEW )
{ {
if( netfmtName.IsEmpty() ) if( netfmtName.IsEmpty() || netfmtName == NETLIST_PCBNEW_NEWFMT )
selected = true; selected = true;
if( netfmtName == wxT("PcbnewAdvanced" ) ) if( netfmtName == NETLIST_PCBNEW_LEGACY )
{ {
selected = true; selected = true;
fmtOption = 1; fmtOption = 0;
} }
} }
...@@ -151,7 +154,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent, ...@@ -151,7 +154,7 @@ NETLIST_PAGE_DIALOG::NETLIST_PAGE_DIALOG( wxNotebook* parent,
if( id_NetType == NET_TYPE_PCBNEW ) 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:" ), m_NetOption = new wxRadioBox( this, -1, _( "Netlist Options:" ),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
2, netlist_opt, 1, 2, netlist_opt, 1,
...@@ -167,10 +170,11 @@ const wxString NETLIST_PAGE_DIALOG::GetPageNetFmtName() ...@@ -167,10 +170,11 @@ const wxString NETLIST_PAGE_DIALOG::GetPageNetFmtName()
if( m_IdNetType == NET_TYPE_PCBNEW ) if( m_IdNetType == NET_TYPE_PCBNEW )
{ {
if( m_NetOption->GetSelection() ) if( m_NetOption->GetSelection() )
return wxT( "PcbnewAdvanced" ); return NETLIST_PCBNEW_NEWFMT;
else else
return wxT( "Pcbnew" ); return NETLIST_PCBNEW_LEGACY;
} }
return m_pageNetFmtName; return m_pageNetFmtName;
} }
......
/** /**
* @file netlist_control.h * @file dialog_netlist.h
*/ */
/* /*
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef _NETLIST_CONTROL_H_ #ifndef _DIALOG_NETLIST_H_
#define _NETLIST_CONTROL_H_ #define _DIALOG_NETLIST_H_
#include <dialogs/dialog_netlist_base.h> #include <dialogs/dialog_netlist_base.h>
...@@ -98,8 +98,9 @@ public: ...@@ -98,8 +98,9 @@ public:
* function GetPageNetFmtName * function GetPageNetFmtName
* @return the name of the netlist format for this page * @return the name of the netlist format for this page
* This is usually the page label. * This is usually the page label.
* For the pcbnew netlist, this is the page label when the "old" format is selected * For the pcbnew netlist, this is "LegacyPcbnew"
* and "PcbnewAdvanced" when the advanced format is selected * when the "old" format is selected
* and "PcbnewAdvanced" when the advanced format (S expr fmt)is selected
*/ */
const wxString GetPageNetFmtName(); const wxString GetPageNetFmtName();
...@@ -204,4 +205,4 @@ private: ...@@ -204,4 +205,4 @@ private:
void OnBrowsePlugins( wxCommandEvent& event ); void OnBrowsePlugins( wxCommandEvent& event );
}; };
#endif /* _NETLIST_CONTROL_H_ */ #endif /* _DIALOG_NETLIST_H_ */
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include <eeschema_id.h> #include <eeschema_id.h>
#include <general.h> #include <general.h>
#include <netlist_control.h>
#include <protos.h>
#include <libeditframe.h> #include <libeditframe.h>
#include <eeschema_config.h> #include <eeschema_config.h>
#include <worksheet.h> #include <worksheet.h>
......
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * 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) 1992-2012 jp.charras at wanadoo.fr
* Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2010 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -37,8 +37,7 @@ ...@@ -37,8 +37,7 @@
#include <general.h> #include <general.h>
#include <netlist.h> #include <netlist.h>
#include <netlist_control.h> #include <dialog_netlist.h>
#include <protos.h>
#include <class_library.h> #include <class_library.h>
#include <lib_pin.h> #include <lib_pin.h>
#include <sch_component.h> #include <sch_component.h>
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include <base_units.h> #include <base_units.h>
#include <general.h> #include <general.h>
#include <protos.h>
#include <eeschema_id.h> #include <eeschema_id.h>
#include <netlist.h> #include <netlist.h>
#include <lib_pin.h> #include <lib_pin.h>
...@@ -44,7 +43,7 @@ ...@@ -44,7 +43,7 @@
#include <sch_component.h> #include <sch_component.h>
#include <dialog_helpers.h> #include <dialog_helpers.h>
#include <netlist_control.h> #include <dialog_netlist.h>
#include <libeditframe.h> #include <libeditframe.h>
#include <viewlib_frame.h> #include <viewlib_frame.h>
#include <hotkeys.h> #include <hotkeys.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment