Implement more precise annotation-required messages.
Also moves the message to an infobar so it's more noticeable. Fixes https://gitlab.com/kicad/code/kicad/issues/7332
This commit is contained in:
parent
a235103e48
commit
41234a8373
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2004-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -565,17 +565,12 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
|||
|
||||
case MAIL_SCH_GET_NETLIST:
|
||||
{
|
||||
if( payload.find( "quiet-annotate" ) != std::string::npos )
|
||||
if( !payload.empty() )
|
||||
{
|
||||
Schematic().GetSheets().AnnotatePowerSymbols();
|
||||
AnnotateComponents( true, UNSORTED, INCREMENTAL_BY_REF, 0, false, false, true,
|
||||
NULL_REPORTER::GetInstance() );
|
||||
}
|
||||
wxString annotationMessage( payload );
|
||||
|
||||
if( payload.find( "no-annotate" ) == std::string::npos )
|
||||
{
|
||||
// Ensure schematic is OK for netlist creation (especially that it is fully annotated):
|
||||
if( !ReadyToNetlist() )
|
||||
if( !ReadyToNetlist( annotationMessage ) )
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2017 jean-pierre Charras jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2020 Kicad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2021 Kicad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -29,6 +29,7 @@
|
|||
#include <dialog_annotate_base.h>
|
||||
#include <eeschema_settings.h>
|
||||
#include <kiface_i.h>
|
||||
#include <widgets/infobar.h>
|
||||
#include <wx_html_report_panel.h>
|
||||
|
||||
// A window name for the annotate dialog to retrieve is if not destroyed
|
||||
|
@ -88,8 +89,8 @@ DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent, const wxString& messag
|
|||
|
||||
if( !message.IsEmpty() )
|
||||
{
|
||||
m_userMessage->SetLabelText( message );
|
||||
m_userMessage->Show( true );
|
||||
m_infoBar->RemoveAllButtons();
|
||||
m_infoBar->ShowMessage( message );
|
||||
|
||||
m_rbScope->Enable( false );
|
||||
}
|
||||
|
@ -195,7 +196,7 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
|
|||
if( reporter.HasMessage() )
|
||||
return;
|
||||
|
||||
if( m_userMessage->IsShown() )
|
||||
if( m_infoBar->IsShown() )
|
||||
{
|
||||
// Close the dialog by calling the default handler for a wxID_OK event
|
||||
event.SetId( wxID_OK );
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "widgets/infobar.h"
|
||||
#include "wx_html_report_panel.h"
|
||||
|
||||
#include "dialog_annotate_base.h"
|
||||
|
@ -18,16 +19,16 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
|
|||
wxBoxSizer* bmainSizer;
|
||||
bmainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_infoBar = new WX_INFOBAR( this );
|
||||
m_infoBar->SetShowHideEffects( wxSHOW_EFFECT_NONE, wxSHOW_EFFECT_NONE );
|
||||
m_infoBar->SetEffectDuration( 500 );
|
||||
m_infoBar->Hide();
|
||||
|
||||
bmainSizer->Add( m_infoBar, 0, wxEXPAND|wxBOTTOM, 5 );
|
||||
|
||||
wxBoxSizer* bupperSizer;
|
||||
bupperSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_userMessage = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_userMessage->Wrap( 1 );
|
||||
m_userMessage->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||
m_userMessage->Hide();
|
||||
|
||||
bupperSizer->Add( m_userMessage, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxFlexGridSizer* fgSizer1;
|
||||
fgSizer1 = new wxFlexGridSizer( 2, 2, 0, 0 );
|
||||
fgSizer1->AddGrowableCol( 0 );
|
||||
|
|
|
@ -59,6 +59,66 @@
|
|||
<property name="name">bmainSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxBOTTOM</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxInfoBar" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="duration">500</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">1</property>
|
||||
<property name="hide_effect">wxSHOW_EFFECT_NONE</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_infoBar</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="show_effect">wxSHOW_EFFECT_NONE</property>
|
||||
<property name="size"></property>
|
||||
<property name="subclass">WX_INFOBAR; widgets/infobar.h; forward_declare</property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">6</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
|
@ -68,67 +128,6 @@
|
|||
<property name="name">bupperSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font">,90,92,-1,70,0</property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">1</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label"></property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_userMessage</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">1</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND</property>
|
||||
|
|
|
@ -11,14 +11,15 @@
|
|||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class WX_HTML_REPORT_PANEL;
|
||||
class WX_INFOBAR;
|
||||
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/infobar.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/bitmap.h>
|
||||
|
@ -50,7 +51,7 @@ class DIALOG_ANNOTATE_BASE : public DIALOG_SHIM
|
|||
private:
|
||||
|
||||
protected:
|
||||
wxStaticText* m_userMessage;
|
||||
WX_INFOBAR* m_infoBar;
|
||||
wxRadioBox* m_rbScope;
|
||||
wxRadioButton* m_rbSortBy_X_Position;
|
||||
wxStaticBitmap* annotate_down_right_bitmap;
|
||||
|
|
|
@ -485,7 +485,7 @@ void DIALOG_BOM::OnRunGenerator( wxCommandEvent& event )
|
|||
m_parent->SetExecFlags( wxEXEC_SHOW_CONSOLE );
|
||||
#endif
|
||||
|
||||
if( m_parent->ReadyToNetlist( false, false ) )
|
||||
if( m_parent->ReadyToNetlist( _( "Generating BOM requires a fully annotated schematic." ) ) )
|
||||
m_parent->WriteNetListFile( -1, fullfilename, GNL_OPT_BOM, &reporter );
|
||||
|
||||
m_Messages->SetValue( reportmsg );
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020)
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
@ -22,6 +22,8 @@ DIALOG_ERC_BASE::DIALOG_ERC_BASE( wxWindow* parent, wxWindowID id, const wxStrin
|
|||
m_infoBar = new WX_INFOBAR( this );
|
||||
m_infoBar->SetShowHideEffects( wxSHOW_EFFECT_NONE, wxSHOW_EFFECT_NONE );
|
||||
m_infoBar->SetEffectDuration( 500 );
|
||||
m_infoBar->Hide();
|
||||
|
||||
bSizer1->Add( m_infoBar, 0, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bMainSizer;
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<property name="file">dialog_erc_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_ERC_base</property>
|
||||
|
@ -26,7 +25,6 @@
|
|||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
|
@ -92,7 +90,7 @@
|
|||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="hidden">1</property>
|
||||
<property name="hide_effect">wxSHOW_EFFECT_NONE</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="max_size"></property>
|
||||
|
@ -953,7 +951,6 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
@ -1098,7 +1095,6 @@
|
|||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="bitmap"></property>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020)
|
||||
// C++ code generated with wxFormBuilder (version Oct 26 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2013-2017 Jean-Pierre Charras, jp.charras@wanadoo.fr
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -338,15 +338,11 @@ void NETLIST_DIALOG::OnRunExternSpiceCommand( wxCommandEvent& event )
|
|||
wxString commandLine = simulatorCommand;
|
||||
commandLine.Replace( "%I", fn.GetFullPath(), true );
|
||||
|
||||
if( m_Parent->ReadyToNetlist( false, false ) )
|
||||
m_Parent->WriteNetListFile( NET_TYPE_SPICE, fn.GetFullPath(), netlist_opt, nullptr );
|
||||
else
|
||||
if( m_Parent->ReadyToNetlist( _( "Simulator requires a fully annotated schematic." ) ) )
|
||||
{
|
||||
wxMessageBox( _( "Schematic netlist not available" ) );
|
||||
return;
|
||||
m_Parent->WriteNetListFile( NET_TYPE_SPICE, fn.GetFullPath(), netlist_opt, nullptr );
|
||||
wxExecute( commandLine, wxEXEC_ASYNC );
|
||||
}
|
||||
|
||||
wxExecute( commandLine, wxEXEC_ASYNC );
|
||||
}
|
||||
|
||||
|
||||
|
@ -578,10 +574,8 @@ bool NETLIST_DIALOG::TransferDataFromWindow()
|
|||
else
|
||||
m_Parent->SetNetListerCommand( wxEmptyString );
|
||||
|
||||
if( m_Parent->ReadyToNetlist( false, false ) )
|
||||
if( m_Parent->ReadyToNetlist( _( "Exporting netlist requires a fully annotated schematic." ) ) )
|
||||
m_Parent->WriteNetListFile( currPage->m_IdNetType, fullpath, netlist_opt, nullptr );
|
||||
else
|
||||
wxMessageBox( _( "Schematic netlist not available" ) );
|
||||
|
||||
WriteCurrentNetlistSetup();
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 1992-2018 jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 1992-2020 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 1992-2021 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -51,7 +51,7 @@ bool SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileNam
|
|||
// Ensure the netlist data is up to date:
|
||||
RecalculateConnections( NO_CLEANUP );
|
||||
|
||||
if( !ReadyToNetlist( false ) )
|
||||
if( !ReadyToNetlist( _( "Exporting netlist requires a fully annotated schematic." ) ) )
|
||||
return false;
|
||||
|
||||
bool res = true;
|
||||
|
@ -160,7 +160,7 @@ bool SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileNam
|
|||
}
|
||||
|
||||
|
||||
bool SCH_EDIT_FRAME::ReadyToNetlist( bool aSilent, bool aSilentAnnotate )
|
||||
bool SCH_EDIT_FRAME::ReadyToNetlist( const wxString& aAnnotateMessage )
|
||||
{
|
||||
// Ensure all power symbols have a valid reference
|
||||
Schematic().GetSheets().AnnotatePowerSymbols();
|
||||
|
@ -168,24 +168,11 @@ bool SCH_EDIT_FRAME::ReadyToNetlist( bool aSilent, bool aSilentAnnotate )
|
|||
// Components must be annotated
|
||||
if( CheckAnnotate( []( ERCE_T, const wxString&, SCH_REFERENCE*, SCH_REFERENCE* ) {} ) )
|
||||
{
|
||||
if( aSilentAnnotate )
|
||||
{
|
||||
AnnotateComponents( true, UNSORTED, INCREMENTAL_BY_REF, 0, false, false, true,
|
||||
NULL_REPORTER::GetInstance() );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( aSilent )
|
||||
return false;
|
||||
// Schematic must be annotated: call Annotate dialog and tell the user why.
|
||||
ModalAnnotate( aAnnotateMessage );
|
||||
|
||||
// Schematic must be annotated: call Annotate dialog and tell the user why.
|
||||
ModalAnnotate( _( "Exporting netlist requires a completely annotated schematic." ) );
|
||||
|
||||
if( CheckAnnotate( []( ERCE_T, const wxString&, SCH_REFERENCE*, SCH_REFERENCE* ) {} ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if( CheckAnnotate( []( ERCE_T, const wxString&, SCH_REFERENCE*, SCH_REFERENCE* ) {} ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
// Test duplicate sheet names:
|
||||
|
@ -193,7 +180,7 @@ bool SCH_EDIT_FRAME::ReadyToNetlist( bool aSilent, bool aSilentAnnotate )
|
|||
|
||||
if( erc.TestDuplicateSheetNames( false ) > 0 )
|
||||
{
|
||||
if( aSilent || !IsOK( this, _( "Error: duplicate sheet names. Continue?" ) ) )
|
||||
if( !IsOK( this, _( "Error: duplicate sheet names. Continue?" ) ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1027,7 +1027,7 @@ void SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event )
|
|||
wxFileName fn = Prj().AbsolutePath( Schematic().GetFileName() );
|
||||
fn.SetExt( NetlistFileExtension );
|
||||
|
||||
if( !ReadyToNetlist() )
|
||||
if( !ReadyToNetlist( _( "Assigning footprints requires a fully annotated schematic." ) ) )
|
||||
return;
|
||||
|
||||
try
|
||||
|
|
|
@ -369,11 +369,10 @@ public:
|
|||
*
|
||||
* - Test for some issues (missing or duplicate references and sheet names)
|
||||
*
|
||||
* @param aSilent is true if annotation error dialog should be skipped
|
||||
* @param aSilentAnnotate is true if components should be reannotated silently
|
||||
* @param aAnnotateMessage a message to put up in case annotation needs to be performed
|
||||
* @returns true if all is well (i.e. you can call WriteNetListFile next)
|
||||
*/
|
||||
bool ReadyToNetlist( bool aSilent = false, bool aSilentAnnotate = false );
|
||||
bool ReadyToNetlist( const wxString& aAnnotateMessage );
|
||||
|
||||
/**
|
||||
* Create a netlist file.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 Alexander Shuklin <Jasuramme@gmail.com>
|
||||
* Copyright (C) 2004-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -299,11 +299,10 @@ void BACK_ANNOTATE::checkForUnusedSymbols()
|
|||
++i;
|
||||
}
|
||||
|
||||
if( m_matchByReference && !m_frame->ReadyToNetlist() )
|
||||
if( m_matchByReference && !m_frame->ReadyToNetlist( _( "Re-linking footprints requires a fully "
|
||||
"annotated schematic." ) ) )
|
||||
{
|
||||
m_reporter.ReportTail( _( "Cannot relink footprints because schematic is not fully "
|
||||
"annotated." ),
|
||||
RPT_SEVERITY_ERROR );
|
||||
m_reporter.ReportTail( _( "Footprint re-linking cancelled by user." ), RPT_SEVERITY_ERROR );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -541,7 +541,7 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
|||
try
|
||||
{
|
||||
NETLIST netlist;
|
||||
FetchNetlistFromSchematic( netlist, NO_ANNOTATION );
|
||||
FetchNetlistFromSchematic( netlist, wxEmptyString );
|
||||
|
||||
BOARD_NETLIST_UPDATER updater( this, GetBoard() );
|
||||
updater.SetLookupByTimestamp( false );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2013-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2013-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
|
@ -1355,7 +1355,7 @@ bool PCB_EDIT_FRAME::ReannotateSchematic( std::string& aNetlist )
|
|||
}
|
||||
|
||||
|
||||
bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist, FETCH_NETLIST_MODE aMode )
|
||||
bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist, const wxString& aAnnotateMessage )
|
||||
{
|
||||
if( !TestStandalone() )
|
||||
{
|
||||
|
@ -1366,12 +1366,8 @@ bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist, FETCH_NETLIST
|
|||
}
|
||||
|
||||
Raise(); //Show
|
||||
std::string payload;
|
||||
|
||||
if( aMode == NO_ANNOTATION )
|
||||
payload = "no-annotate";
|
||||
else if( aMode == QUIET_ANNOTATION )
|
||||
payload = "quiet-annotate";
|
||||
std::string payload( aAnnotateMessage );
|
||||
|
||||
Kiway().ExpressMail( FRAME_SCH, MAIL_SCH_GET_NETLIST, payload, this );
|
||||
|
||||
|
|
|
@ -743,10 +743,11 @@ public:
|
|||
|
||||
/**
|
||||
* @param aNetlist a #NETLIST owned by the caller. This function fills it in.
|
||||
* @param aAnnotateMessage a message to be shown if annotation must be performed. If empty,
|
||||
* annotation will be skipped.
|
||||
* @return true if a netlist was fetched.
|
||||
*/
|
||||
enum FETCH_NETLIST_MODE { NO_ANNOTATION, QUIET_ANNOTATION, ANNOTATION_DIALOG };
|
||||
bool FetchNetlistFromSchematic( NETLIST& aNetlist, FETCH_NETLIST_MODE aMode );
|
||||
bool FetchNetlistFromSchematic( NETLIST& aNetlist, const wxString& aAnnotateMessage );
|
||||
|
||||
/**
|
||||
* Send a command to Eeschema to re-annotate the schematic.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014 CERN
|
||||
* Copyright (C) 2014-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2014-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -496,7 +496,8 @@ int BOARD_EDITOR_CONTROL::UpdatePCBFromSchematic( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
NETLIST netlist;
|
||||
|
||||
if( m_frame->FetchNetlistFromSchematic( netlist, PCB_EDIT_FRAME::ANNOTATION_DIALOG ) )
|
||||
if( m_frame->FetchNetlistFromSchematic( netlist, _( "Updating PCB requires a fully annotated "
|
||||
"schematic." ) ) )
|
||||
{
|
||||
DIALOG_UPDATE_PCB updateDialog( m_frame, &netlist );
|
||||
updateDialog.ShowModal();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2020-2021 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -154,8 +154,11 @@ void DRC_TOOL::RunTests( PROGRESS_REPORTER* aProgressReporter, bool aRefillZones
|
|||
|
||||
if( aTestFootprints && !Kiface().IsSingle() )
|
||||
{
|
||||
if( m_editFrame->FetchNetlistFromSchematic( netlist, PCB_EDIT_FRAME::ANNOTATION_DIALOG ) )
|
||||
if( m_editFrame->FetchNetlistFromSchematic( netlist, _( "Schematic parity tests require a "
|
||||
"fully annotated schematic." ) ) )
|
||||
{
|
||||
netlistFetched = true;
|
||||
}
|
||||
|
||||
if( m_drcDialog )
|
||||
m_drcDialog->Raise();
|
||||
|
|
Loading…
Reference in New Issue