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.
This commit is contained in:
jean-pierre charras 2012-12-16 12:36:18 +01:00
parent 3c315005ee
commit 4352eddadb
6 changed files with 26 additions and 25 deletions

View File

@ -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

View File

@ -49,7 +49,7 @@
#include <protos.h>
#include <sch_sheet.h>
#include <dialog_helpers.h>
#include <netlist_control.h>
#include <dialog_netlist.h>
#include <dialogs/annotate_dialog.h>
#include <wildcards_and_files_ext.h>
#include <wildcards_and_files_ext.h>
@ -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;
}

View File

@ -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 <dialogs/dialog_netlist_base.h>
@ -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_ */

View File

@ -34,8 +34,6 @@
#include <eeschema_id.h>
#include <general.h>
#include <netlist_control.h>
#include <protos.h>
#include <libeditframe.h>
#include <eeschema_config.h>
#include <worksheet.h>

View File

@ -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 <dick@softplc.com>
* 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 <dick@softplc.com>
* 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 <general.h>
#include <netlist.h>
#include <netlist_control.h>
#include <protos.h>
#include <dialog_netlist.h>
#include <class_library.h>
#include <lib_pin.h>
#include <sch_component.h>

View File

@ -35,7 +35,6 @@
#include <base_units.h>
#include <general.h>
#include <protos.h>
#include <eeschema_id.h>
#include <netlist.h>
#include <lib_pin.h>
@ -44,7 +43,7 @@
#include <sch_component.h>
#include <dialog_helpers.h>
#include <netlist_control.h>
#include <dialog_netlist.h>
#include <libeditframe.h>
#include <viewlib_frame.h>
#include <hotkeys.h>