mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Proper error reporting for Annotate dialog.
Also fixes: - forcing the annotation scope to "full schematic" when run as a prerequisite to Generate Netlist. - a long-standing bug where displaying extra items in a dialog would mess up the height of the HTML_REPORT_PANEL (becasue we were setting the html window's height rather than its parent flexgrid. - initializing the annotation radio buttons to safe values (full schematic and keep existing) Fixes: lp:1750062 * https://bugs.launchpad.net/kicad/+bug/1750062
This commit is contained in:
parent
cf5d93857f
commit
b3884669cf
@ -61,7 +61,7 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasMessage() const { return m_hasMessage; }
|
bool HasMessage() const override { return m_hasMessage; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ WX_HTML_REPORT_PANEL::~WX_HTML_REPORT_PANEL()
|
|||||||
|
|
||||||
void WX_HTML_REPORT_PANEL::MsgPanelSetMinSize( const wxSize& aMinSize )
|
void WX_HTML_REPORT_PANEL::MsgPanelSetMinSize( const wxSize& aMinSize )
|
||||||
{
|
{
|
||||||
m_htmlView->SetMinSize( aMinSize );
|
m_fgSizer->SetMinSize( aMinSize );
|
||||||
GetSizer()->SetSizeHints( this );
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,6 +126,18 @@ wxString WX_HTML_REPORT_PANEL::addHeader( const wxString& aBody )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int WX_HTML_REPORT_PANEL::Count( int severityMask )
|
||||||
|
{
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
for( const REPORT_LINE& reportLine : m_report )
|
||||||
|
if( severityMask & reportLine.severity )
|
||||||
|
count++;
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine )
|
wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine )
|
||||||
{
|
{
|
||||||
wxString retv;
|
wxString retv;
|
||||||
|
@ -58,6 +58,9 @@ public:
|
|||||||
///> clears the report panel
|
///> clears the report panel
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
|
///> return the number of messages matching the given severity mask.
|
||||||
|
int Count( int severityMask );
|
||||||
|
|
||||||
///> sets the frame label
|
///> sets the frame label
|
||||||
void SetLabel( const wxString& aLabel ) override;
|
void SetLabel( const wxString& aLabel ) override;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Nov 22 2017)
|
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
@ -13,18 +13,17 @@ WX_HTML_REPORT_PANEL_BASE::WX_HTML_REPORT_PANEL_BASE( wxWindow* parent, wxWindow
|
|||||||
{
|
{
|
||||||
m_box = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Output messages:") ), wxVERTICAL );
|
m_box = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Output messages:") ), wxVERTICAL );
|
||||||
|
|
||||||
wxFlexGridSizer* fgSizer4;
|
m_fgSizer = new wxFlexGridSizer( 2, 1, 0, 0 );
|
||||||
fgSizer4 = new wxFlexGridSizer( 2, 1, 0, 0 );
|
m_fgSizer->AddGrowableCol( 0 );
|
||||||
fgSizer4->AddGrowableCol( 0 );
|
m_fgSizer->AddGrowableRow( 0 );
|
||||||
fgSizer4->AddGrowableRow( 0 );
|
m_fgSizer->SetFlexibleDirection( wxBOTH );
|
||||||
fgSizer4->SetFlexibleDirection( wxBOTH );
|
m_fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||||
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
|
||||||
|
|
||||||
m_htmlView = new wxHtmlWindow( m_box->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
|
m_htmlView = new wxHtmlWindow( m_box->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
|
||||||
m_htmlView->SetFont( wxFont( 10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
|
m_htmlView->SetFont( wxFont( 10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
|
||||||
m_htmlView->SetMinSize( wxSize( -1,200 ) );
|
m_htmlView->SetMinSize( wxSize( -1,100 ) );
|
||||||
|
|
||||||
fgSizer4->Add( m_htmlView, 1, wxEXPAND, 5 );
|
m_fgSizer->Add( m_htmlView, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
wxFlexGridSizer* fgSizer3;
|
wxFlexGridSizer* fgSizer3;
|
||||||
fgSizer3 = new wxFlexGridSizer( 1, 7, 0, 0 );
|
fgSizer3 = new wxFlexGridSizer( 1, 7, 0, 0 );
|
||||||
@ -60,14 +59,14 @@ WX_HTML_REPORT_PANEL_BASE::WX_HTML_REPORT_PANEL_BASE( wxWindow* parent, wxWindow
|
|||||||
|
|
||||||
fgSizer3->Add( m_checkBoxShowActions, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
|
fgSizer3->Add( m_checkBoxShowActions, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
|
|
||||||
m_btnSaveReportToFile = new wxButton( m_box->GetStaticBox(), wxID_ANY, _("Save Report File..."), wxDefaultPosition, wxDefaultSize, 0 );
|
m_btnSaveReportToFile = new wxButton( m_box->GetStaticBox(), wxID_ANY, _("Save Report File"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
fgSizer3->Add( m_btnSaveReportToFile, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxLEFT, 5 );
|
fgSizer3->Add( m_btnSaveReportToFile, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxLEFT, 5 );
|
||||||
|
|
||||||
|
|
||||||
fgSizer4->Add( fgSizer3, 1, wxEXPAND, 5 );
|
m_fgSizer->Add( fgSizer3, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
m_box->Add( fgSizer4, 1, wxEXPAND|wxALL, 5 );
|
m_box->Add( m_fgSizer, 1, wxEXPAND|wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
this->SetSizer( m_box );
|
this->SetSizer( m_box );
|
||||||
|
@ -98,9 +98,9 @@
|
|||||||
<property name="growablerows">0</property>
|
<property name="growablerows">0</property>
|
||||||
<property name="hgap">0</property>
|
<property name="hgap">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">fgSizer4</property>
|
<property name="name">m_fgSizer</property>
|
||||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">protected</property>
|
||||||
<property name="rows">2</property>
|
<property name="rows">2</property>
|
||||||
<property name="vgap">0</property>
|
<property name="vgap">0</property>
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="0">
|
||||||
@ -140,7 +140,7 @@
|
|||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size">-1,200</property>
|
<property name="minimum_size">-1,100</property>
|
||||||
<property name="moveable">1</property>
|
<property name="moveable">1</property>
|
||||||
<property name="name">m_htmlView</property>
|
<property name="name">m_htmlView</property>
|
||||||
<property name="pane_border">1</property>
|
<property name="pane_border">1</property>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Nov 22 2017)
|
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
@ -36,6 +36,7 @@ class WX_HTML_REPORT_PANEL_BASE : public wxPanel
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxStaticBoxSizer* m_box;
|
wxStaticBoxSizer* m_box;
|
||||||
|
wxFlexGridSizer* m_fgSizer;
|
||||||
wxHtmlWindow* m_htmlView;
|
wxHtmlWindow* m_htmlView;
|
||||||
wxStaticText* m_staticText3;
|
wxStaticText* m_staticText3;
|
||||||
wxCheckBox* m_checkBoxShowAll;
|
wxCheckBox* m_checkBoxShowAll;
|
||||||
|
@ -45,6 +45,11 @@ REPORTER& WX_TEXT_CTRL_REPORTER::Report( const wxString& aText, REPORTER::SEVERI
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WX_TEXT_CTRL_REPORTER::HasMessage() const
|
||||||
|
{
|
||||||
|
return !m_textCtrl->IsEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
REPORTER& WX_STRING_REPORTER::Report( const wxString& aText, REPORTER::SEVERITY aSeverity )
|
REPORTER& WX_STRING_REPORTER::Report( const wxString& aText, REPORTER::SEVERITY aSeverity )
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( m_string != NULL, *this,
|
wxCHECK_MSG( m_string != NULL, *this,
|
||||||
@ -54,6 +59,11 @@ REPORTER& WX_STRING_REPORTER::Report( const wxString& aText, REPORTER::SEVERITY
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WX_STRING_REPORTER::HasMessage() const
|
||||||
|
{
|
||||||
|
return !m_string->IsEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
REPORTER& WX_HTML_PANEL_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
|
REPORTER& WX_HTML_PANEL_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( m_panel != NULL, *this,
|
wxCHECK_MSG( m_panel != NULL, *this,
|
||||||
@ -63,6 +73,11 @@ REPORTER& WX_HTML_PANEL_REPORTER::Report( const wxString& aText, SEVERITY aSever
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WX_HTML_PANEL_REPORTER::HasMessage() const
|
||||||
|
{
|
||||||
|
return m_panel->Count( REPORTER::RPT_ERROR | REPORTER::RPT_WARNING ) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
REPORTER& NULL_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
|
REPORTER& NULL_REPORTER::Report( const wxString& aText, SEVERITY aSeverity )
|
||||||
{
|
{
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -31,11 +31,31 @@
|
|||||||
#include <fctsys.h>
|
#include <fctsys.h>
|
||||||
#include <class_drawpanel.h>
|
#include <class_drawpanel.h>
|
||||||
#include <confirm.h>
|
#include <confirm.h>
|
||||||
|
#include <reporter.h>
|
||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
|
|
||||||
#include <sch_reference_list.h>
|
#include <sch_reference_list.h>
|
||||||
#include <class_library.h>
|
#include <class_library.h>
|
||||||
|
|
||||||
|
|
||||||
|
void mapExistingAnnotation( std::map<timestamp_t, wxString>& aMap )
|
||||||
|
{
|
||||||
|
SCH_SHEET_LIST sheets( g_RootSheet );
|
||||||
|
SCH_REFERENCE_LIST references;
|
||||||
|
|
||||||
|
sheets.GetComponents( references );
|
||||||
|
|
||||||
|
for( size_t i = 0; i < references.GetCount(); i++ )
|
||||||
|
{
|
||||||
|
SCH_COMPONENT* comp = references[ i ].GetComp();
|
||||||
|
wxString ref = comp->GetField( REFERENCE )->GetFullyQualifiedText();
|
||||||
|
|
||||||
|
if( !ref.Contains( wxT( "?" ) ) )
|
||||||
|
aMap[ comp->GetTimeStamp() ] = ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::DeleteAnnotation( bool aCurrentSheetOnly )
|
void SCH_EDIT_FRAME::DeleteAnnotation( bool aCurrentSheetOnly )
|
||||||
{
|
{
|
||||||
if( aCurrentSheetOnly )
|
if( aCurrentSheetOnly )
|
||||||
@ -62,7 +82,8 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
|
|||||||
ANNOTATE_OPTION_T aAlgoOption,
|
ANNOTATE_OPTION_T aAlgoOption,
|
||||||
bool aResetAnnotation,
|
bool aResetAnnotation,
|
||||||
bool aRepairTimestamps,
|
bool aRepairTimestamps,
|
||||||
bool aLockUnits )
|
bool aLockUnits,
|
||||||
|
REPORTER& aReporter )
|
||||||
{
|
{
|
||||||
SCH_REFERENCE_LIST references;
|
SCH_REFERENCE_LIST references;
|
||||||
|
|
||||||
@ -74,6 +95,9 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
|
|||||||
// Map of locked components
|
// Map of locked components
|
||||||
SCH_MULTI_UNIT_REFERENCE_MAP lockedComponents;
|
SCH_MULTI_UNIT_REFERENCE_MAP lockedComponents;
|
||||||
|
|
||||||
|
// Map of previous annotation for building info messages
|
||||||
|
std::map<timestamp_t, wxString> previousAnnotation;
|
||||||
|
|
||||||
// Test for and replace duplicate time stamps in components and sheets. Duplicate
|
// Test for and replace duplicate time stamps in components and sheets. Duplicate
|
||||||
// time stamps can happen with old schematics, schematic conversions, or manual
|
// time stamps can happen with old schematics, schematic conversions, or manual
|
||||||
// editing of files.
|
// editing of files.
|
||||||
@ -85,7 +109,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
|
|||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf( _( "%d duplicate time stamps were found and replaced." ), count );
|
msg.Printf( _( "%d duplicate time stamps were found and replaced." ), count );
|
||||||
DisplayInfoMessage( NULL, msg );
|
aReporter.Report( msg, REPORTER::RPT_INFO );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,6 +126,9 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Store previous annotations for building info messages
|
||||||
|
mapExistingAnnotation( previousAnnotation );
|
||||||
|
|
||||||
// If it is an annotation for all the components, reset previous annotation.
|
// If it is an annotation for all the components, reset previous annotation.
|
||||||
if( aResetAnnotation )
|
if( aResetAnnotation )
|
||||||
DeleteAnnotation( !aAnnotateSchematic );
|
DeleteAnnotation( !aAnnotateSchematic );
|
||||||
@ -158,21 +185,49 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
|
|||||||
references.Annotate( useSheetNum, idStep, lockedComponents );
|
references.Annotate( useSheetNum, idStep, lockedComponents );
|
||||||
references.UpdateAnnotation();
|
references.UpdateAnnotation();
|
||||||
|
|
||||||
wxArrayString errors;
|
for( size_t i = 0; i < references.GetCount(); i++ )
|
||||||
|
|
||||||
// Final control (just in case ... ).
|
|
||||||
if( CheckAnnotate( &errors, !aAnnotateSchematic ) )
|
|
||||||
{
|
{
|
||||||
|
SCH_COMPONENT* comp = references[ i ].GetComp();
|
||||||
|
wxString prevRef = previousAnnotation[ comp->GetTimeStamp() ];
|
||||||
|
wxString newRef = comp->GetField( REFERENCE )->GetFullyQualifiedText();
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
for( size_t i = 0; i < errors.GetCount(); i++ )
|
if( prevRef.Length() )
|
||||||
msg += errors[i];
|
{
|
||||||
|
if( newRef == prevRef )
|
||||||
|
continue;
|
||||||
|
|
||||||
// wxLogWarning is a cheap and dirty way to dump a potentially long list of
|
if( comp->GetUnitCount() > 1 )
|
||||||
// strings to a dialog that can be saved to a file. This should be replaced
|
msg.Printf( _( "Updated %s (unit %d) from %s to %s" ),
|
||||||
// by a more elegant solution.
|
GetChars( comp->GetField( VALUE )->GetShownText() ),
|
||||||
wxLogWarning( msg );
|
comp->GetUnit(),
|
||||||
|
GetChars( prevRef ),
|
||||||
|
GetChars( newRef ) );
|
||||||
|
else
|
||||||
|
msg.Printf( _( "Updated %s from %s to %s" ),
|
||||||
|
GetChars( comp->GetField( VALUE )->GetShownText() ),
|
||||||
|
GetChars( prevRef ),
|
||||||
|
GetChars( newRef ) );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( comp->GetUnitCount() > 1 )
|
||||||
|
msg.Printf( _( "Annotated %s (unit %d) as %s" ),
|
||||||
|
GetChars( comp->GetField( VALUE )->GetShownText() ),
|
||||||
|
comp->GetUnit(),
|
||||||
|
GetChars( newRef ) );
|
||||||
|
else
|
||||||
|
msg.Printf( _( "Annotated %s as %s" ),
|
||||||
|
GetChars( comp->GetField( VALUE )->GetShownText() ),
|
||||||
|
GetChars( newRef ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
aReporter.Report( msg, REPORTER::RPT_INFO );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Final control (just in case ... ).
|
||||||
|
if( !CheckAnnotate( aReporter, !aAnnotateSchematic ) )
|
||||||
|
aReporter.Report( _( "Annotation complete." ), REPORTER::RPT_INFO );
|
||||||
|
|
||||||
OnModify();
|
OnModify();
|
||||||
|
|
||||||
@ -184,7 +239,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SCH_EDIT_FRAME::CheckAnnotate( wxArrayString* aMessageList, bool aOneSheetOnly )
|
int SCH_EDIT_FRAME::CheckAnnotate( REPORTER& aReporter, bool aOneSheetOnly )
|
||||||
{
|
{
|
||||||
// build the screen list
|
// build the screen list
|
||||||
SCH_SHEET_LIST sheetList( g_RootSheet );
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
@ -196,5 +251,5 @@ int SCH_EDIT_FRAME::CheckAnnotate( wxArrayString* aMessageList, bool aOneSheetOn
|
|||||||
else
|
else
|
||||||
m_CurrentSheet->GetComponents( componentsList );
|
m_CurrentSheet->GetComponents( componentsList );
|
||||||
|
|
||||||
return componentsList.CheckAnnotation( aMessageList );
|
return componentsList.CheckAnnotation( aReporter );
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
#include <sch_reference_list.h>
|
#include <sch_reference_list.h>
|
||||||
#include <sch_component.h>
|
#include <sch_component.h>
|
||||||
|
#include <reporter.h>
|
||||||
|
|
||||||
|
|
||||||
//#define USE_OLD_ALGO
|
//#define USE_OLD_ALGO
|
||||||
@ -472,7 +473,7 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SCH_REFERENCE_LIST::CheckAnnotation( wxArrayString* aMessageList )
|
int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
wxString tmp;
|
wxString tmp;
|
||||||
@ -512,9 +513,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( wxArrayString* aMessageList )
|
|||||||
GetChars( tmp ) );
|
GetChars( tmp ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aMessageList )
|
aReporter.Report( msg, REPORTER::RPT_WARNING );
|
||||||
aMessageList->Add( msg + wxT( "\n" ) );
|
|
||||||
|
|
||||||
error++;
|
error++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -536,9 +535,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( wxArrayString* aMessageList )
|
|||||||
componentFlatList[ii].m_Unit,
|
componentFlatList[ii].m_Unit,
|
||||||
componentFlatList[ii].GetLibPart()->GetUnitCount() );
|
componentFlatList[ii].GetLibPart()->GetUnitCount() );
|
||||||
|
|
||||||
if( aMessageList )
|
aReporter.Report( msg, REPORTER::RPT_ERROR );
|
||||||
aMessageList->Add( msg );
|
|
||||||
|
|
||||||
error++;
|
error++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -582,9 +579,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( wxArrayString* aMessageList )
|
|||||||
GetChars( tmp ) );
|
GetChars( tmp ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aMessageList )
|
aReporter.Report( msg, REPORTER::RPT_ERROR );
|
||||||
aMessageList->Add( msg );
|
|
||||||
|
|
||||||
error++;
|
error++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -614,9 +609,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( wxArrayString* aMessageList )
|
|||||||
GetChars( tmp ) );
|
GetChars( tmp ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aMessageList )
|
aReporter.Report( msg, REPORTER::RPT_ERROR );
|
||||||
aMessageList->Add( msg );
|
|
||||||
|
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -637,9 +630,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( wxArrayString* aMessageList )
|
|||||||
componentFlatList[next].m_Unit ) ),
|
componentFlatList[next].m_Unit ) ),
|
||||||
GetChars( componentFlatList[next].m_Value->GetText() ) );
|
GetChars( componentFlatList[next].m_Value->GetText() ) );
|
||||||
|
|
||||||
if( aMessageList )
|
aReporter.Report( msg, REPORTER::RPT_ERROR );
|
||||||
aMessageList->Add( msg + wxT( "\n" ));
|
|
||||||
|
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -666,9 +657,7 @@ int SCH_REFERENCE_LIST::CheckAnnotation( wxArrayString* aMessageList )
|
|||||||
GetChars( componentFlatList[ii + 1].GetRef() ),
|
GetChars( componentFlatList[ii + 1].GetRef() ),
|
||||||
componentFlatList[ii + 1].m_NumRef );
|
componentFlatList[ii + 1].m_NumRef );
|
||||||
|
|
||||||
if( aMessageList )
|
aReporter.Report( msg, REPORTER::RPT_WARNING );
|
||||||
aMessageList->Add( msg + wxT( "\n" ));
|
|
||||||
|
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,11 +36,13 @@
|
|||||||
#include <invoke_sch_dialog.h>
|
#include <invoke_sch_dialog.h>
|
||||||
#include <dialog_annotate_base.h>
|
#include <dialog_annotate_base.h>
|
||||||
#include <kiface_i.h>
|
#include <kiface_i.h>
|
||||||
|
#include <wx_html_report_panel.h>
|
||||||
|
|
||||||
#define KEY_ANNOTATE_SORT_OPTION wxT( "AnnotateSortOption" )
|
#define KEY_ANNOTATE_SORT_OPTION wxT( "AnnotateSortOption" )
|
||||||
#define KEY_ANNOTATE_ALGO_OPTION wxT( "AnnotateAlgoOption" )
|
#define KEY_ANNOTATE_ALGO_OPTION wxT( "AnnotateAlgoOption" )
|
||||||
#define KEY_ANNOTATE_KEEP_OPEN_OPTION wxT( "AnnotateKeepOpenOption" )
|
#define KEY_ANNOTATE_KEEP_OPEN_OPTION wxT( "AnnotateKeepOpenOption" )
|
||||||
#define KEY_ANNOTATE_ASK_FOR_CONFIRMATION wxT( "AnnotateRequestConfirmation" )
|
#define KEY_ANNOTATE_ASK_FOR_CONFIRMATION wxT( "AnnotateRequestConfirmation" )
|
||||||
|
#define KEY_ANNOTATE_MESSAGES_FILTER wxT( "AnnotateFilterMsg" )
|
||||||
|
|
||||||
|
|
||||||
class wxConfigBase;
|
class wxConfigBase;
|
||||||
@ -53,7 +55,7 @@ class DIALOG_ANNOTATE: public DIALOG_ANNOTATE_BASE
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent, const wxString& message );
|
DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent, const wxString& message );
|
||||||
|
~DIALOG_ANNOTATE();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SCH_EDIT_FRAME* m_Parent;
|
SCH_EDIT_FRAME* m_Parent;
|
||||||
@ -61,7 +63,6 @@ private:
|
|||||||
|
|
||||||
/// Initialises member variables
|
/// Initialises member variables
|
||||||
void InitValues();
|
void InitValues();
|
||||||
void OnCancelClick( wxCommandEvent& event ) override;
|
|
||||||
void OnClearAnnotationCmpClick( wxCommandEvent& event ) override;
|
void OnClearAnnotationCmpClick( wxCommandEvent& event ) override;
|
||||||
void OnApplyClick( wxCommandEvent& event ) override;
|
void OnApplyClick( wxCommandEvent& event ) override;
|
||||||
|
|
||||||
@ -74,15 +75,14 @@ private:
|
|||||||
* Function GetSortOrder
|
* Function GetSortOrder
|
||||||
* @return 0 if annotation by X position,
|
* @return 0 if annotation by X position,
|
||||||
* 1 if annotation by Y position,
|
* 1 if annotation by Y position,
|
||||||
* 2 if annotation by value
|
|
||||||
*/
|
*/
|
||||||
int GetSortOrder();
|
int GetSortOrder();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetAnnotateAlgo
|
* Function GetAnnotateAlgo
|
||||||
* @return 0 if annotation using first not used Id value
|
* @return 0 if annotation using first free Id value
|
||||||
* 1 if annotation using first not used Id value inside sheet num * 100 to sheet num * 100 + 99
|
* 1 for first free Id value inside sheet num * 100 to sheet num * 100 + 99
|
||||||
* 2 if annotation using first nhot used Id value inside sheet num * 1000 to sheet num * 1000 + 999
|
* 2 for first free Id value inside sheet num * 1000 to sheet num * 1000 + 999
|
||||||
*/
|
*/
|
||||||
int GetAnnotateAlgo();
|
int GetAnnotateAlgo();
|
||||||
|
|
||||||
@ -102,8 +102,16 @@ DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent, const wxString& messag
|
|||||||
: DIALOG_ANNOTATE_BASE( parent )
|
: DIALOG_ANNOTATE_BASE( parent )
|
||||||
{
|
{
|
||||||
m_Parent = parent;
|
m_Parent = parent;
|
||||||
|
|
||||||
|
if( !message.IsEmpty() )
|
||||||
|
{
|
||||||
m_userMessage->SetLabelText( message );
|
m_userMessage->SetLabelText( message );
|
||||||
m_userMessage->Show( !message.empty() );
|
m_userMessage->Show( true );
|
||||||
|
|
||||||
|
m_rbScope->Enable( false );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_MessageWindow->SetLabel( _( "Annotation Messages:" ) );
|
||||||
|
|
||||||
InitValues();
|
InitValues();
|
||||||
Layout();
|
Layout();
|
||||||
@ -113,14 +121,27 @@ DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent, const wxString& messag
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DIALOG_ANNOTATE::~DIALOG_ANNOTATE()
|
||||||
|
{
|
||||||
|
m_Config->Write( KEY_ANNOTATE_SORT_OPTION, GetSortOrder() );
|
||||||
|
m_Config->Write( KEY_ANNOTATE_ALGO_OPTION, m_rbNumbering->GetSelection() );
|
||||||
|
m_Config->Write( KEY_ANNOTATE_KEEP_OPEN_OPTION, GetAnnotateKeepOpen() );
|
||||||
|
m_Config->Write( KEY_ANNOTATE_ASK_FOR_CONFIRMATION, GetAnnotateAskForConfirmation() );
|
||||||
|
|
||||||
|
m_Config->Write( KEY_ANNOTATE_MESSAGES_FILTER,
|
||||||
|
(long) m_MessageWindow->GetVisibleSeverities() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_ANNOTATE::InitValues()
|
void DIALOG_ANNOTATE::InitValues()
|
||||||
{
|
{
|
||||||
m_Config = Kiface().KifaceSettings();
|
m_Config = Kiface().KifaceSettings();
|
||||||
|
|
||||||
if( m_Config )
|
|
||||||
{
|
|
||||||
long option;
|
long option;
|
||||||
|
|
||||||
|
// These are always reset to attempt to keep the user out of trouble...
|
||||||
|
m_rbScope->SetSelection( 0 );
|
||||||
|
m_rbOptions->SetSelection( 0 );
|
||||||
|
|
||||||
m_Config->Read( KEY_ANNOTATE_SORT_OPTION, &option, 0L );
|
m_Config->Read( KEY_ANNOTATE_SORT_OPTION, &option, 0L );
|
||||||
switch( option )
|
switch( option )
|
||||||
{
|
{
|
||||||
@ -132,41 +153,25 @@ void DIALOG_ANNOTATE::InitValues()
|
|||||||
case 1:
|
case 1:
|
||||||
m_rbSortBy_Y_Position->SetValue( 1 );
|
m_rbSortBy_Y_Position->SetValue( 1 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
|
||||||
m_rbUseIncremental->SetValue( 1 );
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Config->Read( KEY_ANNOTATE_ALGO_OPTION, &option, 0L );
|
m_Config->Read( KEY_ANNOTATE_ALGO_OPTION, &option, 0L );
|
||||||
switch( option )
|
m_rbNumbering->SetSelection( option );
|
||||||
{
|
|
||||||
default:
|
|
||||||
case 0:
|
|
||||||
m_rbUseIncremental->SetValue( 1 );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
m_rbUseSheetNum->SetValue( 1 );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
m_rbStartSheetNumLarge->SetValue( 1 );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
m_Config->Read( KEY_ANNOTATE_KEEP_OPEN_OPTION, &option, 0L );
|
m_Config->Read( KEY_ANNOTATE_KEEP_OPEN_OPTION, &option, 0L );
|
||||||
m_cbKeepDlgOpen->SetValue( option );
|
m_cbKeepDlgOpen->SetValue( option );
|
||||||
|
|
||||||
|
|
||||||
m_Config->Read( KEY_ANNOTATE_ASK_FOR_CONFIRMATION, &option, 1L );
|
m_Config->Read( KEY_ANNOTATE_ASK_FOR_CONFIRMATION, &option, 1L );
|
||||||
m_cbAskForConfirmation->SetValue( option );
|
m_cbAskForConfirmation->SetValue( option );
|
||||||
}
|
|
||||||
|
|
||||||
annotate_down_right_bitmap->SetBitmap( KiBitmap( annotate_down_right_xpm ) );
|
annotate_down_right_bitmap->SetBitmap( KiBitmap( annotate_down_right_xpm ) );
|
||||||
annotate_right_down_bitmap->SetBitmap( KiBitmap( annotate_right_down_xpm ) );
|
annotate_right_down_bitmap->SetBitmap( KiBitmap( annotate_right_down_xpm ) );
|
||||||
|
|
||||||
|
int severities = m_Config->Read( KEY_ANNOTATE_MESSAGES_FILTER, -1l );
|
||||||
|
m_MessageWindow->SetVisibleSeverities( severities );
|
||||||
|
|
||||||
|
m_MessageWindow->MsgPanelSetMinSize( wxSize( -1, 160 ) );
|
||||||
|
|
||||||
m_btnApply->SetDefault();
|
m_btnApply->SetDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,14 +181,6 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
|
|||||||
int response;
|
int response;
|
||||||
wxString message;
|
wxString message;
|
||||||
|
|
||||||
if( m_Config )
|
|
||||||
{
|
|
||||||
m_Config->Write( KEY_ANNOTATE_SORT_OPTION, GetSortOrder() );
|
|
||||||
m_Config->Write( KEY_ANNOTATE_ALGO_OPTION, GetAnnotateAlgo() );
|
|
||||||
m_Config->Write( KEY_ANNOTATE_KEEP_OPEN_OPTION, GetAnnotateKeepOpen() );
|
|
||||||
m_Config->Write( KEY_ANNOTATE_ASK_FOR_CONFIRMATION, GetAnnotateAskForConfirmation() );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Display a message info if we always ask for confirmation
|
// Display a message info if we always ask for confirmation
|
||||||
// or if a reset of the previous annotation is asked.
|
// or if a reset of the previous annotation is asked.
|
||||||
bool promptUser = GetAnnotateAskForConfirmation();
|
bool promptUser = GetAnnotateAskForConfirmation();
|
||||||
@ -218,22 +215,25 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_MessageWindow->Clear();
|
||||||
|
REPORTER& reporter = m_MessageWindow->Reporter();
|
||||||
|
m_MessageWindow->SetLazyUpdate( true ); // Don't update after each message
|
||||||
|
|
||||||
m_Parent->AnnotateComponents( GetLevel(), (ANNOTATE_ORDER_T) GetSortOrder(),
|
m_Parent->AnnotateComponents( GetLevel(), (ANNOTATE_ORDER_T) GetSortOrder(),
|
||||||
(ANNOTATE_OPTION_T) GetAnnotateAlgo(),
|
(ANNOTATE_OPTION_T) GetAnnotateAlgo(),
|
||||||
GetResetItems() , true, GetLockUnits() );
|
GetResetItems() , true, GetLockUnits(), reporter );
|
||||||
|
|
||||||
|
m_MessageWindow->Flush(); // Now update to show all messages
|
||||||
|
|
||||||
m_Parent->GetCanvas()->Refresh();
|
m_Parent->GetCanvas()->Refresh();
|
||||||
|
|
||||||
m_btnClear->Enable();
|
m_btnClear->Enable();
|
||||||
|
|
||||||
if( !GetAnnotateKeepOpen() )
|
if( !GetAnnotateKeepOpen() && !reporter.HasMessage() )
|
||||||
{
|
{
|
||||||
if( IsModal() )
|
// Close the dialog by calling the default dialog handler for a wxID_OK event
|
||||||
EndModal( wxID_OK );
|
event.SetId( wxID_OK );
|
||||||
else
|
event.Skip();
|
||||||
{
|
|
||||||
SetReturnCode( wxID_OK );
|
|
||||||
this->Show( false );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,61 +259,50 @@ void DIALOG_ANNOTATE::OnClearAnnotationCmpClick( wxCommandEvent& event )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_ANNOTATE::OnCancelClick( wxCommandEvent& event )
|
|
||||||
{
|
|
||||||
if( IsModal() )
|
|
||||||
EndModal( wxID_CANCEL );
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetReturnCode( wxID_CANCEL );
|
|
||||||
this->Show( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool DIALOG_ANNOTATE::GetLevel()
|
bool DIALOG_ANNOTATE::GetLevel()
|
||||||
{
|
{
|
||||||
return m_rbEntireSchematic->GetValue();
|
return m_rbScope->GetSelection() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DIALOG_ANNOTATE::GetResetItems()
|
bool DIALOG_ANNOTATE::GetResetItems()
|
||||||
{
|
{
|
||||||
return m_rbResetAnnotation->GetValue() || m_rbResetButLock->GetValue();
|
return m_rbOptions->GetSelection() >= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DIALOG_ANNOTATE::GetLockUnits()
|
bool DIALOG_ANNOTATE::GetLockUnits()
|
||||||
{
|
{
|
||||||
return m_rbResetButLock->GetValue();
|
return m_rbOptions->GetSelection() == 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DIALOG_ANNOTATE::GetSortOrder()
|
int DIALOG_ANNOTATE::GetSortOrder()
|
||||||
{
|
{
|
||||||
if( m_rbSortBy_X_Position->GetValue() )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if( m_rbSortBy_Y_Position->GetValue() )
|
if( m_rbSortBy_Y_Position->GetValue() )
|
||||||
return 1;
|
return 1;
|
||||||
|
else
|
||||||
return 2;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DIALOG_ANNOTATE::GetAnnotateAlgo()
|
int DIALOG_ANNOTATE::GetAnnotateAlgo()
|
||||||
{
|
{
|
||||||
if( m_rbUseIncremental->GetValue() )
|
return m_rbNumbering->GetSelection();
|
||||||
return 0;
|
|
||||||
|
|
||||||
if( m_rbUseSheetNum->GetValue() )
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller, const wxString& message )
|
void InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller )
|
||||||
{
|
{
|
||||||
DIALOG_ANNOTATE dlg( aCaller, message );
|
DIALOG_ANNOTATE dlg( aCaller, wxT( "" ) );
|
||||||
|
|
||||||
|
dlg.ShowModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller, const wxString& aMessage )
|
||||||
|
{
|
||||||
|
DIALOG_ANNOTATE dlg( aCaller, aMessage );
|
||||||
|
|
||||||
return dlg.ShowModal();
|
return dlg.ShowModal();
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version May 6 2016)
|
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "wx_html_report_panel.h"
|
||||||
|
|
||||||
#include "dialog_annotate_base.h"
|
#include "dialog_annotate_base.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@ -22,47 +24,25 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
|
|||||||
m_userMessage = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_userMessage = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_userMessage->Wrap( 1 );
|
m_userMessage->Wrap( 1 );
|
||||||
m_userMessage->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
m_userMessage->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
||||||
|
m_userMessage->Hide();
|
||||||
|
|
||||||
bupperSizer->Add( m_userMessage, 0, wxALL, 5 );
|
bupperSizer->Add( m_userMessage, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_staticTextScope = new wxStaticText( this, wxID_ANY, _("Scope"), wxDefaultPosition, wxDefaultSize, 0 );
|
wxFlexGridSizer* fgSizer1;
|
||||||
m_staticTextScope->Wrap( -1 );
|
fgSizer1 = new wxFlexGridSizer( 2, 2, 0, 0 );
|
||||||
m_staticTextScope->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
fgSizer1->AddGrowableCol( 0 );
|
||||||
|
fgSizer1->AddGrowableCol( 1 );
|
||||||
|
fgSizer1->SetFlexibleDirection( wxBOTH );
|
||||||
|
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||||
|
|
||||||
bupperSizer->Add( m_staticTextScope, 0, wxALL, 6 );
|
wxString m_rbScopeChoices[] = { _("Use the entire schematic"), _("Use the current page only") };
|
||||||
|
int m_rbScopeNChoices = sizeof( m_rbScopeChoices ) / sizeof( wxString );
|
||||||
|
m_rbScope = new wxRadioBox( this, wxID_ANY, _("Scope"), wxDefaultPosition, wxDefaultSize, m_rbScopeNChoices, m_rbScopeChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
|
m_rbScope->SetSelection( 0 );
|
||||||
|
fgSizer1->Add( m_rbScope, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bscopeOptSizer;
|
wxStaticBoxSizer* sbSizer1;
|
||||||
bscopeOptSizer = new wxBoxSizer( wxVERTICAL );
|
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Order") ), wxVERTICAL );
|
||||||
|
|
||||||
m_rbEntireSchematic = new wxRadioButton( this, ID_ENTIRE_SCHEMATIC, _("Use the &entire schematic"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
|
|
||||||
bscopeOptSizer->Add( m_rbEntireSchematic, 0, wxALL, 3 );
|
|
||||||
|
|
||||||
m_rbCurrPage = new wxRadioButton( this, ID_CURRENT_PAGE, _("Use the current &page only"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
bscopeOptSizer->Add( m_rbCurrPage, 0, wxALL, 3 );
|
|
||||||
|
|
||||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
|
||||||
bscopeOptSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
|
||||||
|
|
||||||
m_rbKeepAnnotation = new wxRadioButton( this, ID_KEEP_ANNOTATION, _("&Keep existing annotation"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
|
|
||||||
bscopeOptSizer->Add( m_rbKeepAnnotation, 0, wxALL, 3 );
|
|
||||||
|
|
||||||
m_rbResetAnnotation = new wxRadioButton( this, ID_RESET_ANNOTATION, _("&Reset existing annotation"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
bscopeOptSizer->Add( m_rbResetAnnotation, 0, wxALL, 3 );
|
|
||||||
|
|
||||||
m_rbResetButLock = new wxRadioButton( this, ID_RESET_BUT_LOCK, _("R&eset, but do not swap any annotated multi-unit parts"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
bscopeOptSizer->Add( m_rbResetButLock, 0, wxALL, 3 );
|
|
||||||
|
|
||||||
|
|
||||||
bupperSizer->Add( bscopeOptSizer, 0, wxEXPAND|wxLEFT, 25 );
|
|
||||||
|
|
||||||
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
|
||||||
bupperSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
|
|
||||||
|
|
||||||
m_staticTextOrder = new wxStaticText( this, wxID_ANY, _("Annotation Order"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
m_staticTextOrder->Wrap( -1 );
|
|
||||||
m_staticTextOrder->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
|
||||||
|
|
||||||
bupperSizer->Add( m_staticTextOrder, 0, wxALL, 6 );
|
|
||||||
|
|
||||||
wxBoxSizer* b_orderOptSizer;
|
wxBoxSizer* b_orderOptSizer;
|
||||||
b_orderOptSizer = new wxBoxSizer( wxVERTICAL );
|
b_orderOptSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
@ -70,104 +50,56 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
|
|||||||
wxBoxSizer* bSizerXpos;
|
wxBoxSizer* bSizerXpos;
|
||||||
bSizerXpos = new wxBoxSizer( wxHORIZONTAL );
|
bSizerXpos = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
m_rbSortBy_X_Position = new wxRadioButton( this, ID_SORT_BY_X_POSITION, _("Sort components by &X position"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
|
m_rbSortBy_X_Position = new wxRadioButton( sbSizer1->GetStaticBox(), ID_SORT_BY_X_POSITION, _("Sort components by &X position"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
|
||||||
bSizerXpos->Add( m_rbSortBy_X_Position, 0, wxALL, 3 );
|
bSizerXpos->Add( m_rbSortBy_X_Position, 0, wxBOTTOM|wxTOP, 3 );
|
||||||
|
|
||||||
|
|
||||||
bSizerXpos->Add( 0, 0, 1, wxEXPAND, 5 );
|
bSizerXpos->Add( 0, 0, 1, 0, 5 );
|
||||||
|
|
||||||
annotate_down_right_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
annotate_down_right_bitmap = new wxStaticBitmap( sbSizer1->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizerXpos->Add( annotate_down_right_bitmap, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 12 );
|
bSizerXpos->Add( annotate_down_right_bitmap, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||||
|
|
||||||
|
|
||||||
b_orderOptSizer->Add( bSizerXpos, 0, wxEXPAND|wxRIGHT, 5 );
|
b_orderOptSizer->Add( bSizerXpos, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bSizerYpos;
|
wxBoxSizer* bSizerYpos;
|
||||||
bSizerYpos = new wxBoxSizer( wxHORIZONTAL );
|
bSizerYpos = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
m_rbSortBy_Y_Position = new wxRadioButton( this, ID_SORT_BY_Y_POSITION, _("Sort components by &Y position"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_rbSortBy_Y_Position = new wxRadioButton( sbSizer1->GetStaticBox(), ID_SORT_BY_Y_POSITION, _("Sort components by &Y position"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizerYpos->Add( m_rbSortBy_Y_Position, 0, wxALL, 3 );
|
bSizerYpos->Add( m_rbSortBy_Y_Position, 0, wxBOTTOM|wxTOP, 3 );
|
||||||
|
|
||||||
|
|
||||||
bSizerYpos->Add( 0, 0, 1, wxEXPAND, 5 );
|
bSizerYpos->Add( 0, 0, 1, 0, 5 );
|
||||||
|
|
||||||
annotate_right_down_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
annotate_right_down_bitmap = new wxStaticBitmap( sbSizer1->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizerYpos->Add( annotate_right_down_bitmap, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 12 );
|
bSizerYpos->Add( annotate_right_down_bitmap, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||||
|
|
||||||
|
|
||||||
b_orderOptSizer->Add( bSizerYpos, 0, wxEXPAND|wxRIGHT, 5 );
|
b_orderOptSizer->Add( bSizerYpos, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bupperSizer->Add( b_orderOptSizer, 0, wxEXPAND|wxLEFT, 25 );
|
sbSizer1->Add( b_orderOptSizer, 0, wxEXPAND|wxLEFT, 5 );
|
||||||
|
|
||||||
m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
|
||||||
bupperSizer->Add( m_staticline5, 0, wxEXPAND | wxALL, 5 );
|
|
||||||
|
|
||||||
wxBoxSizer* bSizerAnnotAlgo;
|
|
||||||
bSizerAnnotAlgo = new wxBoxSizer( wxVERTICAL );
|
|
||||||
|
|
||||||
m_staticTextAnnotateAlgo = new wxStaticText( this, wxID_ANY, _("Annotation Choice"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
m_staticTextAnnotateAlgo->Wrap( -1 );
|
|
||||||
m_staticTextAnnotateAlgo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
|
||||||
|
|
||||||
bSizerAnnotAlgo->Add( m_staticTextAnnotateAlgo, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
|
||||||
|
|
||||||
wxBoxSizer* bSizer1AlgoChoice;
|
|
||||||
bSizer1AlgoChoice = new wxBoxSizer( wxVERTICAL );
|
|
||||||
|
|
||||||
wxBoxSizer* bSizerChoiceInc;
|
|
||||||
bSizerChoiceInc = new wxBoxSizer( wxHORIZONTAL );
|
|
||||||
|
|
||||||
m_rbUseIncremental = new wxRadioButton( this, ID_SORT_BY_X_POSITION, _("Use first free number in schematic"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
|
|
||||||
bSizerChoiceInc->Add( m_rbUseIncremental, 0, wxALL, 3 );
|
|
||||||
|
|
||||||
|
|
||||||
bSizerChoiceInc->Add( 0, 0, 1, wxEXPAND, 5 );
|
fgSizer1->Add( sbSizer1, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
wxString m_rbOptionsChoices[] = { _("Keep existing annotations"), _("Reset existing annotations"), _("Reset, but keep order of multi-unit parts") };
|
||||||
|
int m_rbOptionsNChoices = sizeof( m_rbOptionsChoices ) / sizeof( wxString );
|
||||||
|
m_rbOptions = new wxRadioBox( this, wxID_ANY, _("Options"), wxDefaultPosition, wxDefaultSize, m_rbOptionsNChoices, m_rbOptionsChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
|
m_rbOptions->SetSelection( 0 );
|
||||||
|
fgSizer1->Add( m_rbOptions, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
wxString m_rbNumberingChoices[] = { _("Use first free number in schematic"), _("First free above sheet number * 100"), _("First free above sheet number * 1000") };
|
||||||
|
int m_rbNumberingNChoices = sizeof( m_rbNumberingChoices ) / sizeof( wxString );
|
||||||
|
m_rbNumbering = new wxRadioBox( this, wxID_ANY, _("Numbering"), wxDefaultPosition, wxDefaultSize, m_rbNumberingNChoices, m_rbNumberingChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
|
m_rbNumbering->SetSelection( 1 );
|
||||||
|
fgSizer1->Add( m_rbNumbering, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bSizer1AlgoChoice->Add( bSizerChoiceInc, 0, wxEXPAND|wxRIGHT, 5 );
|
bupperSizer->Add( fgSizer1, 0, wxBOTTOM|wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bSizerChoiceIncBySheet;
|
|
||||||
bSizerChoiceIncBySheet = new wxBoxSizer( wxHORIZONTAL );
|
|
||||||
|
|
||||||
m_rbUseSheetNum = new wxRadioButton( this, wxID_ANY, _("Start to sheet number*100 and use first free number"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
bSizerChoiceIncBySheet->Add( m_rbUseSheetNum, 0, wxALL, 3 );
|
|
||||||
|
|
||||||
|
|
||||||
bSizerChoiceIncBySheet->Add( 0, 0, 1, wxEXPAND, 5 );
|
|
||||||
|
|
||||||
|
|
||||||
bSizer1AlgoChoice->Add( bSizerChoiceIncBySheet, 1, wxEXPAND, 5 );
|
|
||||||
|
|
||||||
wxBoxSizer* bSizerChoiceIncBySheetLarge;
|
|
||||||
bSizerChoiceIncBySheetLarge = new wxBoxSizer( wxHORIZONTAL );
|
|
||||||
|
|
||||||
m_rbStartSheetNumLarge = new wxRadioButton( this, wxID_ANY, _("Start to sheet number*1000 and use first free number"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
bSizerChoiceIncBySheetLarge->Add( m_rbStartSheetNumLarge, 0, wxALL, 3 );
|
|
||||||
|
|
||||||
|
|
||||||
bSizerChoiceIncBySheetLarge->Add( 0, 0, 1, wxEXPAND, 5 );
|
|
||||||
|
|
||||||
|
|
||||||
bSizer1AlgoChoice->Add( bSizerChoiceIncBySheetLarge, 1, wxEXPAND, 5 );
|
|
||||||
|
|
||||||
|
|
||||||
bSizerAnnotAlgo->Add( bSizer1AlgoChoice, 1, wxEXPAND|wxLEFT, 25 );
|
|
||||||
|
|
||||||
|
|
||||||
bupperSizer->Add( bSizerAnnotAlgo, 0, wxEXPAND|wxRIGHT, 5 );
|
|
||||||
|
|
||||||
m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
|
||||||
bupperSizer->Add( m_staticline4, 0, wxEXPAND | wxALL, 5 );
|
|
||||||
|
|
||||||
wxBoxSizer* bSizerDldOptions;
|
wxBoxSizer* bSizerDldOptions;
|
||||||
bSizerDldOptions = new wxBoxSizer( wxVERTICAL );
|
bSizerDldOptions = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
m_staticTextDlgOpts = new wxStaticText( this, wxID_ANY, _("Dialog"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
m_staticTextDlgOpts->Wrap( -1 );
|
|
||||||
m_staticTextDlgOpts->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
|
|
||||||
|
|
||||||
bSizerDldOptions->Add( m_staticTextDlgOpts, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
|
||||||
|
|
||||||
wxBoxSizer* bSizerDlgChoices;
|
wxBoxSizer* bSizerDlgChoices;
|
||||||
bSizerDlgChoices = new wxBoxSizer( wxVERTICAL );
|
bSizerDlgChoices = new wxBoxSizer( wxVERTICAL );
|
||||||
@ -198,28 +130,31 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
|
|||||||
bSizerDlgChoices->Add( bSizerChoiceSilentMode, 1, wxEXPAND, 5 );
|
bSizerDlgChoices->Add( bSizerChoiceSilentMode, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bSizerDldOptions->Add( bSizerDlgChoices, 1, wxEXPAND|wxLEFT, 25 );
|
bSizerDldOptions->Add( bSizerDlgChoices, 1, wxLEFT, 5 );
|
||||||
|
|
||||||
m_staticline41 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
|
||||||
bSizerDldOptions->Add( m_staticline41, 0, wxEXPAND | wxALL, 5 );
|
|
||||||
|
|
||||||
|
|
||||||
bupperSizer->Add( bSizerDldOptions, 0, wxEXPAND|wxRIGHT, 5 );
|
|
||||||
|
|
||||||
wxBoxSizer* bButtonsSizer;
|
wxBoxSizer* bButtonsSizer;
|
||||||
bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
|
bButtonsSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_btnClose = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
|
bButtonsSizer->SetMinSize( wxSize( 160,-1 ) );
|
||||||
bButtonsSizer->Add( m_btnClose, 0, wxALL|wxEXPAND, 5 );
|
m_btnApply = new wxButton( this, wxID_APPLY, _("Annotate"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
bButtonsSizer->Add( m_btnApply, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_btnClear = new wxButton( this, ID_CLEAR_ANNOTATION_CMP, _("Clear Annotation"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_btnClear = new wxButton( this, ID_CLEAR_ANNOTATION_CMP, _("Clear Annotation"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bButtonsSizer->Add( m_btnClear, 0, wxALL|wxEXPAND, 5 );
|
bButtonsSizer->Add( m_btnClear, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_btnApply = new wxButton( this, wxID_APPLY, _("Annotate"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_btnClose = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bButtonsSizer->Add( m_btnApply, 0, wxALL|wxEXPAND, 5 );
|
bButtonsSizer->Add( m_btnClose, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bupperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 6 );
|
bSizerDldOptions->Add( bButtonsSizer, 0, wxALIGN_RIGHT, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
bupperSizer->Add( bSizerDldOptions, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||||
|
|
||||||
|
m_MessageWindow = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||||
|
m_MessageWindow->SetMinSize( wxSize( -1,120 ) );
|
||||||
|
|
||||||
|
bupperSizer->Add( m_MessageWindow, 5, wxEXPAND | wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
bmainSizer->Add( bupperSizer, 1, wxALL|wxEXPAND, 6 );
|
bmainSizer->Add( bupperSizer, 1, wxALL|wxEXPAND, 6 );
|
||||||
@ -230,16 +165,14 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
|
|||||||
bmainSizer->Fit( this );
|
bmainSizer->Fit( this );
|
||||||
|
|
||||||
// Connect Events
|
// Connect Events
|
||||||
m_btnClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnCancelClick ), NULL, this );
|
|
||||||
m_btnClear->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnClearAnnotationCmpClick ), NULL, this );
|
|
||||||
m_btnApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnApplyClick ), NULL, this );
|
m_btnApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnApplyClick ), NULL, this );
|
||||||
|
m_btnClear->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnClearAnnotationCmpClick ), NULL, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
DIALOG_ANNOTATE_BASE::~DIALOG_ANNOTATE_BASE()
|
DIALOG_ANNOTATE_BASE::~DIALOG_ANNOTATE_BASE()
|
||||||
{
|
{
|
||||||
// Disconnect Events
|
// Disconnect Events
|
||||||
m_btnClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnCancelClick ), NULL, this );
|
|
||||||
m_btnClear->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnClearAnnotationCmpClick ), NULL, this );
|
|
||||||
m_btnApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnApplyClick ), NULL, this );
|
m_btnApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnApplyClick ), NULL, this );
|
||||||
|
m_btnClear->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnClearAnnotationCmpClick ), NULL, this );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,8 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version May 6 2016)
|
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __DIALOG_ANNOTATE_BASE_H__
|
#ifndef __DIALOG_ANNOTATE_BASE_H__
|
||||||
@ -11,7 +11,7 @@
|
|||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
class DIALOG_SHIM;
|
class WX_HTML_REPORT_PANEL;
|
||||||
|
|
||||||
#include "dialog_shim.h"
|
#include "dialog_shim.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
@ -20,27 +20,24 @@ class DIALOG_SHIM;
|
|||||||
#include <wx/font.h>
|
#include <wx/font.h>
|
||||||
#include <wx/colour.h>
|
#include <wx/colour.h>
|
||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
|
#include <wx/radiobox.h>
|
||||||
#include <wx/radiobut.h>
|
#include <wx/radiobut.h>
|
||||||
#include <wx/statline.h>
|
|
||||||
#include <wx/sizer.h>
|
|
||||||
#include <wx/bitmap.h>
|
#include <wx/bitmap.h>
|
||||||
#include <wx/image.h>
|
#include <wx/image.h>
|
||||||
#include <wx/icon.h>
|
#include <wx/icon.h>
|
||||||
#include <wx/statbmp.h>
|
#include <wx/statbmp.h>
|
||||||
|
#include <wx/sizer.h>
|
||||||
|
#include <wx/statbox.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
|
#include <wx/panel.h>
|
||||||
#include <wx/dialog.h>
|
#include <wx/dialog.h>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define ID_ENTIRE_SCHEMATIC 1000
|
#define ID_SORT_BY_X_POSITION 1000
|
||||||
#define ID_CURRENT_PAGE 1001
|
#define ID_SORT_BY_Y_POSITION 1001
|
||||||
#define ID_KEEP_ANNOTATION 1002
|
#define ID_CLEAR_ANNOTATION_CMP 1002
|
||||||
#define ID_RESET_ANNOTATION 1003
|
|
||||||
#define ID_RESET_BUT_LOCK 1004
|
|
||||||
#define ID_SORT_BY_X_POSITION 1005
|
|
||||||
#define ID_SORT_BY_Y_POSITION 1006
|
|
||||||
#define ID_CLEAR_ANNOTATION_CMP 1007
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class DIALOG_ANNOTATE_BASE
|
/// Class DIALOG_ANNOTATE_BASE
|
||||||
@ -51,37 +48,23 @@ class DIALOG_ANNOTATE_BASE : public DIALOG_SHIM
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxStaticText* m_userMessage;
|
wxStaticText* m_userMessage;
|
||||||
wxStaticText* m_staticTextScope;
|
wxRadioBox* m_rbScope;
|
||||||
wxRadioButton* m_rbEntireSchematic;
|
|
||||||
wxRadioButton* m_rbCurrPage;
|
|
||||||
wxStaticLine* m_staticline1;
|
|
||||||
wxRadioButton* m_rbKeepAnnotation;
|
|
||||||
wxRadioButton* m_rbResetAnnotation;
|
|
||||||
wxRadioButton* m_rbResetButLock;
|
|
||||||
wxStaticLine* m_staticline2;
|
|
||||||
wxStaticText* m_staticTextOrder;
|
|
||||||
wxRadioButton* m_rbSortBy_X_Position;
|
wxRadioButton* m_rbSortBy_X_Position;
|
||||||
wxStaticBitmap* annotate_down_right_bitmap;
|
wxStaticBitmap* annotate_down_right_bitmap;
|
||||||
wxRadioButton* m_rbSortBy_Y_Position;
|
wxRadioButton* m_rbSortBy_Y_Position;
|
||||||
wxStaticBitmap* annotate_right_down_bitmap;
|
wxStaticBitmap* annotate_right_down_bitmap;
|
||||||
wxStaticLine* m_staticline5;
|
wxRadioBox* m_rbOptions;
|
||||||
wxStaticText* m_staticTextAnnotateAlgo;
|
wxRadioBox* m_rbNumbering;
|
||||||
wxRadioButton* m_rbUseIncremental;
|
|
||||||
wxRadioButton* m_rbUseSheetNum;
|
|
||||||
wxRadioButton* m_rbStartSheetNumLarge;
|
|
||||||
wxStaticLine* m_staticline4;
|
|
||||||
wxStaticText* m_staticTextDlgOpts;
|
|
||||||
wxCheckBox* m_cbKeepDlgOpen;
|
wxCheckBox* m_cbKeepDlgOpen;
|
||||||
wxCheckBox* m_cbAskForConfirmation;
|
wxCheckBox* m_cbAskForConfirmation;
|
||||||
wxStaticLine* m_staticline41;
|
|
||||||
wxButton* m_btnClose;
|
|
||||||
wxButton* m_btnClear;
|
|
||||||
wxButton* m_btnApply;
|
wxButton* m_btnApply;
|
||||||
|
wxButton* m_btnClear;
|
||||||
|
wxButton* m_btnClose;
|
||||||
|
WX_HTML_REPORT_PANEL* m_MessageWindow;
|
||||||
|
|
||||||
// Virtual event handlers, overide them in your derived class
|
// Virtual event handlers, overide them in your derived class
|
||||||
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
|
||||||
virtual void OnClearAnnotationCmpClick( wxCommandEvent& event ) { event.Skip(); }
|
|
||||||
virtual void OnApplyClick( wxCommandEvent& event ) { event.Skip(); }
|
virtual void OnApplyClick( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
virtual void OnClearAnnotationCmpClick( wxCommandEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include <project.h>
|
#include <project.h>
|
||||||
#include <kiface_i.h>
|
#include <kiface_i.h>
|
||||||
#include <bitmaps.h>
|
#include <bitmaps.h>
|
||||||
|
#include <reporter.h>
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
|
|
||||||
#include <netlist.h>
|
#include <netlist.h>
|
||||||
@ -181,11 +182,9 @@ void DIALOG_ERC::OnErcCmpClick( wxCommandEvent& event )
|
|||||||
|
|
||||||
m_MessagesList->Clear();
|
m_MessagesList->Clear();
|
||||||
wxSafeYield(); // m_MarkersList must be redraw
|
wxSafeYield(); // m_MarkersList must be redraw
|
||||||
wxArrayString messageList;
|
|
||||||
TestErc( &messageList );
|
|
||||||
|
|
||||||
for( unsigned ii = 0; ii < messageList.GetCount(); ii++ )
|
WX_TEXT_CTRL_REPORTER reporter( m_MessagesList );
|
||||||
m_MessagesList->AppendText( messageList[ii] );
|
TestErc( reporter );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -449,7 +448,7 @@ void DIALOG_ERC::ChangeErrorLevel( wxCommandEvent& event )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
|
void DIALOG_ERC::TestErc( REPORTER& aReporter )
|
||||||
{
|
{
|
||||||
wxFileName fn;
|
wxFileName fn;
|
||||||
|
|
||||||
@ -461,14 +460,10 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
|
|||||||
SCH_SHEET_LIST sheets( g_RootSheet );
|
SCH_SHEET_LIST sheets( g_RootSheet );
|
||||||
sheets.AnnotatePowerSymbols();
|
sheets.AnnotatePowerSymbols();
|
||||||
|
|
||||||
if( m_parent->CheckAnnotate( aMessagesList, false ) )
|
if( m_parent->CheckAnnotate( aReporter, false ) )
|
||||||
{
|
{
|
||||||
if( aMessagesList )
|
if( aReporter.HasMessage() )
|
||||||
{
|
aReporter.Report( _( "Annotation required!" ), REPORTER::RPT_ERROR );
|
||||||
wxString msg = _( "Annotation required!" );
|
|
||||||
msg += wxT( "\n" );
|
|
||||||
aMessagesList->Add( msg );
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -584,9 +579,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
|
|||||||
m_parent->GetCanvas()->Refresh();
|
m_parent->GetCanvas()->Refresh();
|
||||||
|
|
||||||
// Display message
|
// Display message
|
||||||
wxString msg = _( "Finished" );
|
aReporter.Report( _( "Finished" ), REPORTER::RPT_INFO );
|
||||||
msg += wxT( "\n" );
|
|
||||||
aMessagesList->Add( msg );
|
|
||||||
|
|
||||||
if( m_writeErcFile )
|
if( m_writeErcFile )
|
||||||
{
|
{
|
||||||
|
@ -70,7 +70,7 @@ private:
|
|||||||
// Double click on a marker info:
|
// Double click on a marker info:
|
||||||
void OnLeftDblClickMarkersList( wxMouseEvent& event ) override;
|
void OnLeftDblClickMarkersList( wxMouseEvent& event ) override;
|
||||||
|
|
||||||
void TestErc( wxArrayString* aMessagesList );
|
void TestErc( REPORTER& aReporter );
|
||||||
void DisplayERC_MarkersList();
|
void DisplayERC_MarkersList();
|
||||||
void SelLocal( wxCommandEvent& event );
|
void SelLocal( wxCommandEvent& event );
|
||||||
void SelNewCmp( wxCommandEvent& event );
|
void SelNewCmp( wxCommandEvent& event );
|
||||||
|
@ -65,9 +65,14 @@ class SCH_EDIT_FRAME;
|
|||||||
*/
|
*/
|
||||||
int InvokeDialogRescueEach( SCH_EDIT_FRAME* aCaller, RESCUER& aRescuer, bool aAskShowAgain );
|
int InvokeDialogRescueEach( SCH_EDIT_FRAME* aCaller, RESCUER& aRescuer, bool aAskShowAgain );
|
||||||
|
|
||||||
/// Create and show DIALOG_ANNOTATE and return whatever
|
/// Create and show DIALOG_ANNOTATE.
|
||||||
/// DIALOG_ANNOTATE::ShowModal() returns.
|
void InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller );
|
||||||
int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller, const wxString& message = "" );
|
|
||||||
|
/// Create and show a modal DIALOG_ANNOTATE for a particular purpose. This version
|
||||||
|
/// forces scope to Full Schematic.
|
||||||
|
/// @param aMessage - indicates the purpose
|
||||||
|
/// @return the ShowModal() result
|
||||||
|
int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller, const wxString& aMessage );
|
||||||
|
|
||||||
/// Create the modeless DIALOG_ERC and show it, return something to
|
/// Create the modeless DIALOG_ERC and show it, return something to
|
||||||
/// destroy or close it. The dialog will have ID_DIALOG_ERC from id.h
|
/// destroy or close it. The dialog will have ID_DIALOG_ERC from id.h
|
||||||
|
@ -171,14 +171,14 @@ bool SCH_EDIT_FRAME::prepareForNetlist()
|
|||||||
sheets.AnnotatePowerSymbols();
|
sheets.AnnotatePowerSymbols();
|
||||||
|
|
||||||
// Performs some controls:
|
// Performs some controls:
|
||||||
if( CheckAnnotate( NULL, 0 ) )
|
if( CheckAnnotate( NULL_REPORTER::GetInstance(), 0 ) )
|
||||||
{
|
{
|
||||||
// Schematic must be annotated: call Annotate dialog and tell
|
// Schematic must be annotated: call Annotate dialog and tell
|
||||||
// the user why that is.
|
// the user why that is.
|
||||||
InvokeDialogAnnotate( this, _( "Exporting the netlist requires a "
|
InvokeDialogAnnotate( this,
|
||||||
"completely\nannotated schematic." ) );
|
_( "Exporting the netlist requires a completely annotated schematic." ) );
|
||||||
|
|
||||||
if( CheckAnnotate( NULL, 0 ) )
|
if( CheckAnnotate( NULL_REPORTER::GetInstance(), 0 ) )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include <symbol_lib_table.h>
|
#include <symbol_lib_table.h>
|
||||||
|
|
||||||
#include <dialog_helpers.h>
|
#include <dialog_helpers.h>
|
||||||
|
#include <reporter.h>
|
||||||
#include <lib_edit_frame.h>
|
#include <lib_edit_frame.h>
|
||||||
#include <viewlib_frame.h>
|
#include <viewlib_frame.h>
|
||||||
#include <hotkeys.h>
|
#include <hotkeys.h>
|
||||||
@ -891,7 +892,8 @@ void SCH_EDIT_FRAME::doUpdatePcb( const wxString& aUpdateOptions )
|
|||||||
schematic.UpdateSymbolLinks();
|
schematic.UpdateSymbolLinks();
|
||||||
SCH_SHEET_LIST sheets( g_RootSheet );
|
SCH_SHEET_LIST sheets( g_RootSheet );
|
||||||
sheets.AnnotatePowerSymbols();
|
sheets.AnnotatePowerSymbols();
|
||||||
AnnotateComponents( true, UNSORTED, INCREMENTAL_BY_REF, false, false, true );
|
AnnotateComponents( true, UNSORTED, INCREMENTAL_BY_REF, false, false, true,
|
||||||
|
NULL_REPORTER::GetInstance() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !aUpdateOptions.Contains( "no-annotate" ) )
|
if( !aUpdateOptions.Contains( "no-annotate" ) )
|
||||||
|
@ -604,6 +604,7 @@ public:
|
|||||||
* usual behavior of annotating each part individually is
|
* usual behavior of annotating each part individually is
|
||||||
* performed.
|
* performed.
|
||||||
* When aResetAnnotation is false, this option has no effect.
|
* When aResetAnnotation is false, this option has no effect.
|
||||||
|
* @param aReporter A sink for error messages. Use NULL_REPORTER if you don't need errors.
|
||||||
*
|
*
|
||||||
* When the sheet number is used in annotation, each sheet annotation starts from sheet
|
* When the sheet number is used in annotation, each sheet annotation starts from sheet
|
||||||
* number * 100. In other words the first sheet uses 100 to 199, the second sheet uses
|
* number * 100. In other words the first sheet uses 100 to 199, the second sheet uses
|
||||||
@ -611,7 +612,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void AnnotateComponents( bool aAnnotateSchematic, ANNOTATE_ORDER_T aSortOption,
|
void AnnotateComponents( bool aAnnotateSchematic, ANNOTATE_ORDER_T aSortOption,
|
||||||
ANNOTATE_OPTION_T aAlgoOption, bool aResetAnnotation,
|
ANNOTATE_OPTION_T aAlgoOption, bool aResetAnnotation,
|
||||||
bool aRepairTimestamps, bool aLockUnits );
|
bool aRepairTimestamps, bool aLockUnits, REPORTER& aReporter );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for annotation errors.
|
* Check for annotation errors.
|
||||||
@ -625,11 +626,11 @@ public:
|
|||||||
* between parts.
|
* between parts.
|
||||||
*
|
*
|
||||||
* @return Number of annotation errors found.
|
* @return Number of annotation errors found.
|
||||||
* @param aMessageList A wxArrayString to store error messages.
|
* @param aReporter A sink for error messages. Use NULL_REPORTER if you don't need errors.
|
||||||
* @param aOneSheetOnly Check the current sheet only if true. Otherwise check
|
* @param aOneSheetOnly Check the current sheet only if true. Otherwise check
|
||||||
* the entire schematic.
|
* the entire schematic.
|
||||||
*/
|
*/
|
||||||
int CheckAnnotate( wxArrayString* aMessageList, bool aOneSheetOnly );
|
int CheckAnnotate( REPORTER& aReporter, bool aOneSheetOnly );
|
||||||
|
|
||||||
// Functions used for hierarchy handling
|
// Functions used for hierarchy handling
|
||||||
SCH_SHEET_PATH& GetCurrentSheet();
|
SCH_SHEET_PATH& GetCurrentSheet();
|
||||||
|
@ -311,10 +311,10 @@ public:
|
|||||||
* <li>Components with multiple parts per package with invalid part count.</li>
|
* <li>Components with multiple parts per package with invalid part count.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* </p>
|
* </p>
|
||||||
* @param aMessageList A wxArrayString to store error messages.
|
* @param aReporter A sink for error messages. Use NULL_REPORTER if you don't need errors.
|
||||||
* @return The number of errors found.
|
* @return The number of errors found.
|
||||||
*/
|
*/
|
||||||
int CheckAnnotation( wxArrayString* aMessageList );
|
int CheckAnnotation( REPORTER& aReporter );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function sortByXCoordinate
|
* Function sortByXCoordinate
|
||||||
|
@ -67,6 +67,11 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HasMessage() const
|
||||||
|
{
|
||||||
|
return false; // Technically "indeterminate" rather than false.
|
||||||
|
}
|
||||||
|
|
||||||
void OnSimStateChange( SPICE_SIMULATOR* aObject, SIM_STATE aNewState ) override
|
void OnSimStateChange( SPICE_SIMULATOR* aObject, SIM_STATE aNewState ) override
|
||||||
{
|
{
|
||||||
wxCommandEvent* event = NULL;
|
wxCommandEvent* event = NULL;
|
||||||
|
@ -87,6 +87,12 @@ public:
|
|||||||
REPORTER& operator <<( const wxChar* aText ) { return Report( wxString( aText ) ); }
|
REPORTER& operator <<( const wxChar* aText ) { return Report( wxString( aText ) ); }
|
||||||
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 ); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function HasMessage
|
||||||
|
* Returns true if the reporter client is non-empty.
|
||||||
|
*/
|
||||||
|
virtual bool HasMessage() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -106,6 +112,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_UNDEFINED ) override;
|
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_UNDEFINED ) override;
|
||||||
|
|
||||||
|
bool HasMessage() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -125,6 +133,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_UNDEFINED ) override;
|
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_UNDEFINED ) override;
|
||||||
|
|
||||||
|
bool HasMessage() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -144,6 +154,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_UNDEFINED ) override;
|
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_UNDEFINED ) override;
|
||||||
|
|
||||||
|
bool HasMessage() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -154,14 +166,16 @@ public:
|
|||||||
*/
|
*/
|
||||||
class NULL_REPORTER : public REPORTER
|
class NULL_REPORTER : public REPORTER
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NULL_REPORTER()
|
NULL_REPORTER()
|
||||||
{
|
{
|
||||||
};
|
}
|
||||||
|
|
||||||
static REPORTER& GetInstance();
|
static REPORTER& GetInstance();
|
||||||
|
|
||||||
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_UNDEFINED ) override;
|
REPORTER& Report( const wxString& aText, SEVERITY aSeverity = RPT_UNDEFINED ) override;
|
||||||
|
|
||||||
|
bool HasMessage() const override { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _REPORTER_H_
|
#endif // _REPORTER_H_
|
||||||
|
@ -114,7 +114,7 @@ DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC,
|
|||||||
m_MessageWindow->SetVisibleSeverities( severities );
|
m_MessageWindow->SetVisibleSeverities( severities );
|
||||||
|
|
||||||
// Update sizes and sizers:
|
// Update sizes and sizers:
|
||||||
m_MessageWindow->MsgPanelSetMinSize( wxSize( -1, 150 ) );
|
m_MessageWindow->MsgPanelSetMinSize( wxSize( -1, 160 ) );
|
||||||
GetSizer()->SetSizeHints( this );
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user