Relax fully-annotated constraint for BOM editor.
Also fixes a bug where unannotated components would get references of the form R-1 (because their reference number was -1). Fixes: lp:1768814 * https://bugs.launchpad.net/kicad/+bug/1768814
This commit is contained in:
parent
f73b9a55a7
commit
6e83f99c72
|
@ -41,14 +41,6 @@
|
||||||
#include "dialog_fields_editor_global.h"
|
#include "dialog_fields_editor_global.h"
|
||||||
|
|
||||||
|
|
||||||
// Create and show fields editor
|
|
||||||
void InvokeDialogCreateBOMEditor( SCH_EDIT_FRAME* aCaller )
|
|
||||||
{
|
|
||||||
DIALOG_FIELDS_EDITOR_GLOBAL dlg( aCaller );
|
|
||||||
dlg.ShowQuasiModal();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#define FIELD_NAME_COLUMN 0
|
#define FIELD_NAME_COLUMN 0
|
||||||
#define SHOW_FIELD_COLUMN 1
|
#define SHOW_FIELD_COLUMN 1
|
||||||
#define GROUP_BY_COLUMN 2
|
#define GROUP_BY_COLUMN 2
|
||||||
|
@ -162,8 +154,16 @@ public:
|
||||||
if( aCol == REFERENCE || aCol == QUANTITY_COLUMN )
|
if( aCol == REFERENCE || aCol == QUANTITY_COLUMN )
|
||||||
{
|
{
|
||||||
// Remove duplicates (other units of multi-unit parts)
|
// Remove duplicates (other units of multi-unit parts)
|
||||||
rootReferences.erase( std::unique( rootReferences.begin(), rootReferences.end() ),
|
auto logicalEnd = std::unique( rootReferences.begin(), rootReferences.end(),
|
||||||
rootReferences.end() );
|
[]( const wxString& l, const wxString& r )
|
||||||
|
{
|
||||||
|
// If not annotated then we don't really know if it's a duplicate
|
||||||
|
if( l.EndsWith( wxT( "?" ) ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return l == r;
|
||||||
|
} );
|
||||||
|
rootReferences.erase( logicalEnd, rootReferences.end() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aCol == REFERENCE )
|
if( aCol == REFERENCE )
|
||||||
|
@ -247,7 +247,8 @@ public:
|
||||||
wxCheckBox* groupComponentsBox, wxDataViewListCtrl* fieldsCtrl )
|
wxCheckBox* groupComponentsBox, wxDataViewListCtrl* fieldsCtrl )
|
||||||
{
|
{
|
||||||
// Units of same component always match
|
// Units of same component always match
|
||||||
if( lhRef.GetRef() == rhRef.GetRef() && lhRef.GetRefNumber() == rhRef.GetRefNumber() )
|
if( lhRef.GetRef() == rhRef.GetRef() && lhRef.GetRefNumber() != wxT( "?" )
|
||||||
|
&& lhRef.GetRefNumber() == rhRef.GetRefNumber() )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// If we're not grouping, then nothing else matches
|
// If we're not grouping, then nothing else matches
|
||||||
|
|
|
@ -77,9 +77,6 @@ int InvokeDialogPrintUsingPrinter( SCH_EDIT_FRAME* aCaller );
|
||||||
/// DIALOG_BOM::ShowModal() returns.
|
/// DIALOG_BOM::ShowModal() returns.
|
||||||
int InvokeDialogCreateBOM( SCH_EDIT_FRAME* aCaller );
|
int InvokeDialogCreateBOM( SCH_EDIT_FRAME* aCaller );
|
||||||
|
|
||||||
/// Create and show DIALOG_BOM_EDITOR
|
|
||||||
void InvokeDialogCreateBOMEditor( SCH_EDIT_FRAME* aCaller );
|
|
||||||
|
|
||||||
/// Update symbol fields
|
/// Update symbol fields
|
||||||
int InvokeDialogUpdateFields( SCH_EDIT_FRAME* aCaller,
|
int InvokeDialogUpdateFields( SCH_EDIT_FRAME* aCaller,
|
||||||
const std::list<SCH_COMPONENT*> aComponents, bool aCreateUndoEntry );
|
const std::list<SCH_COMPONENT*> aComponents, bool aCreateUndoEntry );
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
#include <netlist_exporter_kicad.h>
|
#include <netlist_exporter_kicad.h>
|
||||||
#include <kiway.h>
|
#include <kiway.h>
|
||||||
|
#include <dialogs/dialog_fields_editor_global.h>
|
||||||
|
|
||||||
// non-member so it can be moved easily, and kept REALLY private.
|
// non-member so it can be moved easily, and kept REALLY private.
|
||||||
// Do NOT Clear() in here.
|
// Do NOT Clear() in here.
|
||||||
|
@ -941,11 +941,8 @@ void SCH_EDIT_FRAME::OnCreateBillOfMaterials( wxCommandEvent& )
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnLaunchBomManager( wxCommandEvent& event )
|
void SCH_EDIT_FRAME::OnLaunchBomManager( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
// First ensure that entire schematic is annotated
|
DIALOG_FIELDS_EDITOR_GLOBAL dlg( this );
|
||||||
if( !prepareForNetlist() )
|
dlg.ShowQuasiModal();
|
||||||
return;
|
|
||||||
|
|
||||||
InvokeDialogCreateBOMEditor( this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,9 @@ public:
|
||||||
{
|
{
|
||||||
wxString ref;
|
wxString ref;
|
||||||
|
|
||||||
|
if( m_NumRef < 0 )
|
||||||
|
return wxT( "?" );
|
||||||
|
|
||||||
// To avoid a risk of duplicate, for power components
|
// To avoid a risk of duplicate, for power components
|
||||||
// the ref number is 0nnn instead of nnn.
|
// the ref number is 0nnn instead of nnn.
|
||||||
// Just because sometimes only power components are annotated
|
// Just because sometimes only power components are annotated
|
||||||
|
|
Loading…
Reference in New Issue