Commit 4428d69a authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: Fix a bug when reading a netlist which forces pcbnew to read lib files...

Pcbnew: Fix a bug when reading a netlist which forces pcbnew to read lib files to find a footprint even if the right footprint is already loaded (which explains the long time to load netlists)
Netlist dialog: add option to report only most important messages. Useful for large boards.
class REPORTER: add features to allow a basic message filtering (flags to report all/warning/error messages)
Fix Bug #1214599 ( tools are deselected on Move command )
parent 0be39929
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <macros.h> #include <macros.h>
#include <reporter.h> #include <reporter.h>
REPORTER& REPORTER::Report( const char* aText ) REPORTER& REPORTER::Report( const char* aText )
{ {
Report( FROM_UTF8( aText ) ); Report( FROM_UTF8( aText ) );
......
EESchema-LIBRARY Version 2.3 Date: 07/08/2013 15:43:07 EESchema-LIBRARY Version 2.3
#encoding utf-8 #encoding utf-8
# #
# 4003APG120 # 4003APG120
......
Cmp-Mod V01 Created by CvPCB (2011-03-30 BZR 2935)-testing date = 02/04/2011 13:22:13 Cmp-Mod V01 Created by CvPcb (2013-08-20 BZR 4294)-product date = 21/08/2013 18:12:43
BeginCmp BeginCmp
TimeStamp = /322D3011; TimeStamp = /322D3011;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -27,7 +27,7 @@ Comment3 "Comment 3" ...@@ -27,7 +27,7 @@ Comment3 "Comment 3"
Comment4 "Comment 4" Comment4 "Comment 4"
$EndDescr $EndDescr
$Bitmap $Bitmap
Pos 9250 10500 Pos 9350 10600
Scale 1,000000 Scale 1,000000
Data Data
89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 00 00 00 E5 00 00 01 0E 08 02 00 00 00 F9 5F 47 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 00 00 00 E5 00 00 01 0E 08 02 00 00 00 F9 5F 47
...@@ -1181,7 +1181,7 @@ BF FD 96 77 9E 38 7E F1 EC E1 55 E2 AF 2F E0 1B 5F F9 FC FE BD 4F B9 56 EB C9 C9 ...@@ -1181,7 +1181,7 @@ BF FD 96 77 9E 38 7E F1 EC E1 55 E2 AF 2F E0 1B 5F F9 FC FE BD 4F B9 56 EB C9 C9
29 65 D5 9A 89 35 EB 37 F6 E3 02 4F 95 57 89 BF 1E 63 D9 CA D5 CB 7E 65 BC F3 FF E1 D5 7A 1F CE 29 65 D5 9A 89 35 EB 37 F6 E3 02 4F 95 57 89 BF 1E 63 D9 CA D5 CB 7E 65 BC F3 FF E1 D5 7A 1F CE
A2 94 8E 79 E6 79 49 E6 FD 75 9E B9 C4 BC BF CE 33 97 98 F7 D7 79 E6 12 F3 FE 3A CF 5C E2 E7 E2 A2 94 8E 79 E6 79 49 E6 FD 75 9E B9 C4 BC BF CE 33 97 98 F7 D7 79 E6 12 F3 FE 3A CF 5C E2 E7 E2
03 93 93 93 FD BA 8E 79 E6 39 19 8E FB EB DC 15 0B E6 F9 D5 61 7E 3F 30 CF 5C 62 DE 5F E7 99 4B 03 93 93 93 FD BA 8E 79 E6 39 19 8E FB EB DC 15 0B E6 F9 D5 61 7E 3F 30 CF 5C 62 DE 5F E7 99 4B
FC 1F 94 BD 62 D3 EE A5 8B 6B 00 00 00 00 49 45 4E 44 AE 42 60 82 11 FC 1F 94 BD 62 D3 EE A5 8B 6B 00 00 00 00 49 45 4E 44 AE 42 60 82 10
EndData EndData
$EndBitmap $EndBitmap
Wire Bus Line Wire Bus Line
...@@ -1794,7 +1794,7 @@ U 1 1 4A087146 ...@@ -1794,7 +1794,7 @@ U 1 1 4A087146
P 5250 1950 P 5250 1950
F 0 "U3" H 5250 2525 60 0000 C BNN F 0 "U3" H 5250 2525 60 0000 C BNN
F 1 "74LS541" H 5250 1375 60 0000 C TNN F 1 "74LS541" H 5250 1375 60 0000 C TNN
F 2 "" H 5250 1950 60 0001 C CNN F 2 "DIP-20__300" H 5250 1250 60 0000 C CNN
F 3 "" H 5250 1950 60 0001 C CNN F 3 "" H 5250 1950 60 0001 C CNN
1 5250 1950 1 5250 1950
1 0 0 -1 1 0 0 -1
...@@ -2049,7 +2049,7 @@ U 1 1 32568D1E ...@@ -2049,7 +2049,7 @@ U 1 1 32568D1E
P 1700 7250 P 1700 7250
F 0 "JP1" H 1700 7750 70 0000 C CNN F 0 "JP1" H 1700 7750 70 0000 C CNN
F 1 "CONN_8X2" V 1700 7250 70 0000 C CNN F 1 "CONN_8X2" V 1700 7250 70 0000 C CNN
F 2 "pin_array_8x2" H 1700 7800 60 0000 C CNN F 2 "pin_array_8x2" H 1700 7850 60 0000 C CNN
F 3 "" H 1700 7250 60 0001 C CNN F 3 "" H 1700 7250 60 0001 C CNN
1 1700 7250 1 1700 7250
1 0 0 1 1 0 0 1
...@@ -2384,7 +2384,7 @@ U 1 1 3240023F ...@@ -2384,7 +2384,7 @@ U 1 1 3240023F
P 7700 9050 P 7700 9050
F 0 "U5" H 7750 10200 70 0000 C CNN F 0 "U5" H 7750 10200 70 0000 C CNN
F 1 "628128" H 7700 7900 70 0000 C CNN F 1 "628128" H 7700 7900 70 0000 C CNN
F 2 "32dip600" H 7700 7800 60 0000 C CNN F 2 "DIP-32__600" H 7700 7800 60 0000 C CNN
F 3 "" H 7700 9050 60 0001 C CNN F 3 "" H 7700 9050 60 0001 C CNN
1 7700 9050 1 7700 9050
1 0 0 -1 1 0 0 -1
...@@ -2742,7 +2742,7 @@ U 1 1 322D35B4 ...@@ -2742,7 +2742,7 @@ U 1 1 322D35B4
P 4600 6900 P 4600 6900
F 0 "U2" H 4600 7850 60 0000 C CNN F 0 "U2" H 4600 7850 60 0000 C CNN
F 1 "74LS688" H 4600 5950 60 0000 C CIB F 1 "74LS688" H 4600 5950 60 0000 C CIB
F 2 "20dip300" H 4600 5850 60 0000 C CNB F 2 "DIP-20__300" H 4600 5850 60 0000 C CNB
F 3 "" H 4600 6900 60 0001 C CNN F 3 "" H 4600 6900 60 0001 C CNN
1 4600 6900 1 4600 6900
1 0 0 -1 1 0 0 -1
...@@ -2809,8 +2809,8 @@ L EP600 U8 ...@@ -2809,8 +2809,8 @@ L EP600 U8
U 1 1 322D321C U 1 1 322D321C
P 7650 1800 P 7650 1800
F 0 "U8" H 7650 1900 70 0000 C CNN F 0 "U8" H 7650 1900 70 0000 C CNN
F 1 "EP600" H 7650 1300 70 0000 C CNN F 1 "EP600" H 7650 850 70 0000 C CNN
F 2 "24dip300" H 7700 1000 60 0000 C CNN F 2 "DIP-24__300" H 7700 750 60 0000 C CNN
F 3 "" H 7650 1800 60 0001 C CNN F 3 "" H 7650 1800 60 0001 C CNN
1 7650 1800 1 7650 1800
1 0 0 -1 1 0 0 -1
...@@ -2821,7 +2821,7 @@ U 1 1 322D31F4 ...@@ -2821,7 +2821,7 @@ U 1 1 322D31F4
P 5200 3600 P 5200 3600
F 0 "U1" H 5300 4175 60 0000 L BNN F 0 "U1" H 5300 4175 60 0000 L BNN
F 1 "74LS245" H 5250 3025 60 0000 L TNN F 1 "74LS245" H 5250 3025 60 0000 L TNN
F 2 "20dip300" H 5350 3100 60 0000 C CNN F 2 "DIP-20__300" H 5400 2900 60 0000 C CNN
F 3 "" H 5200 3600 60 0001 C CNN F 3 "" H 5200 3600 60 0001 C CNN
1 5200 3600 1 5200 3600
1 0 0 -1 1 0 0 -1
...@@ -2830,9 +2830,9 @@ $Comp ...@@ -2830,9 +2830,9 @@ $Comp
L BUSPC BUS1 L BUSPC BUS1
U 1 1 322D3011 U 1 1 322D3011
P 2250 2950 P 2250 2950
F 0 "BUS1" H 2250 3050 70 0000 C CNN F 0 "BUS1" H 2200 4600 70 0000 C CNN
F 1 "BUSPC" H 2250 2850 70 0000 C CNN F 1 "BUSPC" H 2200 1250 70 0000 C CNN
F 2 "BUS_PC" H 2250 1250 60 0000 C CNN F 2 "BUS_PC" H 2202 1160 60 0000 C CNN
F 3 "" H 2250 2950 60 0001 C CNN F 3 "" H 2250 2950 60 0001 C CNN
1 2250 2950 1 2250 2950
1 0 0 -1 1 0 0 -1
......
...@@ -47,9 +47,18 @@ class wxTextCtrl; ...@@ -47,9 +47,18 @@ class wxTextCtrl;
* <li> know too much about the caller's UI, i.e. wx. </li> * <li> know too much about the caller's UI, i.e. wx. </li>
* <li> stop after the first error </li> * <li> stop after the first error </li>
* </ul> * </ul>
* the reporter has 3 levels (flags) for filtering:
* no filter
* report warning
* report errors
* They are indicators for the calling code, filtering is not made here
*/ */
class REPORTER class REPORTER
{ {
bool m_reportAll; // Filter flag: set to true to report all messages
bool m_reportWarnings; // Filter flag: set to true to report warning
bool m_reportErrors; // Filter flag: set to true to report errors
public: public:
/** /**
* Function Report * Function Report
...@@ -68,6 +77,41 @@ public: ...@@ -68,6 +77,41 @@ public:
REPORTER& operator <<( wxChar aChar ) { return Report( wxString( aChar ) ); } REPORTER& operator <<( wxChar aChar ) { return Report( wxString( aChar ) ); }
REPORTER& operator <<( const char* aText ) { return Report( aText ); } REPORTER& operator <<( const char* aText ) { return Report( aText ); }
/**
* Returns true if all messages should be reported
*/
bool ReportAll() { return m_reportAll; }
/**
* Returns true if all messages or warning messages should be reported
*/
bool ReportWarnings() { return m_reportAll | m_reportWarnings; }
/**
* Returns true if all messages or error messages should be reported
*/
bool ReportErrors() { return m_reportAll | m_reportErrors; }
/**
* Set the report filter state, for all messages
* @param aEnable = filter state (true/false)
*/
void SetReportAll( bool aEnable) { m_reportAll = aEnable; }
/**
* Set the report filter state, for warning messages
* note: report can be disable only if m_reportAll = false
* @param aEnable = filter state (true/false)
*/
void SetReportWarnings( bool aEnable) { m_reportWarnings = aEnable; }
/**
* Set the report filter state, for error messages
* note: report can be disable only if m_reportAll = false
* @param aEnable = filter state (true/false)
*/
void SetReportErrors( bool aEnable) { m_reportErrors = aEnable; }
}; };
...@@ -84,6 +128,9 @@ public: ...@@ -84,6 +128,9 @@ public:
REPORTER(), REPORTER(),
m_textCtrl( aTextCtrl ) m_textCtrl( aTextCtrl )
{ {
SetReportAll( true );
SetReportWarnings( true );
SetReportErrors( true );
} }
REPORTER& Report( const wxString& aText ); REPORTER& Report( const wxString& aText );
......
...@@ -2368,7 +2368,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -2368,7 +2368,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter )
{ {
component = aNetlist.GetComponent( i ); component = aNetlist.GetComponent( i );
if( aReporter ) if( aReporter && aReporter->ReportAll() )
{ {
msg.Printf( _( "Checking netlist component footprint \"%s:%s:%s\".\n" ), msg.Printf( _( "Checking netlist component footprint \"%s:%s:%s\".\n" ),
GetChars( component->GetReference() ), GetChars( component->GetReference() ),
...@@ -2387,19 +2387,27 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -2387,19 +2387,27 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter )
if( aReporter ) if( aReporter )
{ {
if( component->GetModule() != NULL ) if( component->GetModule() != NULL )
{
msg.Printf( _( "Adding new component \"%s:%s\" footprint \"%s\".\n" ), msg.Printf( _( "Adding new component \"%s:%s\" footprint \"%s\".\n" ),
GetChars( component->GetReference() ), GetChars( component->GetReference() ),
GetChars( component->GetTimeStamp() ), GetChars( component->GetTimeStamp() ),
GetChars( component->GetFootprintName() ) ); GetChars( component->GetFootprintName() ) );
if( aReporter->ReportWarnings() )
aReporter->Report( msg );
}
else else
{
msg.Printf( _( "Cannot add new component \"%s:%s\" due to missing " msg.Printf( _( "Cannot add new component \"%s:%s\" due to missing "
"footprint \"%s\".\n" ), "footprint \"%s\".\n" ),
GetChars( component->GetReference() ), GetChars( component->GetReference() ),
GetChars( component->GetTimeStamp() ), GetChars( component->GetTimeStamp() ),
GetChars( component->GetFootprintName() ) ); GetChars( component->GetFootprintName() ) );
if( aReporter->ReportErrors() )
aReporter->Report( msg ); aReporter->Report( msg );
} }
}
if( !aNetlist.IsDryRun() && (component->GetModule() != NULL) ) if( !aNetlist.IsDryRun() && (component->GetModule() != NULL) )
{ {
...@@ -2422,21 +2430,29 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -2422,21 +2430,29 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter )
if( aReporter ) if( aReporter )
{ {
if( component->GetModule() != NULL ) if( component->GetModule() != NULL )
{
msg.Printf( _( "Replacing component \"%s:%s\" footprint \"%s\" with " msg.Printf( _( "Replacing component \"%s:%s\" footprint \"%s\" with "
"\"%s\".\n" ), "\"%s\".\n" ),
GetChars( footprint->GetReference() ), GetChars( footprint->GetReference() ),
GetChars( footprint->GetPath() ), GetChars( footprint->GetPath() ),
GetChars( footprint->GetLibRef() ), GetChars( footprint->GetLibRef() ),
GetChars( component->GetFootprintName() ) ); GetChars( component->GetFootprintName() ) );
if( aReporter->ReportWarnings() )
aReporter->Report( msg );
}
else else
{
msg.Printf( _( "Cannot replace component \"%s:%s\" due to missing " msg.Printf( _( "Cannot replace component \"%s:%s\" due to missing "
"footprint \"%s\".\n" ), "footprint \"%s\".\n" ),
GetChars( footprint->GetReference() ), GetChars( footprint->GetReference() ),
GetChars( footprint->GetPath() ), GetChars( footprint->GetPath() ),
GetChars( component->GetFootprintName() ) ); GetChars( component->GetFootprintName() ) );
if( aReporter->ReportErrors() )
aReporter->Report( msg ); aReporter->Report( msg );
} }
}
if( !aNetlist.IsDryRun() && (component->GetModule() != NULL) ) if( !aNetlist.IsDryRun() && (component->GetModule() != NULL) )
{ {
...@@ -2459,7 +2475,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -2459,7 +2475,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter )
// Test for reference designator field change. // Test for reference designator field change.
if( footprint->GetReference() != component->GetReference() ) if( footprint->GetReference() != component->GetReference() )
{ {
if( aReporter ) if( aReporter && aReporter->ReportWarnings())
{ {
msg.Printf( _( "Changing footprint \"%s:%s\" reference to \"%s\".\n" ), msg.Printf( _( "Changing footprint \"%s:%s\" reference to \"%s\".\n" ),
GetChars( footprint->GetReference() ), GetChars( footprint->GetReference() ),
...@@ -2475,7 +2491,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -2475,7 +2491,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter )
// Test for value field change. // Test for value field change.
if( footprint->GetValue() != component->GetValue() ) if( footprint->GetValue() != component->GetValue() )
{ {
if( aReporter ) if( aReporter && aReporter->ReportAll() )
{ {
msg.Printf( _( "Changing footprint \"%s:%s\" value from \"%s\" to \"%s\".\n" ), msg.Printf( _( "Changing footprint \"%s:%s\" value from \"%s\" to \"%s\".\n" ),
GetChars( footprint->GetReference() ), GetChars( footprint->GetReference() ),
...@@ -2492,7 +2508,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -2492,7 +2508,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter )
// Test for time stamp change. // Test for time stamp change.
if( footprint->GetPath() != component->GetTimeStamp() ) if( footprint->GetPath() != component->GetTimeStamp() )
{ {
if( aReporter ) if( aReporter && aReporter->ReportWarnings() )
{ {
msg.Printf( _( "Changing footprint path \"%s:%s\" to \"%s\".\n" ), msg.Printf( _( "Changing footprint path \"%s:%s\" to \"%s\".\n" ),
GetChars( footprint->GetReference() ), GetChars( footprint->GetReference() ),
...@@ -2518,7 +2534,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -2518,7 +2534,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter )
{ {
if( !pad->GetNetname().IsEmpty() ) if( !pad->GetNetname().IsEmpty() )
{ {
if( aReporter ) if( aReporter && aReporter->ReportAll() )
{ {
msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ), msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ),
GetChars( footprint->GetReference() ), GetChars( footprint->GetReference() ),
...@@ -2535,7 +2551,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -2535,7 +2551,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter )
{ {
if( net.GetNetName() != pad->GetNetname() ) if( net.GetNetName() != pad->GetNetname() )
{ {
if( aReporter ) if( aReporter && aReporter->ReportAll() )
{ {
msg.Printf( _( "Changing component \"%s:%s\" pin \"%s\" net name from " msg.Printf( _( "Changing component \"%s:%s\" pin \"%s\" net name from "
"\"%s\" to \"%s\".\n" ), "\"%s\" to \"%s\".\n" ),
...@@ -2573,7 +2589,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -2573,7 +2589,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, REPORTER* aReporter )
if( component == NULL ) if( component == NULL )
{ {
if( aReporter ) if( aReporter && aReporter->ReportWarnings() )
{ {
msg.Printf( _( "Removing footprint \"%s:%s\".\n" ), msg.Printf( _( "Removing footprint \"%s:%s\".\n" ),
GetChars( module->GetReference() ), GetChars( module->GetReference() ),
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <dialog_netlist.h> #include <dialog_netlist.h>
#define NETLIST_SILENTMODE_KEY wxT("SilentMode") #define NETLIST_SILENTMODE_KEY wxT("SilentMode")
#define NETLIST_FULLMESSAGES_KEY wxT("NetlistReportAllMsg")
void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC ) void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC )
{ {
...@@ -95,9 +96,11 @@ DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC, ...@@ -95,9 +96,11 @@ DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC,
m_dc = aDC; m_dc = aDC;
m_config = wxGetApp().GetSettings(); m_config = wxGetApp().GetSettings();
m_silentMode = m_config->Read( NETLIST_SILENTMODE_KEY, 0l ); m_silentMode = m_config->Read( NETLIST_SILENTMODE_KEY, 0l );
m_reportAll = m_config->Read( NETLIST_FULLMESSAGES_KEY, 1l );
m_NetlistFilenameCtrl->SetValue( aNetlistFullFilename ); m_NetlistFilenameCtrl->SetValue( aNetlistFullFilename );
m_cmpNameSourceOpt->SetSelection( m_parent->GetUseCmpFileForFpNames() ? 1 : 0 ); m_cmpNameSourceOpt->SetSelection( m_parent->GetUseCmpFileForFpNames() ? 1 : 0 );
m_checkBoxSilentMode->SetValue( m_silentMode ); m_checkBoxSilentMode->SetValue( m_silentMode );
m_checkBoxFullMessages->SetValue( m_reportAll );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
} }
...@@ -105,6 +108,7 @@ DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC, ...@@ -105,6 +108,7 @@ DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC,
DIALOG_NETLIST::~DIALOG_NETLIST() DIALOG_NETLIST::~DIALOG_NETLIST()
{ {
m_config->Write( NETLIST_SILENTMODE_KEY, (long) m_silentMode ); m_config->Write( NETLIST_SILENTMODE_KEY, (long) m_silentMode );
m_config->Write( NETLIST_FULLMESSAGES_KEY, (long) m_reportAll );
} }
void DIALOG_NETLIST::OnOpenNetlistClick( wxCommandEvent& event ) void DIALOG_NETLIST::OnOpenNetlistClick( wxCommandEvent& event )
...@@ -176,6 +180,7 @@ void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event ) ...@@ -176,6 +180,7 @@ void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event )
} }
WX_TEXT_CTRL_REPORTER reporter( m_MessageWindow ); WX_TEXT_CTRL_REPORTER reporter( m_MessageWindow );
reporter.SetReportAll( m_reportAll );
m_parent->ReadPcbNetlist( netlistFileName, cmpFileName, &reporter, m_parent->ReadPcbNetlist( netlistFileName, cmpFileName, &reporter,
m_ChangeExistingFootprintCtrl->GetSelection() == 1, m_ChangeExistingFootprintCtrl->GetSelection() == 1,
......
...@@ -40,7 +40,9 @@ class DIALOG_NETLIST : public DIALOG_NETLIST_FBP ...@@ -40,7 +40,9 @@ class DIALOG_NETLIST : public DIALOG_NETLIST_FBP
private: private:
PCB_EDIT_FRAME* m_parent; PCB_EDIT_FRAME* m_parent;
wxDC* m_dc; wxDC* m_dc;
bool m_silentMode; bool m_silentMode; // if true, do not display warning message about undo
bool m_reportAll; // If true report all messages,
// false, report only warnings or errors
wxConfig* m_config; wxConfig* m_config;
public: public:
...@@ -96,6 +98,10 @@ private: ...@@ -96,6 +98,10 @@ private:
{ {
m_silentMode = m_checkBoxSilentMode->GetValue(); m_silentMode = m_checkBoxSilentMode->GetValue();
} }
void OnClickFullMessages( wxCommandEvent& event )
{
m_reportAll = m_checkBoxFullMessages->GetValue();
}
void OnUpdateUISaveMessagesToFile( wxUpdateUIEvent& aEvent ); void OnUpdateUISaveMessagesToFile( wxUpdateUIEvent& aEvent );
void OnUpdateUIValidNetlistFile( wxUpdateUIEvent& aEvent ); void OnUpdateUIValidNetlistFile( wxUpdateUIEvent& aEvent );
......
...@@ -72,7 +72,7 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w ...@@ -72,7 +72,7 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w
m_RemoveExtraFootprintsCtrl->SetSelection( 0 ); 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") ); m_RemoveExtraFootprintsCtrl->SetToolTip( _("Remove footprints found on the Board but not in netlist\nNote: only not locked footprints will be removed") );
bTracksSizer->Add( m_RemoveExtraFootprintsCtrl, 0, wxALL|wxEXPAND, 5 ); bTracksSizer->Add( m_RemoveExtraFootprintsCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bnetlistOptSizer->Add( bTracksSizer, 1, wxEXPAND, 5 ); bnetlistOptSizer->Add( bTracksSizer, 1, wxEXPAND, 5 );
...@@ -80,31 +80,12 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w ...@@ -80,31 +80,12 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w
bleftSizer->Add( bnetlistOptSizer, 1, wxEXPAND, 5 ); bleftSizer->Add( bnetlistOptSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bCenterSizer;
bCenterSizer = new wxBoxSizer( wxVERTICAL );
m_checkDryRun = new wxCheckBox( this, wxID_ANY, _("Dry run. Only report changes in message panel"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkDryRun->SetToolTip( _("Dry Run:\nThe netlist is read, but no change is actually made on board.\nChanges are only reported in message panel, for info") );
bCenterSizer->Add( m_checkDryRun, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkBoxSilentMode = new wxCheckBox( this, wxID_ANY, _("Silent mode"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxSilentMode->SetToolTip( _("Silent mode:\nDo not show the warning message before reading the netlist") );
bCenterSizer->Add( m_checkBoxSilentMode, 0, wxRIGHT|wxLEFT, 5 );
bleftSizer->Add( bCenterSizer, 0, wxALL|wxEXPAND, 5 );
bUpperSizer->Add( bleftSizer, 1, wxEXPAND, 5 ); bUpperSizer->Add( bleftSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bRightSizerButtons; wxBoxSizer* bRightSizerButtons;
bRightSizerButtons = new wxBoxSizer( wxVERTICAL ); bRightSizerButtons = new wxBoxSizer( wxVERTICAL );
m_buttonBrowse = new wxButton( this, ID_OPEN_NELIST, _("Browse Netlist Files"), wxDefaultPosition, wxDefaultSize, 0 );
bRightSizerButtons->Add( m_buttonBrowse, 0, wxEXPAND|wxALL, 5 );
m_buttonRead = new wxButton( this, ID_READ_NETLIST_FILE, _("Read Current Netlist"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRead = new wxButton( this, ID_READ_NETLIST_FILE, _("Read Current Netlist"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonRead->SetDefault(); m_buttonRead->SetDefault();
m_buttonRead->SetToolTip( _("Read the current netlist and update connections and connectivity info") ); m_buttonRead->SetToolTip( _("Read the current netlist and update connections and connectivity info") );
...@@ -128,28 +109,62 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w ...@@ -128,28 +109,62 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w
bRightSizerButtons->Add( m_buttonSaveMessages, 0, wxALL|wxEXPAND, 5 ); bRightSizerButtons->Add( m_buttonSaveMessages, 0, wxALL|wxEXPAND, 5 );
bUpperSizer->Add( bRightSizerButtons, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); bUpperSizer->Add( bRightSizerButtons, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
bMainSizer->Add( bUpperSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); bMainSizer->Add( bUpperSizer, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bLowerSizer; m_staticline11 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bLowerSizer = new wxBoxSizer( wxVERTICAL ); bMainSizer->Add( m_staticline11, 0, wxEXPAND | wxALL, 5 );
wxBoxSizer* bCenterSizer;
bCenterSizer = new wxBoxSizer( wxVERTICAL );
m_checkDryRun = new wxCheckBox( this, wxID_ANY, _("Dry run. Only report changes in message panel"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkDryRun->SetToolTip( _("Dry Run:\nThe netlist is read, but no change is actually made on board.\nChanges are only reported in message panel, for info") );
bCenterSizer->Add( m_checkDryRun, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkBoxSilentMode = new wxCheckBox( this, wxID_ANY, _("Silent mode"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxSilentMode->SetToolTip( _("Silent mode:\nDo not show the warning message before reading the netlist") );
bCenterSizer->Add( m_checkBoxSilentMode, 0, wxRIGHT|wxLEFT, 5 );
m_checkBoxFullMessages = new wxCheckBox( this, wxID_ANY, _("Display all messages"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxFullMessages->SetValue(true);
m_checkBoxFullMessages->SetToolTip( _("Messages filter:\nIf checked: show all messages when reading the netlist\nIf not checked: show only warning or error messages") );
bCenterSizer->Add( m_checkBoxFullMessages, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bMainSizer->Add( bCenterSizer, 0, wxALL|wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bLowerSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
wxBoxSizer* bLowerSizer;
bLowerSizer = new wxBoxSizer( wxVERTICAL );
m_staticTextNetfilename = new wxStaticText( this, wxID_ANY, _("Netlist File:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextNetfilename = new wxStaticText( this, wxID_ANY, _("Netlist File:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextNetfilename->Wrap( -1 ); m_staticTextNetfilename->Wrap( -1 );
bLowerSizer->Add( m_staticTextNetfilename, 0, wxRIGHT|wxLEFT, 5 ); bLowerSizer->Add( m_staticTextNetfilename, 0, wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerNetlistFilename;
bSizerNetlistFilename = new wxBoxSizer( wxHORIZONTAL );
m_NetlistFilenameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_NetlistFilenameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_NetlistFilenameCtrl->SetMaxLength( 0 ); m_NetlistFilenameCtrl->SetMaxLength( 0 );
bLowerSizer->Add( m_NetlistFilenameCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); bSizerNetlistFilename->Add( m_NetlistFilenameCtrl, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_buttonBrowse = new wxButton( this, ID_OPEN_NELIST, _("Browse"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bSizerNetlistFilename->Add( m_buttonBrowse, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bLowerSizer->Add( bSizerNetlistFilename, 0, wxEXPAND, 5 );
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 ); m_staticText1->Wrap( -1 );
bLowerSizer->Add( m_staticText1, 0, wxRIGHT|wxLEFT, 5 ); bLowerSizer->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 ); m_MessageWindow = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_CHARWRAP|wxTE_MULTILINE|wxTE_READONLY|wxTE_WORDWRAP );
m_MessageWindow->SetMaxLength( 0 ); m_MessageWindow->SetMaxLength( 0 );
...@@ -166,8 +181,6 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w ...@@ -166,8 +181,6 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w
bMainSizer->Fit( this ); bMainSizer->Fit( this );
// Connect Events // Connect Events
m_checkBoxSilentMode->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnClickSilentMode ), NULL, this );
m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnOpenNetlistClick ), NULL, this );
m_buttonRead->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnReadNetlistFileClick ), NULL, this ); m_buttonRead->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnReadNetlistFileClick ), NULL, this );
m_buttonRead->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUIValidNetlistFile ), NULL, this ); m_buttonRead->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUIValidNetlistFile ), NULL, this );
m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnCancelClick ), NULL, this ); m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnCancelClick ), NULL, this );
...@@ -177,13 +190,14 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w ...@@ -177,13 +190,14 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w
m_buttonRebild->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUIValidNetlistFile ), NULL, this ); m_buttonRebild->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUIValidNetlistFile ), NULL, this );
m_buttonSaveMessages->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnSaveMessagesToFile ), NULL, this ); m_buttonSaveMessages->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnSaveMessagesToFile ), NULL, this );
m_buttonSaveMessages->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUISaveMessagesToFile ), NULL, this ); m_buttonSaveMessages->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUISaveMessagesToFile ), NULL, this );
m_checkBoxSilentMode->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnClickSilentMode ), NULL, this );
m_checkBoxFullMessages->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnClickFullMessages ), NULL, this );
m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnOpenNetlistClick ), NULL, this );
} }
DIALOG_NETLIST_FBP::~DIALOG_NETLIST_FBP() DIALOG_NETLIST_FBP::~DIALOG_NETLIST_FBP()
{ {
// Disconnect Events // Disconnect Events
m_checkBoxSilentMode->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnClickSilentMode ), NULL, this );
m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnOpenNetlistClick ), NULL, this );
m_buttonRead->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnReadNetlistFileClick ), NULL, this ); m_buttonRead->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnReadNetlistFileClick ), NULL, this );
m_buttonRead->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUIValidNetlistFile ), NULL, this ); m_buttonRead->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUIValidNetlistFile ), NULL, this );
m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnCancelClick ), NULL, this ); m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnCancelClick ), NULL, this );
...@@ -193,5 +207,8 @@ DIALOG_NETLIST_FBP::~DIALOG_NETLIST_FBP() ...@@ -193,5 +207,8 @@ DIALOG_NETLIST_FBP::~DIALOG_NETLIST_FBP()
m_buttonRebild->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUIValidNetlistFile ), NULL, this ); m_buttonRebild->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUIValidNetlistFile ), NULL, this );
m_buttonSaveMessages->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnSaveMessagesToFile ), NULL, this ); m_buttonSaveMessages->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnSaveMessagesToFile ), NULL, this );
m_buttonSaveMessages->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUISaveMessagesToFile ), NULL, this ); m_buttonSaveMessages->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_NETLIST_FBP::OnUpdateUISaveMessagesToFile ), NULL, this );
m_checkBoxSilentMode->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnClickSilentMode ), NULL, this );
m_checkBoxFullMessages->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnClickFullMessages ), NULL, this );
m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NETLIST_FBP::OnOpenNetlistClick ), NULL, this );
} }
This diff is collapsed.
...@@ -21,9 +21,9 @@ class DIALOG_SHIM; ...@@ -21,9 +21,9 @@ class DIALOG_SHIM;
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/statline.h> #include <wx/statline.h>
#include <wx/checkbox.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/dialog.h> #include <wx/dialog.h>
...@@ -40,10 +40,10 @@ class DIALOG_NETLIST_FBP : public DIALOG_SHIM ...@@ -40,10 +40,10 @@ class DIALOG_NETLIST_FBP : public DIALOG_SHIM
protected: protected:
enum enum
{ {
ID_OPEN_NELIST = 1000, ID_READ_NETLIST_FILE = 1000,
ID_READ_NETLIST_FILE,
ID_TEST_NETLIST, ID_TEST_NETLIST,
ID_COMPILE_RATSNEST ID_COMPILE_RATSNEST,
ID_OPEN_NELIST
}; };
wxRadioBox* m_Select_By_Timestamp; wxRadioBox* m_Select_By_Timestamp;
...@@ -51,23 +51,23 @@ class DIALOG_NETLIST_FBP : public DIALOG_SHIM ...@@ -51,23 +51,23 @@ class DIALOG_NETLIST_FBP : public DIALOG_SHIM
wxRadioBox* m_ChangeExistingFootprintCtrl; wxRadioBox* m_ChangeExistingFootprintCtrl;
wxRadioBox* m_DeleteBadTracks; wxRadioBox* m_DeleteBadTracks;
wxRadioBox* m_RemoveExtraFootprintsCtrl; wxRadioBox* m_RemoveExtraFootprintsCtrl;
wxCheckBox* m_checkDryRun;
wxCheckBox* m_checkBoxSilentMode;
wxButton* m_buttonBrowse;
wxButton* m_buttonRead; wxButton* m_buttonRead;
wxButton* m_buttonClose; wxButton* m_buttonClose;
wxButton* m_buttonFPTest; wxButton* m_buttonFPTest;
wxButton* m_buttonRebild; wxButton* m_buttonRebild;
wxButton* m_buttonSaveMessages; wxButton* m_buttonSaveMessages;
wxStaticLine* m_staticline11;
wxCheckBox* m_checkDryRun;
wxCheckBox* m_checkBoxSilentMode;
wxCheckBox* m_checkBoxFullMessages;
wxStaticLine* m_staticline1; wxStaticLine* m_staticline1;
wxStaticText* m_staticTextNetfilename; wxStaticText* m_staticTextNetfilename;
wxTextCtrl* m_NetlistFilenameCtrl; wxTextCtrl* m_NetlistFilenameCtrl;
wxButton* m_buttonBrowse;
wxStaticText* m_staticText1; wxStaticText* m_staticText1;
wxTextCtrl* m_MessageWindow; wxTextCtrl* m_MessageWindow;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnClickSilentMode( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOpenNetlistClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnReadNetlistFileClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnReadNetlistFileClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUpdateUIValidNetlistFile( wxUpdateUIEvent& event ) { event.Skip(); } virtual void OnUpdateUIValidNetlistFile( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
...@@ -75,6 +75,9 @@ class DIALOG_NETLIST_FBP : public DIALOG_SHIM ...@@ -75,6 +75,9 @@ class DIALOG_NETLIST_FBP : public DIALOG_SHIM
virtual void OnCompileRatsnestClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnCompileRatsnestClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSaveMessagesToFile( wxCommandEvent& event ) { event.Skip(); } virtual void OnSaveMessagesToFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUpdateUISaveMessagesToFile( wxUpdateUIEvent& event ) { event.Skip(); } virtual void OnUpdateUISaveMessagesToFile( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnClickSilentMode( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClickFullMessages( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOpenNetlistClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
......
...@@ -122,6 +122,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -122,6 +122,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_SELECT_LAYER_PAIR: case ID_POPUP_PCB_SELECT_LAYER_PAIR:
case ID_POPUP_PCB_SELECT_NO_CU_LAYER: case ID_POPUP_PCB_SELECT_NO_CU_LAYER:
case ID_POPUP_PCB_MOVE_TRACK_NODE: case ID_POPUP_PCB_MOVE_TRACK_NODE:
case ID_POPUP_PCB_MOVE_TEXTEPCB_REQUEST:
case ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE: case ID_POPUP_PCB_DRAG_TRACK_SEGMENT_KEEP_SLOPE:
case ID_POPUP_PCB_DRAG_TRACK_SEGMENT: case ID_POPUP_PCB_DRAG_TRACK_SEGMENT:
case ID_POPUP_PCB_MOVE_TRACK_SEGMENT: case ID_POPUP_PCB_MOVE_TRACK_SEGMENT:
...@@ -145,6 +146,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -145,6 +146,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_EDIT_DRAWING: case ID_POPUP_PCB_EDIT_DRAWING:
case ID_POPUP_PCB_GETINFO_MARKER: case ID_POPUP_PCB_GETINFO_MARKER:
case ID_POPUP_PCB_MOVE_TEXT_DIMENSION_REQUEST: case ID_POPUP_PCB_MOVE_TEXT_DIMENSION_REQUEST:
case ID_POPUP_PCB_DRAG_MODULE_REQUEST:
case ID_POPUP_PCB_MOVE_MODULE_REQUEST:
case ID_POPUP_PCB_MOVE_TEXTMODULE_REQUEST:
case ID_POPUP_PCB_MOVE_MIRE_REQUEST:
break; break;
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
...@@ -286,11 +291,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -286,11 +291,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
InstallNetlistFrame( &dc ); InstallNetlistFrame( &dc );
break; break;
case ID_GET_TOOLS:
// InstalloolsFrame(this, wxPoint(-1,-1) );
break;
case ID_FIND_ITEMS: case ID_FIND_ITEMS:
InstallFindFrame(); InstallFindFrame();
break; break;
......
...@@ -56,6 +56,11 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName, ...@@ -56,6 +56,11 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
NETLIST netlist; NETLIST netlist;
NETLIST_READER* netlistReader; NETLIST_READER* netlistReader;
netlist.SetIsDryRun( aIsDryRun );
netlist.SetFindByTimeStamp( aSelectByTimeStamp );
netlist.SetDeleteExtraFootprints( aDeleteExtraFootprints );
netlist.SetReplaceFootprints( aChangeFootprints );
try try
{ {
netlistReader = NETLIST_READER::GetNetlistReader( &netlist, aNetlistFileName, netlistReader = NETLIST_READER::GetNetlistReader( &netlist, aNetlistFileName,
...@@ -80,11 +85,6 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName, ...@@ -80,11 +85,6 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
return; return;
} }
netlist.SetIsDryRun( aIsDryRun );
netlist.SetFindByTimeStamp( aSelectByTimeStamp );
netlist.SetDeleteExtraFootprints( aDeleteExtraFootprints );
netlist.SetReplaceFootprints( aChangeFootprints );
// Clear undo and redo lists to avoid inconsistencies between lists // Clear undo and redo lists to avoid inconsistencies between lists
if( !netlist.IsDryRun() ) if( !netlist.IsDryRun() )
GetScreen()->ClearUndoRedoList(); GetScreen()->ClearUndoRedoList();
...@@ -164,7 +164,6 @@ MODULE* PCB_EDIT_FRAME::ListAndSelectModuleName() ...@@ -164,7 +164,6 @@ MODULE* PCB_EDIT_FRAME::ListAndSelectModuleName()
void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter ) void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
throw( IO_ERROR, PARSE_ERROR ) throw( IO_ERROR, PARSE_ERROR )
{ {
bool loadFootprint;
wxString msg; wxString msg;
wxString lastFootprintLibName; wxString lastFootprintLibName;
COMPONENT* component; COMPONENT* component;
...@@ -204,8 +203,27 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -204,8 +203,27 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
else else
fpOnBoard = m_Pcb->FindModule( aNetlist.GetComponent( ii )->GetReference() ); fpOnBoard = m_Pcb->FindModule( aNetlist.GetComponent( ii )->GetReference() );
loadFootprint = (fpOnBoard == NULL) || bool footprintMisMatch = fpOnBoard &&
(fpOnBoard->GetPath() != component->GetFootprintName()); fpOnBoard->GetLibRef() != component->GetFootprintName();
if( footprintMisMatch && !aNetlist.GetReplaceFootprints() )
{
if( aReporter )
{
msg.Printf( _( "* Warning: component `%s` has footprint <%s> and should be <%s>\n" ),
GetChars( component->GetReference() ),
GetChars( fpOnBoard->GetLibRef() ),
GetChars( component->GetFootprintName() ) );
aReporter->Report( msg );
}
continue;
}
if( !aNetlist.GetReplaceFootprints() )
footprintMisMatch = false;
bool loadFootprint = (fpOnBoard == NULL) || footprintMisMatch;
if( loadFootprint && (component->GetFootprintName() != lastFootprintLibName) ) if( loadFootprint && (component->GetFootprintName() != lastFootprintLibName) )
{ {
...@@ -244,7 +262,6 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -244,7 +262,6 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
{ {
if( aReporter ) if( aReporter )
{ {
wxString msg;
msg.Printf( _( "*** Warning: component `%s` footprint <%s> was not found in " msg.Printf( _( "*** Warning: component `%s` footprint <%s> was not found in "
"any libraries. ***\n" ), "any libraries. ***\n" ),
GetChars( component->GetReference() ), GetChars( component->GetReference() ),
...@@ -274,7 +291,6 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -274,7 +291,6 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter ) void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
throw( IO_ERROR, PARSE_ERROR ) throw( IO_ERROR, PARSE_ERROR )
{ {
bool loadFootprint;
wxString msg; wxString msg;
wxString lastFootprintLibName; wxString lastFootprintLibName;
COMPONENT* component; COMPONENT* component;
...@@ -309,8 +325,27 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter ) ...@@ -309,8 +325,27 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
else else
fpOnBoard = m_Pcb->FindModule( aNetlist.GetComponent( ii )->GetReference() ); fpOnBoard = m_Pcb->FindModule( aNetlist.GetComponent( ii )->GetReference() );
loadFootprint = (fpOnBoard == NULL) || bool footprintMisMatch = fpOnBoard &&
(fpOnBoard->GetPath() != component->GetFootprintName()); fpOnBoard->GetLibRef() != component->GetFootprintName();
if( footprintMisMatch && !aNetlist.GetReplaceFootprints() )
{
if( aReporter )
{
msg.Printf( _( "* Warning: component `%s` has footprint <%s> and should be <%s>\n" ),
GetChars( component->GetReference() ),
GetChars( fpOnBoard->GetLibRef() ),
GetChars( component->GetFootprintName() ) );
aReporter->Report( msg );
}
continue;
}
if( !aNetlist.GetReplaceFootprints() )
footprintMisMatch = false;
bool loadFootprint = (fpOnBoard == NULL) || footprintMisMatch;
if( loadFootprint && (component->GetFootprintName() != lastFootprintLibName) ) if( loadFootprint && (component->GetFootprintName() != lastFootprintLibName) )
{ {
......
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