From b9ba67c8c3637fbe7aef12b6d78c393c967944b3 Mon Sep 17 00:00:00 2001 From: charras Date: Fri, 24 Apr 2009 07:36:36 +0000 Subject: [PATCH] Pcbnew: Fixed: fully broken netlist import from eeschema when using time stamp (fully broken also in stable version). --- CHANGELOG.txt | 7 + cvpcb/makefile.include | 17 +- pcbnew/CMakeLists.txt | 3 +- pcbnew/dialog_netlist.cpp | 363 +--- pcbnew/dialog_netlist.h | 145 +- pcbnew/dialog_netlist.pjd | 1566 ----------------- pcbnew/dialog_netlist.rc | 1 - pcbnew/dialog_netlist_fbp.cpp | 128 ++ pcbnew/dialog_netlist_fbp.fbp | 862 +++++++++ pcbnew/dialog_netlist_fbp.h | 73 + .../dialog_pcbnew_config_libs_and_paths.cpp | 2 +- pcbnew/makefile.include | 4 +- pcbnew/netlist.cpp | 529 +++--- 13 files changed, 1382 insertions(+), 2318 deletions(-) delete mode 100644 pcbnew/dialog_netlist.pjd delete mode 100644 pcbnew/dialog_netlist.rc create mode 100644 pcbnew/dialog_netlist_fbp.cpp create mode 100644 pcbnew/dialog_netlist_fbp.fbp create mode 100644 pcbnew/dialog_netlist_fbp.h diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ce825a39d9..918daa88f9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,13 @@ KiCad ChangeLog 2009 Please add newer entries at the top, list the date and your name with email address. +2009-apr-24 UPDATE Jean-Pierre Charras +================================================================================ +++Pcbnew: + Fixed: fully broken netlist import from eeschema when using time stamp. + (normal operation worked fine) + Added: alawys print diags in dialog window when reading a netlist + 2009-apr-17 UPDATE Jean-Pierre Charras ================================================================================ ++ALL: diff --git a/cvpcb/makefile.include b/cvpcb/makefile.include index 83a2a162e9..bcf8e6344a 100644 --- a/cvpcb/makefile.include +++ b/cvpcb/makefile.include @@ -14,7 +14,6 @@ LIBVIEWER3D = ../3d-viewer/3d-viewer.a OBJECTS = $(TARGET).o \ class_cvpcb.o\ class_board_item.o\ - memoire.o \ cvframe.o\ dialog_cvpcb_config.o\ dialog_cvpcb_config_fbp.o\ @@ -48,21 +47,11 @@ displayframe.o: displayframe.cpp listboxes.o: listboxes.cpp -drawframe.o: ../share/drawframe.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp - init.o: init.cpp -memoire.o: memoire.cpp - -rdpcad.o: rdpcad.cpp - class_board_item.o: ../pcbnew/class_board_item.cpp $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp -class_board.o: ../pcbnew/class_board.cpp - $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp - class_drawsegment.o: ../pcbnew/class_drawsegment.cpp ../pcbnew/class_drawsegment.h $(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp @@ -83,10 +72,6 @@ class_equipot.o: ../pcbnew/class_equipot.cpp readschematicnetlist.o: readschematicnetlist.cpp -viewlogi.o: viewlogi.cpp - -viewlnet.o: viewlnet.cpp - loadcmp.o: loadcmp.cpp savecmp.o: savecmp.cpp @@ -100,7 +85,7 @@ ioascii.o: ../pcbnew/ioascii.cpp listlib.o: listlib.cpp -cfg.o: cfg.cpp cfg.h +cfg.o: cfg.cpp menucfg.o: menucfg.cpp dialog_cvpcb_config.cpp dialog_cvpcb_config.h diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index a9d44fc33a..e2890385a0 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -46,7 +46,8 @@ set(PCBNEW_SRCS dialog_graphic_item_properties.cpp dialog_graphic_item_properties_base.cpp # dialog_initpcb.cpp -# dialog_netlist.cpp + dialog_netlist.cpp + dialog_netlist_fbp.cpp dialog_pcb_text_properties.cpp zones_non_copper_type_functions.cpp dialog_non_copper_zones_properties_base.cpp diff --git a/pcbnew/dialog_netlist.cpp b/pcbnew/dialog_netlist.cpp index 5bddce3772..6a66c1af56 100644 --- a/pcbnew/dialog_netlist.cpp +++ b/pcbnew/dialog_netlist.cpp @@ -1,339 +1,83 @@ ///////////////////////////////////////////////////////////////////////////// - // Name: dialog_netlist.cpp -// Purpose: // Author: jean-pierre Charras -// Modified by: -// Created: 26/02/2006 17:42:19 -// RCS-ID: -// Copyright: License GNU -// Licence: +// Licence: GPL ///////////////////////////////////////////////////////////////////////////// -// Generated by DialogBlocks (unregistered), 26/02/2006 17:42:19 +#include "fctsys.h" +#include "common.h" +#include "pcbnew.h" -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -////@begin includes -////@end includes #include "dialog_netlist.h" -////@begin XPM images -////@end XPM images +extern void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, + const wxString& aNetlistFullFilename, + const wxString& aCmpFullFileName, + wxTextCtrl* aMessageWindow, + bool aChangeFootprint, + bool aDeleteBadTracks, + bool aDeleteExtraFootprints, + bool aSelect_By_Timestamp ); -static bool DisplayWarning; +extern void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* frame, + const wxString& NetlistFullFilename, + BOARD* Pcb ); -/*! - * WinEDA_NetlistFrame type definition - */ -IMPLEMENT_DYNAMIC_CLASS( WinEDA_NetlistFrame, wxDialog ) -/*! - * WinEDA_NetlistFrame event table definition - */ - -BEGIN_EVENT_TABLE( WinEDA_NetlistFrame, wxDialog ) - -////@begin WinEDA_NetlistFrame event table entries - EVT_BUTTON( ID_OPEN_NELIST, WinEDA_NetlistFrame::OnOpenNelistClick ) - - EVT_BUTTON( ID_READ_NETLIST_FILE, WinEDA_NetlistFrame::OnReadNetlistFileClick ) - - EVT_BUTTON( ID_TEST_NETLIST, WinEDA_NetlistFrame::OnTestNetlistClick ) - - EVT_BUTTON( ID_COMPILE_RATSNEST, WinEDA_NetlistFrame::OnCompileRatsnestClick ) - - EVT_BUTTON( wxID_CANCEL, WinEDA_NetlistFrame::OnCancelClick ) - -////@end WinEDA_NetlistFrame event table entries - -END_EVENT_TABLE() - -/*! - * WinEDA_NetlistFrame constructors - */ - -WinEDA_NetlistFrame::WinEDA_NetlistFrame() +/*************************************************************************/ +void WinEDA_PcbFrame::InstallNetlistFrame( wxDC* DC, const wxPoint& pos ) +/*************************************************************************/ { + /* Setup the default netlist file name according to the board file name */ + wxFileName fn = GetScreen()->m_FileName; + + fn.SetExt( NetExtBuffer ); + + DIALOG_NETLIST frame( this, DC, fn.GetFullPath() ); + + frame.ShowModal(); } -WinEDA_NetlistFrame::WinEDA_NetlistFrame( WinEDA_PcbFrame* parent, - wxDC* DC, - const wxString& aNetlistFilename, - wxWindowID id, - const wxString& caption, - const wxPoint& pos, - const wxSize& size, - long style ) +DIALOG_NETLIST::DIALOG_NETLIST( WinEDA_PcbFrame* aParent, wxDC * aDC, const wxString & aNetlistFull_Filename ) + : DIALOG_NETLIST_FBP(aParent) { - m_Parent = parent; - m_DC = DC; + m_Parent = aParent; + m_DC = aDC; + m_NetlistFilenameCtrl->SetValue(aNetlistFull_Filename); - Create( parent, id, caption, pos, size, style ); + Init(); - m_NetlistFilenameCtrl->SetValue( aNetlistFilename ); + if( GetSizer() ) + GetSizer()->SetSizeHints( this ); } -/*! - * WinEDA_NetlistFrame destructor - */ - -WinEDA_NetlistFrame::~WinEDA_NetlistFrame() +void DIALOG_NETLIST::Init() { + SetFocus(); } -/*! - * WinEDA_NetlistFrame creator - */ - -bool WinEDA_NetlistFrame::Create( wxWindow* parent, - wxWindowID id, - const wxString& caption, - const wxPoint& pos, - const wxSize& size, - long style ) +void DIALOG_NETLIST::OnOpenNelistClick( wxCommandEvent& event ) { -////@begin WinEDA_NetlistFrame member initialisation - m_Select_By_Timestamp = NULL; - m_ChangeExistingFootprintCtrl = NULL; - m_DeleteBadTracks = NULL; - m_DisplayWarningCtrl = NULL; - m_RemoveExtraFootprintsCtrl = NULL; - m_btClose = NULL; - m_NetlistFilenameCtrl = NULL; - m_MessageWindow = NULL; - StdDialogButtonSizer = NULL; -////@end WinEDA_NetlistFrame member initialisation + wxString fullfilename; -////@begin WinEDA_NetlistFrame creation - SetExtraStyle(wxWS_EX_BLOCK_EVENTS); - wxDialog::Create( parent, id, caption, pos, size, style ); + wxFileDialog FilesDialog( this, _( "Netlist Selection:" ), wxGetCwd(), + wxEmptyString, NetlistFileWildcard, + wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST ); - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end WinEDA_NetlistFrame creation - return true; -} - - -/*! - * Control creation for WinEDA_NetlistFrame - */ - -void WinEDA_NetlistFrame::CreateControls() -{ - SetFont( *g_DialogFont ); - -////@begin WinEDA_NetlistFrame content construction - // Generated by DialogBlocks, 29/04/2008 20:56:53 (unregistered) - - WinEDA_NetlistFrame* itemDialog1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemDialog1->SetSizer(itemBoxSizer2); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); - - wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer5, 0, wxGROW|wxALL, 5); - - wxArrayString m_Select_By_TimestampStrings; - m_Select_By_TimestampStrings.Add(_("Reference")); - m_Select_By_TimestampStrings.Add(_("Timestamp")); - m_Select_By_Timestamp = new wxRadioBox( itemDialog1, ID_SELECTION_FOOTPRINT_MODE, _("Module Selection:"), wxDefaultPosition, wxDefaultSize, m_Select_By_TimestampStrings, 1, wxRA_SPECIFY_COLS ); - m_Select_By_Timestamp->SetSelection(0); - if (WinEDA_NetlistFrame::ShowToolTips()) - m_Select_By_Timestamp->SetToolTip(_("Select how footprints are recognized:\nby their reference (U1, R3...) (normal setting)\nor their time stamp (special setting after a full schematic reannotation)")); - itemBoxSizer5->Add(m_Select_By_Timestamp, 0, wxGROW|wxALL, 5); - - wxArrayString m_ChangeExistingFootprintCtrlStrings; - m_ChangeExistingFootprintCtrlStrings.Add(_("Keep")); - m_ChangeExistingFootprintCtrlStrings.Add(_("Change")); - m_ChangeExistingFootprintCtrl = new wxRadioBox( itemDialog1, ID_KEEP_OR_CHANGE_FOOTPRINTS, _("Exchange Module:"), wxDefaultPosition, wxDefaultSize, m_ChangeExistingFootprintCtrlStrings, 1, wxRA_SPECIFY_COLS ); - m_ChangeExistingFootprintCtrl->SetSelection(0); - if (WinEDA_NetlistFrame::ShowToolTips()) - m_ChangeExistingFootprintCtrl->SetToolTip(_("Keep or change an existing footprint when the netlist gives a different footprint")); - itemBoxSizer5->Add(m_ChangeExistingFootprintCtrl, 0, wxGROW|wxALL, 5); - - itemBoxSizer4->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer9, 0, wxGROW|wxALL, 5); - - wxArrayString m_DeleteBadTracksStrings; - m_DeleteBadTracksStrings.Add(_("Keep")); - m_DeleteBadTracksStrings.Add(_("Delete")); - m_DeleteBadTracks = new wxRadioBox( itemDialog1, ID_DELETE_TRACKS_OPTION, _("Bad Tracks Deletion:"), wxDefaultPosition, wxDefaultSize, m_DeleteBadTracksStrings, 1, wxRA_SPECIFY_COLS ); - m_DeleteBadTracks->SetSelection(0); - if (WinEDA_NetlistFrame::ShowToolTips()) - m_DeleteBadTracks->SetToolTip(_("Keep or delete bad tracks after a netlist change")); - itemBoxSizer9->Add(m_DeleteBadTracks, 0, wxGROW|wxALL, 5); - - wxStaticBox* itemStaticBoxSizer11Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Options")); - wxStaticBoxSizer* itemStaticBoxSizer11 = new wxStaticBoxSizer(itemStaticBoxSizer11Static, wxVERTICAL); - itemBoxSizer9->Add(itemStaticBoxSizer11, 0, wxGROW|wxALL, 5); - - m_DisplayWarningCtrl = new wxCheckBox( itemDialog1, ID_DISPLAY_WARNINGS_OPT, _("Display Warnings"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); - m_DisplayWarningCtrl->SetValue(false); - itemStaticBoxSizer11->Add(m_DisplayWarningCtrl, 0, wxGROW|wxALL, 5); - - m_RemoveExtraFootprintsCtrl = new wxCheckBox( itemDialog1, ID_REMOVE_EXTRA_FOOTPRINTS_OPT, _("Remove Extra Footprints"), wxDefaultPosition, wxDefaultSize, 0 ); - m_RemoveExtraFootprintsCtrl->SetValue(false); - if (WinEDA_NetlistFrame::ShowToolTips()) - m_RemoveExtraFootprintsCtrl->SetToolTip(_("Remove footprints found on the Board but not in netlist\nNote: only not locked footprints will be removed")); - itemStaticBoxSizer11->Add(m_RemoveExtraFootprintsCtrl, 0, wxGROW|wxALL, 5); - - itemBoxSizer3->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer3->Add(itemBoxSizer15, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxButton* itemButton16 = new wxButton( itemDialog1, ID_OPEN_NELIST, _("Browse Netlist Files"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton16->SetForegroundColour(wxColour(217, 0, 0)); - itemBoxSizer15->Add(itemButton16, 0, wxGROW|wxALL, 5); - - wxButton* itemButton17 = new wxButton( itemDialog1, ID_READ_NETLIST_FILE, _("Read Current Netlist"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton17->SetForegroundColour(wxColour(0, 128, 0)); - itemBoxSizer15->Add(itemButton17, 0, wxGROW|wxALL, 5); - - wxButton* itemButton18 = new wxButton( itemDialog1, ID_TEST_NETLIST, _("Footprints Test"), wxDefaultPosition, wxDefaultSize, 0 ); - if (WinEDA_NetlistFrame::ShowToolTips()) - itemButton18->SetToolTip(_("Read the current neltist file and list missing and extra footprints")); - itemButton18->SetForegroundColour(wxColour(0, 128, 128)); - itemBoxSizer15->Add(itemButton18, 0, wxGROW|wxALL, 5); - - wxButton* itemButton19 = new wxButton( itemDialog1, ID_COMPILE_RATSNEST, _("Rebuild Board Connectivity"), wxDefaultPosition, wxDefaultSize, 0 ); - if (WinEDA_NetlistFrame::ShowToolTips()) - itemButton19->SetToolTip(_("Rebuild the full ratsnest (usefull after a manual pad netname edition)")); - itemButton19->SetForegroundColour(wxColour(0, 0, 132)); - itemBoxSizer15->Add(itemButton19, 0, wxGROW|wxALL, 5); - - m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - m_btClose->SetDefault(); - itemBoxSizer15->Add(m_btClose, 0, wxGROW|wxALL, 5); - - wxStaticBox* itemStaticBoxSizer21Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Netlist File:")); - wxStaticBoxSizer* itemStaticBoxSizer21 = new wxStaticBoxSizer(itemStaticBoxSizer21Static, wxVERTICAL); - itemStaticBoxSizer21Static->SetForegroundColour(wxColour(0, 0, 255)); - itemBoxSizer2->Add(itemStaticBoxSizer21, 0, wxGROW|wxALL, 5); - - m_NetlistFilenameCtrl = new wxTextCtrl( itemDialog1, ID_TEXT_NETLIST_FILENAME, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer21->Add(m_NetlistFilenameCtrl, 0, wxGROW|wxALL, 5); - - m_MessageWindow = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(-1, 120), wxTE_MULTILINE|wxTE_READONLY ); - itemBoxSizer2->Add(m_MessageWindow, 1, wxGROW|wxALL, 10); - - wxStaticLine* itemStaticLine24 = new wxStaticLine( itemDialog1, ID_STATICLINE, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - itemBoxSizer2->Add(itemStaticLine24, 0, wxGROW|wxLEFT|wxRIGHT, 5); - - StdDialogButtonSizer = new wxStdDialogButtonSizer; - - itemBoxSizer2->Add(StdDialogButtonSizer, 0, wxGROW|wxALL, 10); - wxButton* itemButton26 = new wxButton( itemDialog1, wxID_CANCEL, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton26->SetForegroundColour(wxColour(0, 0, 255)); - StdDialogButtonSizer->AddButton(itemButton26); - - StdDialogButtonSizer->Realize(); - - // Set validators - m_DisplayWarningCtrl->SetValidator( wxGenericValidator(& DisplayWarning) ); -////@end WinEDA_NetlistFrame content construction - - m_btClose->SetFocus(); -} - - -/*! - * Should we show tooltips? - */ - -bool WinEDA_NetlistFrame::ShowToolTips() -{ - return true; -} - - -/*! - * Get bitmap resources - */ - -wxBitmap WinEDA_NetlistFrame::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin WinEDA_NetlistFrame bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end WinEDA_NetlistFrame bitmap retrieval -} - - -/*! - * Get icon resources - */ - -wxIcon WinEDA_NetlistFrame::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin WinEDA_NetlistFrame icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end WinEDA_NetlistFrame icon retrieval -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_OPEN_NELIST - */ - -void WinEDA_NetlistFrame::OnOpenNelistClick( wxCommandEvent& event ) -{ - wxString fullfilename, mask( wxT( "*" ) ); - - fullfilename = m_NetlistFilenameCtrl->GetValue(); - mask += NetExtBuffer; - - fullfilename = EDA_FileSelector( _( "Netlist Selection:" ), - wxEmptyString, /* Chemin par defaut */ - fullfilename, /* nom fichier par defaut */ - NetExtBuffer, /* extension par defaut */ - mask, /* Masque d'affichage */ - this, - 0, - TRUE - ); - - if( fullfilename.IsEmpty() ) + if( FilesDialog.ShowModal() != wxID_OK ) return; + + fullfilename = FilesDialog.GetPath( ); + m_NetlistFilenameCtrl->SetValue( fullfilename ); } -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_READ_NETLIST_FILE - */ - -void WinEDA_NetlistFrame::OnReadNetlistFileClick( wxCommandEvent& event ) +void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event ) { wxFileName fn = m_NetlistFilenameCtrl->GetValue(); fn.SetExt( NetCmpExtBuffer ); @@ -342,17 +86,12 @@ void WinEDA_NetlistFrame::OnReadNetlistFileClick( wxCommandEvent& event ) fn.GetFullPath(), m_MessageWindow, m_ChangeExistingFootprintCtrl->GetSelection() == 1 ? TRUE : FALSE, m_DeleteBadTracks->GetSelection() == 1 ? TRUE : FALSE, - m_RemoveExtraFootprintsCtrl->IsChecked(), - m_Select_By_Timestamp->GetSelection() == 1 ? TRUE : FALSE, - m_DisplayWarningCtrl->IsChecked()); + m_RemoveExtraFootprintsCtrl->GetSelection() == 1 ? TRUE : FALSE, + m_Select_By_Timestamp->GetSelection() == 1 ? TRUE : FALSE ); } -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_TEST_NETLIST - */ - -void WinEDA_NetlistFrame::OnTestNetlistClick( wxCommandEvent& event ) +void DIALOG_NETLIST::OnTestFootprintsClick( wxCommandEvent& event ) { TestFor_Duplicate_Missing_And_Extra_Footprints( this, m_NetlistFilenameCtrl->GetValue(), m_Parent->GetBoard() ); } @@ -362,7 +101,7 @@ void WinEDA_NetlistFrame::OnTestNetlistClick( wxCommandEvent& event ) * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_COMPILE_RATSNEST */ -void WinEDA_NetlistFrame::OnCompileRatsnestClick( wxCommandEvent& event ) +void DIALOG_NETLIST::OnCompileRatsnestClick( wxCommandEvent& event ) { m_Parent->Compile_Ratsnest( m_DC, TRUE ); } @@ -372,7 +111,7 @@ void WinEDA_NetlistFrame::OnCompileRatsnestClick( wxCommandEvent& event ) * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL */ -void WinEDA_NetlistFrame::OnCancelClick( wxCommandEvent& event ) +void DIALOG_NETLIST::OnCancelClick( wxCommandEvent& event ) { EndModal( -1 ); } diff --git a/pcbnew/dialog_netlist.h b/pcbnew/dialog_netlist.h index 5d7a9a0513..133bf1adb7 100644 --- a/pcbnew/dialog_netlist.h +++ b/pcbnew/dialog_netlist.h @@ -1,13 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// - // Name: dialog_netlist.h -// Purpose: -// Author: jean-pierre Charras -// Modified by: -// Created: 26/02/2006 17:42:19 -// RCS-ID: -// Copyright: License GNU -// Licence: +/// Author: jean-pierre Charras +// Licence: GPL ///////////////////////////////////////////////////////////////////////////// // Generated by DialogBlocks (unregistered), 26/02/2006 17:42:19 @@ -15,132 +9,29 @@ #ifndef _DIALOG_NETLIST_H_ #define _DIALOG_NETLIST_H_ -/*! - * Includes - */ - -////@begin includes -#include "wx/valgen.h" -#include "wx/statline.h" -////@end includes - -/*! - * Forward declarations - */ - -////@begin forward declarations -class wxStdDialogButtonSizer; -////@end forward declarations - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define ID_DIALOG 10000 -#define ID_SELECTION_FOOTPRINT_MODE 10005 -#define ID_KEEP_OR_CHANGE_FOOTPRINTS 10007 -#define ID_DELETE_TRACKS_OPTION 10006 -#define ID_DISPLAY_WARNINGS_OPT 10008 -#define ID_REMOVE_EXTRA_FOOTPRINTS_OPT 10011 -#define ID_OPEN_NELIST 10001 -#define ID_READ_NETLIST_FILE 10002 -#define ID_TEST_NETLIST 10003 -#define ID_COMPILE_RATSNEST 10004 -#define ID_TEXT_NETLIST_FILENAME 10012 -#define ID_TEXTCTRL 10009 -#define ID_STATICLINE 10010 -#define SYMBOL_WINEDA_NETLISTFRAME_STYLE wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER -#define SYMBOL_WINEDA_NETLISTFRAME_TITLE _("Netlist Dialog") -#define SYMBOL_WINEDA_NETLISTFRAME_IDNAME ID_DIALOG -#define SYMBOL_WINEDA_NETLISTFRAME_SIZE wxSize(400, 300) -#define SYMBOL_WINEDA_NETLISTFRAME_POSITION wxDefaultPosition -////@end control identifiers - -/*! - * Compatibility - */ - -#ifndef wxCLOSE_BOX -#define wxCLOSE_BOX 0x1000 -#endif +#include "dialog_netlist_fbp.h" -/*! - * WinEDA_NetlistFrame class declaration - */ - -class WinEDA_NetlistFrame: public wxDialog +class DIALOG_NETLIST : public DIALOG_NETLIST_FBP { - DECLARE_DYNAMIC_CLASS( WinEDA_NetlistFrame ) - DECLARE_EVENT_TABLE() + private: + WinEDA_PcbFrame * m_Parent; + wxDC * m_DC; -public: - /// Constructors - WinEDA_NetlistFrame(); - WinEDA_NetlistFrame(WinEDA_PcbFrame* parent, - wxDC* DC, - const wxString& aNetlistFilename, - wxWindowID id = SYMBOL_WINEDA_NETLISTFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_NETLISTFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_NETLISTFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_NETLISTFRAME_SIZE, long style = SYMBOL_WINEDA_NETLISTFRAME_STYLE ); - /// Creation - bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_NETLISTFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_NETLISTFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_NETLISTFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_NETLISTFRAME_SIZE, long style = SYMBOL_WINEDA_NETLISTFRAME_STYLE ); + public: + DIALOG_NETLIST( WinEDA_PcbFrame* aParent, wxDC * aDC, const wxString & aNetlistFull_Filename ); + ~DIALOG_NETLIST() {}; - /// Destructor - ~WinEDA_NetlistFrame(); + void Init(); + // Virtual event handlers, overide them in your derived class + void OnOpenNelistClick( wxCommandEvent& event ); + void OnReadNetlistFileClick( wxCommandEvent& event ); + void OnTestFootprintsClick( wxCommandEvent& event ); + void OnCompileRatsnestClick( wxCommandEvent& event ); + void OnCancelClick( wxCommandEvent& event ); - /// Initialises member variables - void Init(); - - /// Creates the controls and sizers - void CreateControls(); - -////@begin WinEDA_NetlistFrame event handler declarations - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_OPEN_NELIST - void OnOpenNelistClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_READ_NETLIST_FILE - void OnReadNetlistFileClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_TEST_NETLIST - void OnTestNetlistClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_COMPILE_RATSNEST - void OnCompileRatsnestClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL - void OnCancelClick( wxCommandEvent& event ); - -////@end WinEDA_NetlistFrame event handler declarations - -////@begin WinEDA_NetlistFrame member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end WinEDA_NetlistFrame member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - -////@begin WinEDA_NetlistFrame member variables - wxRadioBox* m_Select_By_Timestamp; - wxRadioBox* m_ChangeExistingFootprintCtrl; - wxRadioBox* m_DeleteBadTracks; - wxCheckBox* m_DisplayWarningCtrl; - wxCheckBox* m_RemoveExtraFootprintsCtrl; - wxButton* m_btClose; - wxTextCtrl* m_NetlistFilenameCtrl; - wxTextCtrl* m_MessageWindow; - wxStdDialogButtonSizer* StdDialogButtonSizer; -////@end WinEDA_NetlistFrame member variables - WinEDA_PcbFrame* m_Parent; - wxDC* m_DC; }; -#endif -// _DIALOG_NETLIST_H_ +#endif // _DIALOG_NETLIST_H_ diff --git a/pcbnew/dialog_netlist.pjd b/pcbnew/dialog_netlist.pjd deleted file mode 100644 index b00ce282d3..0000000000 --- a/pcbnew/dialog_netlist.pjd +++ /dev/null @@ -1,1566 +0,0 @@ - - -
- 0 - "" - "" - "" - "" - "" - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 0 - "jean-pierre Charras" - "License GNU" - "" - 0 - 0 - "<All platforms>" - "<Any>" - "///////////////////////////////////////////////////////////////////////////// -// Name: %HEADER-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SOURCE-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SYMBOLS-FILENAME% -// Purpose: Symbols file -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "%HEADER-FILENAME%" -#endif - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "%HEADER-FILENAME%" -#endif - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -" - " /// %BODY% -" - " -/*! - * %BODY% - */ - -" - "app_resources.h" - "app_resources.cpp" - "AppResources" - "app.h" - "app.cpp" - "Application" - 0 - "" - "<None>" - "<System>" - "utf-8" - "<System>" - "" - 0 - 0 - 4 - " " - "" - 0 - 0 - 1 - 0 - 1 - 1 - 0 - 1 - 0 -
- - - "" - "data-document" - "" - "" - 0 - 1 - 0 - 0 - - "Configurations" - "config-data-document" - "" - "" - 0 - 1 - 0 - 0 - "" - 1 - 0 - "" - "Debug" - "ANSI" - "Static" - "Modular" - "GUI" - "wxMSW" - "Dynamic" - "Yes" - "No" - "No" - "%WXVERSION%" - "%EXECUTABLE%" - "" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - 0 - 1 - - - - - - - "Projects" - "root-document" - "" - "project" - 1 - 1 - 0 - 1 - - "Windows" - "html-document" - "" - "dialogsfolder" - 1 - 1 - 0 - 1 - - "Netlist Dialog" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "26/3/2006" - "wbDialogProxy" - 10000 - 0 - "" - 0 - "" - 0 - 0 - "ID_DIALOG" - 10000 - "WinEDA_NetlistFrame" - "wxDialog" - "wxDialog" - "dialog_netlist.cpp" - "dialog_netlist.h" - "" - "Netlist Dialog" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 1 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Vertical" - "" - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "26/3/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "26/3/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "22/3/2008" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxRadioBox: ID_SELECTION_FOOTPRINT_MODE" - "dialog-control-document" - "" - "radiobox" - 0 - 1 - 0 - 0 - "22/3/2008" - "wbRadioBoxProxy" - "ID_SELECTION_FOOTPRINT_MODE" - 10005 - "" - "wxRadioBox" - "wxRadioBox" - 1 - 0 - "" - "" - "m_Select_By_Timestamp" - "Module Selection:" - 1 - "Reference|Timestamp" - 0 - "" - "Select how footprints are reconized: -by their reference (U1, R3...) (normal setting) -or their time stamp (special setting after a full schematic reannotation)" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxRadioBox: ID_KEEP_OR_CHANGE_FOOTPRINTS" - "dialog-control-document" - "" - "radiobox" - 0 - 1 - 0 - 0 - "22/3/2008" - "wbRadioBoxProxy" - "ID_KEEP_OR_CHANGE_FOOTPRINTS" - 10007 - "" - "wxRadioBox" - "wxRadioBox" - 1 - 0 - "" - "" - "m_ChangeExistingFootprintCtrl" - "Exchange Module:" - 1 - "Keep|Change" - 0 - "" - "Keep or change an existing footprint when the netlist gives a different footprint" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "22/3/2008" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "22/3/2008" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxRadioBox: ID_DELETE_TRACKS_OPTION" - "dialog-control-document" - "" - "radiobox" - 0 - 1 - 0 - 0 - "22/3/2008" - "wbRadioBoxProxy" - "ID_DELETE_TRACKS_OPTION" - 10006 - "" - "wxRadioBox" - "wxRadioBox" - 1 - 0 - "" - "" - "m_DeleteBadTracks" - "Bad Tracks Deletion:" - 1 - "Keep|Delete" - 0 - "" - "Keep or delete bad tracks after a netlist change" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxStaticBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "22/3/2008" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Options" - "" - "" - "" - "" - 0 - 1 - "wxStaticBox" - "Vertical" - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxCheckBox: ID_DISPLAY_WARNINGS_OPT" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "22/3/2008" - "wbCheckBoxProxy" - "ID_DISPLAY_WARNINGS_OPT" - 10008 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_DisplayWarningCtrl" - "Display Warnings" - 0 - "" - "" - "DisplayWarning" - "wxGenericValidator(& %VARIABLE%)" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_REMOVE_EXTRA_FOOTPRINTS_OPT" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "22/3/2008" - "wbCheckBoxProxy" - "ID_REMOVE_EXTRA_FOOTPRINTS_OPT" - 10011 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_RemoveExtraFootprintsCtrl" - "Remove Extra Footprints" - 0 - "" - "Remove footprints found on the Board but not in netlist -Note: only not locked footprints will be removed" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "26/3/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "26/3/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: ID_OPEN_NELIST" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "26/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnOpenNelistClick|||" - "ID_OPEN_NELIST" - 10001 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Browse Netlist Files" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "D90000" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_READ_NETLIST_FILE" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "26/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnReadNetlistFileClick" - "ID_READ_NETLIST_FILE" - 10002 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Read Current Netlist" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "008000" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_TEST_NETLIST" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "26/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnTestNetlistClick" - "ID_TEST_NETLIST" - 10003 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Footprints Test" - 0 - "" - "Read the current neltist file and list missing and extra footprints" - "" - "" - "" - "" - "" - "" - "" - "" - "008080" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_COMPILE_RATSNEST" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "26/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnCompileRatsnestClick" - "ID_COMPILE_RATSNEST" - 10004 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Rebuild Board Connectivity" - 0 - "" - "Rebuild the full ratsnest (usefull after a manual pad netname edition)" - "" - "" - "" - "" - "" - "" - "" - "" - "000084" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: wxID_CANCEL" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "29/4/2008" - "wbButtonProxy" - "wxID_CANCEL" - 5101 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_btClose" - "Close" - 1 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - "wxStaticBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "22/3/2008" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Netlist File:" - "" - "" - "0000FF" - "" - 0 - 1 - "wxStaticBox" - "Vertical" - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_TEXT_NETLIST_FILENAME" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "22/3/2008" - "wbTextCtrlProxy" - "ID_TEXT_NETLIST_FILENAME" - 10012 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_NetlistFilenameCtrl" - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxTextCtrl: ID_TEXTCTRL" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "26/3/2006" - "wbTextCtrlProxy" - "ID_TEXTCTRL" - 10009 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_MessageWindow" - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - 120 - "Expand" - "Centre" - 1 - 10 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxStaticLine: ID_STATICLINE" - "dialog-control-document" - "" - "staticline" - 0 - 1 - 0 - 0 - "13/11/2007" - "wbStaticLineProxy" - "ID_STATICLINE" - 10010 - "" - "wxStaticLine" - "wxStaticLine" - 1 - 0 - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - - - "wxStdDialogButtonSizer" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "13/11/2007" - "wbStdDialogButtonSizerProxy" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - "StdDialogButtonSizer" - "Expand" - "Centre" - 0 - 10 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: wxID_CANCEL" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 1 - "13/11/2007" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick|NONE||" - "wxID_CANCEL" - 5101 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "&Close" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "0000FF" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - "Sources" - "html-document" - "" - "sourcesfolder" - 1 - 1 - 0 - 1 - - "dialog_netlist.rc" - "source-editor-document" - "dialog_netlist.rc" - "source-editor" - 0 - 0 - 1 - 0 - "26/3/2006" - "" - - - - "Images" - "html-document" - "" - "bitmapsfolder" - 1 - 1 - 0 - 1 - - - - -
diff --git a/pcbnew/dialog_netlist.rc b/pcbnew/dialog_netlist.rc deleted file mode 100644 index b86c4e2265..0000000000 --- a/pcbnew/dialog_netlist.rc +++ /dev/null @@ -1 +0,0 @@ -#include "wx/msw/wx.rc" diff --git a/pcbnew/dialog_netlist_fbp.cpp b/pcbnew/dialog_netlist_fbp.cpp new file mode 100644 index 0000000000..84a4bf9457 --- /dev/null +++ b/pcbnew/dialog_netlist_fbp.cpp @@ -0,0 +1,128 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_netlist_fbp.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bUpperSizer; + bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bLeftSizer; + bLeftSizer = new wxBoxSizer( wxVERTICAL ); + + wxString m_Select_By_TimestampChoices[] = { _("Reference"), _("Timestamp") }; + int m_Select_By_TimestampNChoices = sizeof( m_Select_By_TimestampChoices ) / sizeof( wxString ); + m_Select_By_Timestamp = new wxRadioBox( this, wxID_ANY, _("Module Selection:"), wxDefaultPosition, wxDefaultSize, m_Select_By_TimestampNChoices, m_Select_By_TimestampChoices, 1, wxRA_SPECIFY_COLS ); + m_Select_By_Timestamp->SetSelection( 0 ); + m_Select_By_Timestamp->SetToolTip( _("Select how footprints are recognized:\nby their reference (U1, R3...) (normal setting)\nor their time stamp (special setting after a full schematic reannotation)") ); + + bLeftSizer->Add( m_Select_By_Timestamp, 0, wxALL|wxEXPAND, 5 ); + + wxString m_ChangeExistingFootprintCtrlChoices[] = { _("Keep"), _("Change") }; + int m_ChangeExistingFootprintCtrlNChoices = sizeof( m_ChangeExistingFootprintCtrlChoices ) / sizeof( wxString ); + m_ChangeExistingFootprintCtrl = new wxRadioBox( this, wxID_ANY, _("Exchange Module:"), wxDefaultPosition, wxDefaultSize, m_ChangeExistingFootprintCtrlNChoices, m_ChangeExistingFootprintCtrlChoices, 1, wxRA_SPECIFY_COLS ); + m_ChangeExistingFootprintCtrl->SetSelection( 0 ); + m_ChangeExistingFootprintCtrl->SetToolTip( _("Keep or change an existing footprint when the netlist gives a different footprint") ); + + bLeftSizer->Add( m_ChangeExistingFootprintCtrl, 0, wxALL|wxEXPAND, 5 ); + + bUpperSizer->Add( bLeftSizer, 1, wxEXPAND, 5 ); + + wxBoxSizer* bMiddleSizer; + bMiddleSizer = new wxBoxSizer( wxVERTICAL ); + + wxString m_DeleteBadTracksChoices[] = { _("Keep"), _("Delete") }; + int m_DeleteBadTracksNChoices = sizeof( m_DeleteBadTracksChoices ) / sizeof( wxString ); + m_DeleteBadTracks = new wxRadioBox( this, wxID_ANY, _("Bad Tracks Deletion:"), wxDefaultPosition, wxDefaultSize, m_DeleteBadTracksNChoices, m_DeleteBadTracksChoices, 1, wxRA_SPECIFY_COLS ); + m_DeleteBadTracks->SetSelection( 0 ); + m_DeleteBadTracks->SetToolTip( _("Keep or delete bad tracks after a netlist change") ); + + bMiddleSizer->Add( m_DeleteBadTracks, 0, wxALL|wxEXPAND, 5 ); + + wxString m_RemoveExtraFootprintsCtrlChoices[] = { _("Keep"), _("Delete") }; + int m_RemoveExtraFootprintsCtrlNChoices = sizeof( m_RemoveExtraFootprintsCtrlChoices ) / sizeof( wxString ); + m_RemoveExtraFootprintsCtrl = new wxRadioBox( this, wxID_ANY, _("Extra Footprints"), wxDefaultPosition, wxDefaultSize, m_RemoveExtraFootprintsCtrlNChoices, m_RemoveExtraFootprintsCtrlChoices, 1, wxRA_SPECIFY_COLS ); + m_RemoveExtraFootprintsCtrl->SetSelection( 0 ); + m_RemoveExtraFootprintsCtrl->SetToolTip( _("Remove footprints found on the Board but not in netlist\nNote: only not locked footprints will be removed") ); + + bMiddleSizer->Add( m_RemoveExtraFootprintsCtrl, 0, wxALL|wxEXPAND, 5 ); + + bUpperSizer->Add( bMiddleSizer, 1, wxEXPAND, 5 ); + + wxBoxSizer* bRightSizerButtons; + bRightSizerButtons = new wxBoxSizer( wxVERTICAL ); + + m_button1 = new wxButton( this, ID_OPEN_NELIST, _("Browse Netlist Files"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizerButtons->Add( m_button1, 0, wxALL|wxEXPAND, 5 ); + + m_button2 = new wxButton( this, ID_READ_NETLIST_FILE, _("Read Current Netlist"), wxDefaultPosition, wxDefaultSize, 0 ); + m_button2->SetToolTip( _("Read the current netlist and update connections and connectivity info") ); + + bRightSizerButtons->Add( m_button2, 0, wxALL|wxEXPAND, 5 ); + + m_button3 = new wxButton( this, ID_TEST_NETLIST, _("Footprints Test"), wxDefaultPosition, wxDefaultSize, 0 ); + m_button3->SetToolTip( _("Read the current neltist file and list missing and extra footprints") ); + + bRightSizerButtons->Add( m_button3, 0, wxALL|wxEXPAND, 5 ); + + m_button4 = new wxButton( this, ID_COMPILE_RATSNEST, _("Rebuild Board Connectivity"), wxDefaultPosition, wxDefaultSize, 0 ); + m_button4->SetToolTip( _("Rebuild the full ratsnest (usefull after a manual pad netname edition)") ); + + bRightSizerButtons->Add( m_button4, 0, wxALL|wxEXPAND, 5 ); + + m_button5 = new wxButton( this, wxID_ANY, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizerButtons->Add( m_button5, 0, wxALL|wxEXPAND, 5 ); + + bUpperSizer->Add( bRightSizerButtons, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + + m_staticTextNetfilename = new wxStaticText( this, wxID_ANY, _("Netlist File:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextNetfilename->Wrap( -1 ); + bMainSizer->Add( m_staticTextNetfilename, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_NetlistFilenameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bMainSizer->Add( m_NetlistFilenameCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_staticText1 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1->Wrap( -1 ); + bMainSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_MessageWindow = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CHARWRAP|wxTE_MULTILINE|wxTE_READONLY|wxTE_WORDWRAP ); + bMainSizer->Add( m_MessageWindow, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + this->SetSizer( bMainSizer ); + this->Layout(); + + // Connect Events + m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnOpenNelistClick ), NULL, this ); + m_button2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnReadNetlistFileClick ), NULL, this ); + m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnTestFootprintsClick ), NULL, this ); + m_button4->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnCompileRatsnestClick ), NULL, this ); + m_button5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnCancelClick ), NULL, this ); +} + +DIALOG_NETLIST_FBP::~DIALOG_NETLIST_FBP() +{ + // Disconnect Events + m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnOpenNelistClick ), NULL, this ); + m_button2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnReadNetlistFileClick ), NULL, this ); + m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnTestFootprintsClick ), NULL, this ); + m_button4->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnCompileRatsnestClick ), NULL, this ); + m_button5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnCancelClick ), NULL, this ); +} diff --git a/pcbnew/dialog_netlist_fbp.fbp b/pcbnew/dialog_netlist_fbp.fbp new file mode 100644 index 0000000000..fc8731b1ae --- /dev/null +++ b/pcbnew/dialog_netlist_fbp.fbp @@ -0,0 +1,862 @@ + + + + + + C++ + 1 + UTF-8 + connect + dialog_netlist_fbp + 1000 + none + 1 + dialog_netlist_fbp + + . + + 1 + 1 + 0 + + + + + 1 + + + + 0 + wxID_CANCEL + + + DIALOG_NETLIST_FBP + + 519,431 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Netlist Dialog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxEXPAND + 1 + + + bUpperSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + bLeftSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + "Reference" "Timestamp" + + 1 + + + 0 + wxID_ANY + Module Selection: + 1 + + + m_Select_By_Timestamp + protected + + 0 + + wxRA_SPECIFY_COLS + + Select how footprints are recognized: by their reference (U1, R3...) (normal setting) or their time stamp (special setting after a full schematic reannotation) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "Keep" "Change" + + 1 + + + 0 + wxID_ANY + Exchange Module: + 1 + + + m_ChangeExistingFootprintCtrl + protected + + 0 + + wxRA_SPECIFY_COLS + + Keep or change an existing footprint when the netlist gives a different footprint + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bMiddleSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + "Keep" "Delete" + + 1 + + + 0 + wxID_ANY + Bad Tracks Deletion: + 1 + + + m_DeleteBadTracks + protected + + 0 + + wxRA_SPECIFY_COLS + + Keep or delete bad tracks after a netlist change + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "Keep" "Delete" + + 1 + + + 0 + wxID_ANY + Extra Footprints + 1 + + + m_RemoveExtraFootprintsCtrl + protected + + 0 + + wxRA_SPECIFY_COLS + + Remove footprints found on the Board but not in netlist Note: only not locked footprints will be removed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + + bRightSizerButtons + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_OPEN_NELIST + Browse Netlist Files + + + m_button1 + protected + + + + + + + + + OnOpenNelistClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_READ_NETLIST_FILE + Read Current Netlist + + + m_button2 + protected + + + + + Read the current netlist and update connections and connectivity info + + + + OnReadNetlistFileClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_TEST_NETLIST + Footprints Test + + + m_button3 + protected + + + + + Read the current neltist file and list missing and extra footprints + + + + OnTestFootprintsClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_COMPILE_RATSNEST + Rebuild Board Connectivity + + + m_button4 + protected + + + + + Rebuild the full ratsnest (usefull after a manual pad netname edition) + + + + OnCompileRatsnestClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + wxID_ANY + Close + + + m_button5 + protected + + + + + + + + + OnCancelClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline1 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Netlist File: + + + m_staticTextNetfilename + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_NetlistFilenameCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Messages: + + + m_staticText1 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_MessageWindow + protected + + + wxTE_CHARWRAP|wxTE_MULTILINE|wxTE_READONLY|wxTE_WORDWRAP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialog_netlist_fbp.h b/pcbnew/dialog_netlist_fbp.h new file mode 100644 index 0000000000..8b738e771d --- /dev/null +++ b/pcbnew/dialog_netlist_fbp.h @@ -0,0 +1,73 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_netlist_fbp__ +#define __dialog_netlist_fbp__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_NETLIST_FBP +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_NETLIST_FBP : public wxDialog +{ + private: + + protected: + enum + { + ID_OPEN_NELIST = 1000, + ID_READ_NETLIST_FILE, + ID_TEST_NETLIST, + ID_COMPILE_RATSNEST, + }; + + wxRadioBox* m_Select_By_Timestamp; + wxRadioBox* m_ChangeExistingFootprintCtrl; + wxRadioBox* m_DeleteBadTracks; + wxRadioBox* m_RemoveExtraFootprintsCtrl; + wxButton* m_button1; + wxButton* m_button2; + wxButton* m_button3; + wxButton* m_button4; + wxButton* m_button5; + wxStaticLine* m_staticline1; + wxStaticText* m_staticTextNetfilename; + wxTextCtrl* m_NetlistFilenameCtrl; + wxStaticText* m_staticText1; + wxTextCtrl* m_MessageWindow; + + // Virtual event handlers, overide them in your derived class + virtual void OnOpenNelistClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnReadNetlistFileClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnTestFootprintsClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCompileRatsnestClick( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } + + + public: + DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id = wxID_CANCEL, const wxString& title = _("Netlist Dialog"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 519,431 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_NETLIST_FBP(); + +}; + +#endif //__dialog_netlist_fbp__ diff --git a/pcbnew/dialog_pcbnew_config_libs_and_paths.cpp b/pcbnew/dialog_pcbnew_config_libs_and_paths.cpp index 697536f63e..b384580150 100644 --- a/pcbnew/dialog_pcbnew_config_libs_and_paths.cpp +++ b/pcbnew/dialog_pcbnew_config_libs_and_paths.cpp @@ -40,7 +40,7 @@ DIALOG_PCBNEW_CONFIG_LIBS::DIALOG_PCBNEW_CONFIG_LIBS( WinEDA_PcbFrame* parent ): SetTitle( title ); if( GetSizer() ) - GetSizer()->SetSizeHints( this ); + GetSizer()->SetSizeHints( this ); } diff --git a/pcbnew/makefile.include b/pcbnew/makefile.include index 6387e966fc..6702d4b16b 100644 --- a/pcbnew/makefile.include +++ b/pcbnew/makefile.include @@ -55,6 +55,8 @@ OBJECTS= $(TARGET).o\ set_grid.o \ pcbcfg.o \ netlist.o \ + dialog_netlist.o \ + dialog_netlist_fbp.o \ affiche.o \ swap_layers.o \ tracepcb.o \ @@ -152,7 +154,7 @@ pcbnew.o: pcbnew.cpp pcbnew.h pcbplot.h drag.h \ pcbcfg.o: pcbcfg.cpp pcbcfg.h pcbplot.h -netlist.o: netlist.cpp dialog_netlist.cpp dialog_netlist.h +netlist.o: netlist.cpp dialog_netlist.h gen_modules_placefile.o: gen_modules_placefile.cpp diff --git a/pcbnew/netlist.cpp b/pcbnew/netlist.cpp index b0c835ad30..d0802b4f7a 100644 --- a/pcbnew/netlist.cpp +++ b/pcbnew/netlist.cpp @@ -1,130 +1,109 @@ -/************************************/ -/* PCBNEW: traitement des netlistes */ -/************************************/ - -/* Fichier NETLIST.CPP */ +/***********************/ +/* PCBNEW: netlist.cpp */ +/***********************/ /* - * Fonction de lecture de la netliste pour: - * - Chargement modules et nouvelles connexions - * - Test des modules (modules manquants ou en trop - * - Recalcul du chevelu + * Function to read a netlist. Whele readint a netlis: + * - Load new footprints + * - Initialise net info + * - Test for missing or extra footprints + * - Recalculate ratsnest * - * Remarque importante: - * Lors de la lecture de la netliste pour Chargement modules - * et nouvelles connexions, l'identification des modules peut se faire selon - * 2 criteres: - * - la reference (U2, R5 ..): c'est le mode normal - * - le Time Stamp (Signature Temporelle), a utiliser apres reannotation - * d'un schema, donc apres modification des references sans pourtant - * avoir reellement modifie le schema + * Important remark: + * When reading a netlist Pcbnew must identify existing footprints (link between existing footprints an components in netlist) + * This identification can be from 2 fields: + * - The reference (U2, R5 ..): this is the normal mode + * - The Time Stamp (Signature Temporelle), useful after a full schematic reannotation + * because references can be changed for the same schematic. + * So when reading a netlist this identification ReadPcbNetlist() has aselection of the way to identify footprints. + * If we want to fully reannotate a schematic this sequence must be used + * SAVE your board !!! + * Create and read the netlist (to ensure all info is correct, mainly references and time stamp) + * Reannotate the schematic (references will be changed, but not time stamp) + * Recreate and read the new netlist using the Time Stamp identification (that reinit the new references) */ #include "fctsys.h" -#include "gr_basic.h" #include "common.h" #include "class_drawpanel.h" #include "confirm.h" #include "kicad_string.h" #include "gestfich.h" #include "pcbnew.h" -#include "autorout.h" + +#include "dialog_netlist.h" #include "protos.h" -#define TESTONLY 1 /* ctes utilisees lors de l'appel a */ -#define READMODULE 0 /* ReadPcbNetlist() */ - +// constants used by ReadPcbNetlist(): +#define TESTONLY 1 +#define READMODULE 0 /* Structures locales */ -class MODULEtoLOAD : public EDA_BaseStruct +class MODULEtoLOAD { public: - wxString m_LibName; - wxString m_CmpName; - wxString m_Path; + wxString m_LibName; + wxString m_CmpName; + wxString m_TimeStampPath; + MODULEtoLOAD* m_Next; public: MODULEtoLOAD( const wxString& libname, const wxString& cmpname, - int timestamp, - const wxString& path ); + const wxString& timestamp_path ) + { + m_LibName = libname; + m_CmpName = cmpname; + m_TimeStampPath = timestamp_path; + m_Next = NULL; + } + + ~MODULEtoLOAD() { }; - MODULEtoLOAD* Next() const { return (MODULEtoLOAD*) Pnext; } + MODULEtoLOAD* Next() const { return (MODULEtoLOAD*) m_Next; } + void SetNext( MODULEtoLOAD* next ) { m_Next = next; } }; /* Fonctions locales : */ -static void SortListModulesToLoadByLibname( int NbModules ); -static void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* frame, - const wxString& NetlistFullFilename, - BOARD* Pcb ); -static int BuildFootprintsListFromNetlistFile( const wxString& aNetlistFullFilename, - wxArrayString& aBufName ); -static bool OpenNetlistFile( const wxString& aFullFileName ); -static void AddToList( const wxString& NameLibCmp, - const wxString& NameCmp, - int TimeStamp, - const wxString& path ); -static int SetPadNetName( wxWindow* aFrame, char* Text, MODULE* Module ); -static void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, - const wxString& aNetlistFullFilename, - const wxString& aCmpFullFileName, - wxTextCtrl* aMessageWindow, - bool aChangeFootprint, - bool aDeleteBadTracks, - bool aDeleteExtraFootprints, - bool aSelect_By_Timestamp, - bool aVerbose ); -static int ReadListeModules( const wxString& CmpFullFileName, - const wxString* RefCmp, - long TimeStamp, - wxString& NameModule ); -static MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame, - wxTextCtrl* aMessageWindow, - const wxString& CmpFullFileName, - char* Text, - int* UseFichCmp, - int TstOnly, - bool Select_By_Timestamp, - bool aChangeFootprint ); -static void LoadListeModules( WinEDA_PcbFrame* aPcbFrame, wxDC* DC ); +static void SortListModulesToLoadByLibname( int NbModules ); +static int BuildFootprintsListFromNetlistFile( const wxString& aNetlistFullFilename, + wxArrayString& aBufName ); +static bool OpenNetlistFile( const wxString& aFullFileName ); +static void AddToList( const wxString& NameLibCmp, + const wxString& NameCmp, + const wxString& TimeStampPath ); +static int SetPadNetName( wxWindow* aFrame, + char* Text, + MODULE* Module, + wxTextCtrl* aMessageWindow ); +static int ReadListeModules( const wxString& CmpFullFileName, + const wxString* RefCmp, + const wxString* TimeStampPath, + wxString& NameModule ); +static MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame, + wxTextCtrl* aMessageWindow, + const wxString& CmpFullFileName, + char* Text, + int* UseFichCmp, + int TstOnly, + bool Select_By_Timestamp, + bool aChangeFootprint ); +static void LoadListeModules( WinEDA_PcbFrame* aPcbFrame, wxDC* DC ); /* Variables locales */ static int s_NbNewModules; static MODULEtoLOAD* s_ModuleToLoad_List; FILE* source; -static int DisplayWarningCount; - -/*****************************/ -/* class WinEDA_NetlistFrame */ -/*****************************/ -#include "dialog_netlist.cpp" - - -/*************************************************************************/ -void WinEDA_PcbFrame::InstallNetlistFrame( wxDC* DC, const wxPoint& pos ) -/*************************************************************************/ -{ - /* Setup the default netlist file name according to the board file name */ - wxFileName fn = GetScreen()->m_FileName; - - fn.SetExt( NetExtBuffer ); - - WinEDA_NetlistFrame* frame = new WinEDA_NetlistFrame( this, DC, - fn.GetFullPath() ); - - frame->ShowModal(); - frame->Destroy(); -} /************************************************************************/ bool OpenNetlistFile( const wxString& aFullFileName ) /************************************************************************/ -/* - * routine de selection et d'ouverture du fichier Netlist +/** function OpenNetlistFile + * used to open a netlist file */ { if( aFullFileName.IsEmpty() ) @@ -139,7 +118,7 @@ bool OpenNetlistFile( const wxString& aFullFileName ) return FALSE; } - return TRUE; + return true; } @@ -151,14 +130,17 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, bool aChangeFootprint, bool aDeleteBadTracks, bool aDeleteExtraFootprints, - bool aSelect_By_Timestamp, - bool aVerbose ) + bool aSelect_By_Timestamp ) /********************************************************************************/ -/* mise a jour des empreintes : - * corrige les Net Names, les textes, les "TIME STAMP" +/** Function ReadPcbNetlist + * Update footprints (load missing footprints and delete on request extra footprints) + * Update connectivity info ( Net Name list ) + * Update Reference, value and "TIME STAMP" + * @param aNetlistFullFilename = netlist file name (*.net) + * @param aCmpFullFileName = cmp/footprint list file name (*.cmp) if not found, only the netmist will be used * - * Analyse les lignes: + * the format of the netlist is something like: # EESchema Netlist Version 1.0 generee le 18/5/2005-12:30:22 * ( * ( 40C08647 $noname R20 4,7K {Lib=R} @@ -170,36 +152,33 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, * ( 2 MODA_1 ) * ) * } - #End + * #End */ { - int LineNum, State, Comment; - MODULE* Module = NULL; - D_PAD* PtPad; - char Line[256]; - char* Text; - int UseFichCmp = 1; - wxString msg; - - if( aVerbose ) - DisplayWarningCount = 8; - else - DisplayWarningCount = 0; + int LineNum, State, Comment; + MODULE* Module = NULL; + D_PAD* PtPad; + char Line[256]; + char* Text; + int UseFichCmp = 1; if( !OpenNetlistFile( aNetlistFullFilename ) ) return; - msg = _( "Read Netlist " ) + aNetlistFullFilename; if( aMessageWindow ) - aMessageWindow->AppendText( msg ); + { + wxString msg; + msg.Printf( _( "Reading Netlist \"%s\"" ), GetChars( aNetlistFullFilename ) ); + aMessageWindow->AppendText( msg + wxT( "\n" ) ); + } aFrame->GetScreen()->SetModify(); aFrame->GetBoard()->m_Status_Pcb = 0; State = 0; LineNum = 0; Comment = 0; s_NbNewModules = 0; - wxBusyCursor dummy; // Shows an hourglass while calculating + wxBusyCursor dummy; // Shows an hourglass while calculating - /* First read of the netlist: Build the list of footprints to load (new footprints) + /* First, read the netlist: Build the list of footprints to load (new footprints) */ while( GetLine( source, Line, &LineNum ) ) { @@ -227,13 +206,13 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, if( State == 2 ) { Module = ReadNetModule( aFrame, - aMessageWindow, - aCmpFullFileName, - Text, - &UseFichCmp, - TESTONLY, - aSelect_By_Timestamp, - aChangeFootprint ); + aMessageWindow, + aCmpFullFileName, + Text, + &UseFichCmp, + TESTONLY, + aSelect_By_Timestamp, + aChangeFootprint ); continue; } @@ -265,13 +244,13 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, { Text = StrPurge( Line ); - if( Comment ) /* Commentaires en cours */ + if( Comment ) /* we are reading a commment */ { - if( ( Text = strchr( Text, '}' ) ) == NULL ) + if( ( Text = strchr( Text, '}' ) ) == NULL ) /* this is the end of a comment */ continue; Comment = 0; } - if( *Text == '{' ) /* Commentaires */ + if( *Text == '{' ) /* this is the beginning of a comment */ { Comment = 1; if( ( Text = strchr( Text, '}' ) ) == NULL ) @@ -286,18 +265,18 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, if( State == 2 ) { Module = ReadNetModule( aFrame, - aMessageWindow, - aCmpFullFileName, - Text, - &UseFichCmp, - READMODULE, - aSelect_By_Timestamp, - aChangeFootprint ); - if( Module == NULL ) - { /* empreinte non trouvee dans la netliste */ + aMessageWindow, + aCmpFullFileName, + Text, + &UseFichCmp, + READMODULE, + aSelect_By_Timestamp, + aChangeFootprint ); + if( Module == NULL ) // the module could not be created (perhaps footprint not found in library) + { continue; } - else /* Raz netnames sur pads */ + else /* clear pads netnames */ { PtPad = Module->m_Pads; for( ; PtPad != NULL; PtPad = (D_PAD*) PtPad->Next() ) @@ -312,7 +291,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, { if( Module ) { - SetPadNetName( NULL, Text, Module ); + SetPadNetName( NULL, Text, Module, aMessageWindow ); } State--; } @@ -321,21 +300,23 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, fclose( source ); // Delete footprints not found in netlist: - if ( aDeleteExtraFootprints ) + if( aDeleteExtraFootprints ) { - wxArrayString ModuleListFromNetlist; - /* Build list of modules in the netlist */ - int NbModulesNetListe = BuildFootprintsListFromNetlistFile( aNetlistFullFilename, ModuleListFromNetlist ); + wxArrayString ModuleListFromNetlist; + /* Build list of modules in the netlist */ + int NbModulesNetListe = BuildFootprintsListFromNetlistFile( + aNetlistFullFilename, + ModuleListFromNetlist ); if( NbModulesNetListe ) { - MODULE * NextModule; + MODULE* NextModule; Module = aFrame->GetBoard()->m_Modules; - bool ask_for_confirmation = true; + bool ask_for_confirmation = true; for( ; Module != NULL; Module = NextModule ) { int ii; NextModule = Module->Next(); - if ( (Module->m_ModuleStatus & MODULE_is_LOCKED) ) + if( (Module->m_ModuleStatus & MODULE_is_LOCKED) ) continue; for( ii = 0; ii < NbModulesNetListe; ii++ ) { @@ -348,10 +329,10 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, if( ii == NbModulesNetListe ) /* Module not found in netlist */ { - if ( ask_for_confirmation ) + if( ask_for_confirmation ) { ask_for_confirmation = false; - if ( ! IsOK( NULL, _("Ok to delete footprints not in netlist ?") ) ) + if( !IsOK( NULL, _( "Ok to delete footprints not in netlist ?" ) ) ) break; } aFrame->Delete_Module( Module, NULL, false ); @@ -361,14 +342,14 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame, } /* Rebuild the connectivity */ - aFrame->Compile_Ratsnest( NULL, TRUE ); + aFrame->Compile_Ratsnest( NULL, true ); if( aFrame->GetBoard()->m_Track ) { if( aDeleteBadTracks ) // Remove erroneous tracks { - Netliste_Controle_piste( aFrame, NULL, TRUE ); - aFrame->Compile_Ratsnest( NULL, TRUE ); + Netliste_Controle_piste( aFrame, NULL, true ); + aFrame->Compile_Ratsnest( NULL, true ); } } @@ -405,17 +386,16 @@ MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame, * ( 2 MODB_1 ) */ { - MODULE* Module; - char* text; - wxString TextTimeStamp; - wxString TextNameLibMod; - wxString TextValeur; - wxString TextCmpName; - wxString NameLibCmp; - unsigned long TimeStamp = 0; - int Error = 0; - char Line[1024]; - bool Found; + MODULE* Module; + char* text; + wxString TimeStampPath; + wxString TextNameLibMod; + wxString TextValeur; + wxString TextCmpName; + wxString NameLibCmp; + int Error = 0; + char Line[1024]; + bool Found; strcpy( Line, Text ); @@ -424,7 +404,7 @@ MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame, if( ( text = strtok( Line, " ()\t\n" ) ) == NULL ) Error = 1; else - TextTimeStamp = CONV_FROM_UTF8( text ); + TimeStampPath = CONV_FROM_UTF8( text ); if( ( text = strtok( NULL, " ()\t\n" ) ) == NULL ) Error = 1; @@ -444,27 +424,24 @@ MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame, if( Error > 0 ) return NULL; - wxString LocalTimeStamp = TextTimeStamp.AfterLast( '/' ); - LocalTimeStamp.ToULong( &TimeStamp, 16 ); - /* Tst si composant deja charge */ Module = aFrame->GetBoard()->m_Modules; MODULE* NextModule; - for( Found = FALSE; Module != NULL; Module = NextModule ) + + for( Found = false; Module != NULL; Module = NextModule ) { NextModule = Module->Next(); - if( aSelect_By_Timestamp ) /* Reconnaissance par signature temporelle */ + if( aSelect_By_Timestamp ) /* identification by time stamp */ { - //if( TimeStamp == Module->m_TimeStamp ) - if( TextTimeStamp.CmpNoCase( Module->m_Path ) ) - Found = TRUE; + if( TimeStampPath.CmpNoCase( Module->m_Path ) == 0 ) + Found = true; } - else /* Reconnaissance par Reference */ + else /* identification by Reference */ { if( TextCmpName.CmpNoCase( Module->m_Reference->m_Text ) == 0 ) - Found = TRUE; + Found = true; } - if( Found ) // Test si module (m_LibRef) et module specifie en netlist concordent + if( Found ) // test footprint matching for existing modules: current m_LibRef and module name in netlist must match { if( TstOnly != TESTONLY ) { @@ -472,45 +449,40 @@ MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame, if( *UseFichCmp ) { if( aSelect_By_Timestamp ) - { /* Reconnaissance par signature temporelle */ - *UseFichCmp = ReadListeModules( aCmpFullFileName, - NULL, - TimeStamp, - NameLibCmp ); - } - else /* Reconnaissance par Reference */ { *UseFichCmp = ReadListeModules( aCmpFullFileName, - &TextCmpName, - 0l, - NameLibCmp ); + NULL, + &TimeStampPath, + NameLibCmp ); + } + else + { + *UseFichCmp = ReadListeModules( aCmpFullFileName, + &TextCmpName, + NULL, + NameLibCmp ); } } - if( Module->m_LibRef.CmpNoCase( NameLibCmp ) != 0 ) - { // Module Mismatch: Current module and module specified in netlist are diff. - if( aChangeFootprint ) + if( Module->m_LibRef.CmpNoCase( NameLibCmp ) != 0 ) // Module Mismatch: Current module and module specified in netlist are different. + { + if( aChangeFootprint ) // footprint exchange allowed: { MODULE* NewModule = - aFrame->Get_Librairie_Module( wxEmptyString, NameLibCmp, TRUE ); - if( NewModule ) /* Nouveau module trouve : changement de module */ + aFrame->Get_Librairie_Module( wxEmptyString, NameLibCmp, true ); + if( NewModule ) /* Change old module to the new module (and delete the old one)*/ Module = aFrame->Exchange_Module( NULL, Module, NewModule ); } else { wxString msg; + msg.Printf( + _( + "Component \"%s\": Mismatch! module is [%s] and netlist said [%s]\n" ), + TextCmpName.GetData(), Module->m_LibRef.GetData(), + NameLibCmp.GetData() ); + if( aMessageWindow ) - { - msg.Printf( - _( "Cmp %s: Mismatch! module is [%s] and netlist said [%s]\n" ), - TextCmpName.GetData(), Module->m_LibRef.GetData(), - NameLibCmp.GetData() ); aMessageWindow->AppendText( msg ); - } - if( DisplayWarningCount > 0 ) - { - DisplayError( NULL, msg, 2 ); - DisplayWarningCount--; - } } } } @@ -518,62 +490,53 @@ MODULE* ReadNetModule( WinEDA_PcbFrame* aFrame, } } - if( Module == NULL ) /* Module a charger */ + if( Module == NULL ) /* a new module must be loaded from libs */ { - NameLibCmp = TextNameLibMod; - if( *UseFichCmp ) { if( aSelect_By_Timestamp == 1 ) - { /* Reconnaissance par signature temporelle */ - *UseFichCmp = ReadListeModules( aCmpFullFileName, NULL, TimeStamp, NameLibCmp ); - } - else /* Reconnaissance par Reference */ { - *UseFichCmp = ReadListeModules( aCmpFullFileName, &TextCmpName, 0l, NameLibCmp ); + *UseFichCmp = ReadListeModules( aCmpFullFileName, NULL, &TimeStampPath, NameLibCmp ); + } + else + { + *UseFichCmp = ReadListeModules( aCmpFullFileName, &TextCmpName, NULL, NameLibCmp ); } } if( TstOnly == TESTONLY ) - AddToList( NameLibCmp, TextCmpName, TimeStamp, TextTimeStamp ); + AddToList( NameLibCmp, TextCmpName, TimeStampPath ); else { - if( aMessageWindow && (DisplayWarningCount> 0) ) + if( aMessageWindow ) { wxString msg; msg.Printf( _( "Component [%s] not found" ), TextCmpName.GetData() ); aMessageWindow->AppendText( msg + wxT( "\n" ) ); - DisplayError( NULL, msg, 2 ); - DisplayWarningCount--; } } return NULL; /* Le module n'avait pas pu etre charge */ } - /* mise a jour des reperes ( nom et ref "Time Stamp") si module charge */ + /* Fields update ( reference, value and "Time Stamp") */ Module->m_Reference->m_Text = TextCmpName; - Module->m_Value->m_Text = TextValeur; - Module->m_TimeStamp = TimeStamp; - Module->m_Path = TextTimeStamp; - -#if defined (DEBUG) - printf( "in ReadNetModule() m_Path = %s\n", - CONV_TO_UTF8( Module->m_Path ) ); -#endif + Module->m_Value->m_Text = TextValeur; + Module->m_Path = TimeStampPath; return Module; /* composant trouve */ } -/********************************************************************/ -int SetPadNetName( wxWindow* frame, char* Text, MODULE* Module ) -/********************************************************************/ +/*******************************************************************************************/ +int SetPadNetName( wxWindow* frame, char* Text, MODULE* Module, wxTextCtrl* aMessageWindow ) +/*******************************************************************************************/ /** Function SetPadNetName * Update a pad netname in a given footprint * @param Text = Text from netlist (format: (pad = net) ) * @param Module = the given footprint + * @param aMessageWindow = a wxTextCtrl to print error and warning message (can be NULL) */ { D_PAD* pad; @@ -599,23 +562,25 @@ int SetPadNetName( wxWindow* frame, char* Text, MODULE* Module ) pad = Module->m_Pads; trouve = FALSE; for( ; pad != NULL; pad = (D_PAD*) pad->Next() ) { - if( strnicmp( TextPinName, pad->m_Padname, 4 ) == 0 ) - { /* trouve */ - trouve = TRUE; + if( strnicmp( TextPinName, pad->m_Padname, 4 ) == 0 ) /* trouve */ + { + trouve = true; if( *TextNetName != '?' ) pad->SetNetname( CONV_FROM_UTF8( TextNetName ) ); else - pad->SetNetname( wxEmptyString); + pad->SetNetname( wxEmptyString ); } } - if( !trouve && (DisplayWarningCount > 0) ) + if( !trouve ) { - wxString pin_name = CONV_FROM_UTF8( TextPinName ); - Msg.Printf( _( "Module [%s]: Pad [%s] not found" ), - Module->m_Reference->m_Text.GetData(), pin_name.GetData() ); - DisplayError( frame, Msg, 1 ); - DisplayWarningCount--; + if( aMessageWindow ) + { + wxString pin_name = CONV_FROM_UTF8( TextPinName ); + Msg.Printf( _( "Module [%s]: Pad [%s] not found" ), + Module->m_Reference->m_Text.GetData(), pin_name.GetData() ); + aMessageWindow->AppendText( Msg + wxT( "\n" ) ); + } } return trouve; @@ -626,62 +591,52 @@ int SetPadNetName( wxWindow* frame, char* Text, MODULE* Module ) MODULE* WinEDA_PcbFrame::ListAndSelectModuleName( void ) /*****************************************************/ -/* liste les noms des modules du PCB - * Retourne: - * un pointeur sur le module selectionne - * NULL si pas de selection +/** + * build and shows a list of existing modules on board + * The user can slect a module from this list + * @return a pointer to the selected module or NULL */ { - int ii, jj, nb_empr; - MODULE* Module; - WinEDAListBox* ListBox; - const wxChar** ListNames = NULL; + int ii, jj; + MODULE* Module; if( GetBoard()->m_Modules == NULL ) { DisplayError( this, _( "No Modules" ) ); return 0; } - /* Calcul du nombre des modules */ - nb_empr = 0; Module = (MODULE*) GetBoard()->m_Modules; + WinEDAListBox listbox( this, _( "Components" ), NULL, wxEmptyString ); + Module = (MODULE*) GetBoard()->m_Modules; for( ; Module != NULL; Module = (MODULE*) Module->Next() ) - nb_empr++; - - ListNames = (const wxChar**) MyZMalloc( (nb_empr + 1) * sizeof(wxChar*) ); - Module = (MODULE*) GetBoard()->m_Modules; - for( ii = 0; Module != NULL; Module = (MODULE*) Module->Next(), ii++ ) { - ListNames[ii] = Module->m_Reference->m_Text.GetData(); + listbox.Append( Module->m_Reference->m_Text ); } - ListBox = new WinEDAListBox( this, _( "Components" ), - ListNames, wxEmptyString ); - ii = ListBox->ShowModal(); ListBox->Destroy(); + ii = listbox.ShowModal(); - - if( ii < 0 ) /* Pas de selection */ + if( ii < 0 ) { Module = NULL; } - else /* Recherche du module selectionne */ + else /* Search for the selected footprint */ { + wxString ref = listbox.GetTextSelection(); Module = (MODULE*) GetBoard()->m_Modules; for( jj = 0; Module != NULL; Module = (MODULE*) Module->Next(), jj++ ) { - if( Module->m_Reference->m_Text.Cmp( ListNames[ii] ) == 0 ) + if( Module->m_Reference->m_Text.Cmp( ref ) == 0 ) break; } } - free( ListNames ); return Module; } /*****************************************************************************************/ -void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* aFrame, - const wxString& aNetlistFullFilename, - BOARD* aPcb ) +void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* aFrame, + const wxString& aNetlistFullFilename, + BOARD* aPcb ) /******************************************************************************************/ /** Function TestFor_Duplicate_Missing_And_Extra_Footprints @@ -695,7 +650,7 @@ void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* aFrame, */ #define MAX_LEN_TXT 32 { - int ii; + int ii; MODULE* Module, * pt_aux; int NbModulesNetListe, nberr = 0; WinEDA_TextFrame* List; @@ -707,7 +662,8 @@ void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* aFrame, } /* Construction de la liste des references des modules de la netliste */ - NbModulesNetListe = BuildFootprintsListFromNetlistFile( aNetlistFullFilename, ModuleListFromNetlist ); + NbModulesNetListe = BuildFootprintsListFromNetlistFile( aNetlistFullFilename, + ModuleListFromNetlist ); if( NbModulesNetListe < 0 ) return; /* File not found */ @@ -785,7 +741,8 @@ void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* aFrame, /***************************************************************************************/ -int BuildFootprintsListFromNetlistFile( const wxString& aNetlistFullFilename, wxArrayString& aBufName ) +int BuildFootprintsListFromNetlistFile( const wxString& aNetlistFullFilename, + wxArrayString& aBufName ) /***************************************************************************************/ /** Function BuildFootprintsListFromNetlistFile @@ -855,14 +812,14 @@ int BuildFootprintsListFromNetlistFile( const wxString& aNetlistFullFilename, wx /*****************************************************************************************/ -int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp, long TimeStamp, - wxString& NameModule ) +int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp, + const wxString* TimeStamp, wxString& NameModule ) /*****************************************************************************************/ /* * Lit le fichier .CMP donnant l'equivalence Modules / Composants * Retourne: - * Si ce fichier existe: + * Si ce fichier existe retourne : * 1 et le nom module dans NameModule * -1 si module non trouve en fichier * sinon 0; @@ -877,14 +834,14 @@ int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp, l * Cmp-Mod V01 Genere par PcbNew le 29/10/2003-13:11:6 * * BeginCmp - * TimeStamp = 322D3011; + * TimeStamp = /322D3011; * Reference = BUS1; * ValeurCmp = BUSPC; * IdModule = BUS_PC; * EndCmp * * BeginCmp - * TimeStamp = 32307DE2; + * TimeStamp = /32307DE2/AA450F67; * Reference = C1; * ValeurCmp = 47uF; * IdModule = CP6; @@ -892,9 +849,8 @@ int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp, l * */ { - wxString refcurrcmp, idmod; + wxString refcurrcmp, timestamp, idmod; char ia[1024]; - int timestamp; char* ptcar; FILE* FichCmp; @@ -906,7 +862,7 @@ int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp, l { wxString msg; msg.Printf( _( "File <%s> not found, use Netlist for lib module selection" ), - CmpFullFileName.GetData() ); + CmpFullFileName.GetData() ); DisplayError( NULL, msg, 20 ); return 0; } @@ -919,7 +875,7 @@ int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp, l /* Ici une description de 1 composant commence */ refcurrcmp.Empty(); idmod.Empty(); - timestamp = -1; + timestamp.Empty(); while( fgets( ia, sizeof(ia), FichCmp ) != NULL ) { if( strnicmp( ia, "EndCmp", 6 ) == 0 ) @@ -947,7 +903,7 @@ int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp, l ptcar = ia + 11; ptcar = strtok( ptcar, " =;\t\n" ); if( ptcar ) - sscanf( ptcar, "%X", ×tamp ); + timestamp = CONV_FROM_UTF8( ptcar ); } } @@ -956,16 +912,16 @@ int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp, l /* Test du Composant lu en fichier: est-il le bon */ if( RefCmp ) { - if( RefCmp->CmpNoCase( refcurrcmp ) == 0 ) + if( RefCmp->CmpNoCase( refcurrcmp ) == 0 ) //Found! { fclose( FichCmp ); NameModule = idmod; return 1; } } - else if( TimeStamp != -1 ) + else if( TimeStamp ) { - if( TimeStamp == timestamp ) + if( TimeStamp->CmpNoCase( timestamp ) == 0 && !timestamp.IsEmpty() ) //Found { fclose( FichCmp ); NameModule = idmod; @@ -980,8 +936,7 @@ int ReadListeModules( const wxString& CmpFullFileName, const wxString* RefCmp, l /***********************************************************************************/ -void AddToList( const wxString& NameLibCmp, const wxString& CmpName, - int TimeStamp, const wxString& path ) +void AddToList( const wxString& NameLibCmp, const wxString& CmpName, const wxString& path ) /************************************************************************************/ /* Fontion copiant en memoire de travail les caracteristiques @@ -990,7 +945,7 @@ void AddToList( const wxString& NameLibCmp, const wxString& CmpName, { MODULEtoLOAD* NewMod; - NewMod = new MODULEtoLOAD( NameLibCmp, CmpName, TimeStamp, path ); + NewMod = new MODULEtoLOAD( NameLibCmp, CmpName, path ); NewMod->SetNext( s_ModuleToLoad_List ); s_ModuleToLoad_List = NewMod; s_NbNewModules++; @@ -1022,9 +977,9 @@ void LoadListeModules( WinEDA_PcbFrame* aPcbFrame, wxDC* DC ) if( aPcbFrame->SetBoardBoundaryBoxFromEdgesOnly() ) { aPcbFrame->GetScreen()->m_Curseur.x = aPcbFrame->GetBoard()->m_BoundaryBox.GetRight() + - 5000; + 5000; aPcbFrame->GetScreen()->m_Curseur.y = aPcbFrame->GetBoard()->m_BoundaryBox.GetBottom() + - 10000; + 10000; } else { @@ -1042,7 +997,7 @@ void LoadListeModules( WinEDA_PcbFrame* aPcbFrame, wxDC* DC ) { wxString msg; msg.Printf( _( "Component [%s]: footprint <%s> not found" ), - cmp->m_CmpName.GetData(), cmp->m_LibName.GetData() ); + cmp->m_CmpName.GetData(), cmp->m_LibName.GetData() ); DisplayError( NULL, msg ); continue; } @@ -1050,8 +1005,8 @@ void LoadListeModules( WinEDA_PcbFrame* aPcbFrame, wxDC* DC ) /* Update schematic links : reference "Time Stamp" and schematic hierarchical path */ Module->m_Reference->m_Text = cmp->m_CmpName; - Module->m_TimeStamp = cmp->m_TimeStamp; - Module->m_Path = cmp->m_Path; + Module->m_TimeStamp = GetTimeStamp(); + Module->m_Path = cmp->m_TimeStampPath; } else { @@ -1067,8 +1022,8 @@ void LoadListeModules( WinEDA_PcbFrame* aPcbFrame, wxDC* DC ) Module = newmodule; Module->m_Reference->m_Text = cmp->m_CmpName; - Module->m_TimeStamp = cmp->m_TimeStamp; - Module->m_Path = cmp->m_Path; + Module->m_TimeStamp = GetTimeStamp(); + Module->m_Path = cmp->m_TimeStampPath; } } @@ -1105,7 +1060,7 @@ void SortListModulesToLoadByLibname( int NbModules ) } qsort( base_list, NbModules, sizeof(MODULEtoLOAD*), - ( int( * ) ( const void*, const void* ) )SortByLibName ); + ( int( * ) ( const void*, const void* ) )SortByLibName ); // Reconstruction du chainage: s_ModuleToLoad_List = *base_list; @@ -1121,15 +1076,3 @@ void SortListModulesToLoadByLibname( int NbModules ) free( base_list ); } - - -/*****************************************************************************/ -MODULEtoLOAD::MODULEtoLOAD( const wxString& libname, const wxString& cmpname, - int timestamp, const wxString& path ) : EDA_BaseStruct( TYPE_NOT_INIT ) -/*****************************************************************************/ -{ - m_LibName = libname; - m_CmpName = cmpname; - m_TimeStamp = timestamp; - m_Path = path; -}