Naming conventions; no functional changes.
This commit is contained in:
parent
258929090e
commit
ee5e2e56c0
|
@ -58,7 +58,7 @@ static const VECTOR2I MarkerShapeCorners[] =
|
||||||
const unsigned CORNERS_COUNT = arrayDim( MarkerShapeCorners );
|
const unsigned CORNERS_COUNT = arrayDim( MarkerShapeCorners );
|
||||||
|
|
||||||
|
|
||||||
MARKER_BASE::MARKER_BASE( int aScalingFactor, std::shared_ptr<RC_ITEM> aItem, TYPEMARKER aType ) :
|
MARKER_BASE::MARKER_BASE( int aScalingFactor, std::shared_ptr<RC_ITEM> aItem, MARKER_T aType ) :
|
||||||
m_markerType( aType ),
|
m_markerType( aType ),
|
||||||
m_excluded( false ),
|
m_excluded( false ),
|
||||||
m_rcItem( aItem ),
|
m_rcItem( aItem ),
|
||||||
|
|
|
@ -1939,7 +1939,7 @@ void SCH_SCREENS::DeleteMarker( SCH_MARKER* aMarker )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_SCREENS::DeleteMarkers( enum MARKER_BASE::TYPEMARKER aMarkerType, int aErrorCode,
|
void SCH_SCREENS::DeleteMarkers( enum MARKER_BASE::MARKER_T aMarkerType, int aErrorCode,
|
||||||
bool aIncludeExclusions )
|
bool aIncludeExclusions )
|
||||||
{
|
{
|
||||||
for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
|
for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
|
||||||
|
@ -1965,7 +1965,7 @@ void SCH_SCREENS::DeleteMarkers( enum MARKER_BASE::TYPEMARKER aMarkerType, int a
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_SCREENS::DeleteAllMarkers( enum MARKER_BASE::TYPEMARKER aMarkerType,
|
void SCH_SCREENS::DeleteAllMarkers( enum MARKER_BASE::MARKER_T aMarkerType,
|
||||||
bool aIncludeExclusions )
|
bool aIncludeExclusions )
|
||||||
{
|
{
|
||||||
DeleteMarkers( aMarkerType, ERCE_UNSPECIFIED, aIncludeExclusions );
|
DeleteMarkers( aMarkerType, ERCE_UNSPECIFIED, aIncludeExclusions );
|
||||||
|
|
|
@ -739,12 +739,12 @@ public:
|
||||||
*
|
*
|
||||||
* @param aMarkerType Type of markers to be deleted.
|
* @param aMarkerType Type of markers to be deleted.
|
||||||
*/
|
*/
|
||||||
void DeleteAllMarkers( enum MARKER_BASE::TYPEMARKER aMarkerType, bool aIncludeExclusions );
|
void DeleteAllMarkers( enum MARKER_BASE::MARKER_T aMarkerType, bool aIncludeExclusions );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete all markers of a particular type and error code.
|
* Delete all markers of a particular type and error code.
|
||||||
*/
|
*/
|
||||||
void DeleteMarkers( enum MARKER_BASE::TYPEMARKER aMarkerTyp, int aErrorCode,
|
void DeleteMarkers( enum MARKER_BASE::MARKER_T aMarkerTyp, int aErrorCode,
|
||||||
bool aIncludeExclusions = true );
|
bool aIncludeExclusions = true );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -313,11 +313,13 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
|
||||||
for( auto it = settings.m_ErcExclusions.begin(); it != settings.m_ErcExclusions.end(); )
|
for( auto it = settings.m_ErcExclusions.begin(); it != settings.m_ErcExclusions.end(); )
|
||||||
{
|
{
|
||||||
SCH_MARKER* testMarker = SCH_MARKER::Deserialize( this, *it );
|
SCH_MARKER* testMarker = SCH_MARKER::Deserialize( this, *it );
|
||||||
|
|
||||||
if( testMarker->IsLegacyMarker() )
|
if( testMarker->IsLegacyMarker() )
|
||||||
{
|
{
|
||||||
const wxString settingsKey = testMarker->GetRCItem()->GetSettingsKey();
|
const wxString settingsKey = testMarker->GetRCItem()->GetSettingsKey();
|
||||||
|
|
||||||
if( settingsKey != wxT( "pin_to_pin" ) && settingsKey != wxT( "hier_label_mismatch" )
|
if( settingsKey != wxT( "pin_to_pin" )
|
||||||
|
&& settingsKey != wxT( "hier_label_mismatch" )
|
||||||
&& settingsKey != wxT( "different_unit_net" ) )
|
&& settingsKey != wxT( "different_unit_net" ) )
|
||||||
{
|
{
|
||||||
migratedExclusions.insert( testMarker->Serialize() );
|
migratedExclusions.insert( testMarker->Serialize() );
|
||||||
|
@ -329,6 +331,7 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
|
||||||
{
|
{
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete testMarker;
|
delete testMarker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +344,8 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
|
||||||
for( SCH_ITEM* item : sheet.LastScreen()->Items().OfType( SCH_MARKER_T ) )
|
for( SCH_ITEM* item : sheet.LastScreen()->Items().OfType( SCH_MARKER_T ) )
|
||||||
{
|
{
|
||||||
SCH_MARKER* marker = static_cast<SCH_MARKER*>( item );
|
SCH_MARKER* marker = static_cast<SCH_MARKER*>( item );
|
||||||
auto it = settings.m_ErcExclusions.find( marker->Serialize() );
|
wxString serialized = marker->Serialize();
|
||||||
|
std::set<wxString>::iterator it = settings.m_ErcExclusions.find( serialized );
|
||||||
|
|
||||||
if( it != settings.m_ErcExclusions.end() )
|
if( it != settings.m_ErcExclusions.end() )
|
||||||
{
|
{
|
||||||
|
@ -353,9 +357,9 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
|
||||||
|
|
||||||
std::vector<SCH_MARKER*> newMarkers;
|
std::vector<SCH_MARKER*> newMarkers;
|
||||||
|
|
||||||
for( const wxString& exclusionData : settings.m_ErcExclusions )
|
for( const wxString& serialized : settings.m_ErcExclusions )
|
||||||
{
|
{
|
||||||
SCH_MARKER* marker = SCH_MARKER::Deserialize( this, exclusionData );
|
SCH_MARKER* marker = SCH_MARKER::Deserialize( this, serialized );
|
||||||
|
|
||||||
if( marker )
|
if( marker )
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,8 @@ using KIGFX::RENDER_SETTINGS;
|
||||||
class MARKER_BASE
|
class MARKER_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum TYPEMARKER {
|
enum MARKER_T
|
||||||
|
{
|
||||||
MARKER_UNSPEC,
|
MARKER_UNSPEC,
|
||||||
MARKER_ERC,
|
MARKER_ERC,
|
||||||
MARKER_DRC,
|
MARKER_DRC,
|
||||||
|
@ -59,7 +60,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
MARKER_BASE( int aScalingFactor, std::shared_ptr<RC_ITEM> aItem,
|
MARKER_BASE( int aScalingFactor, std::shared_ptr<RC_ITEM> aItem,
|
||||||
TYPEMARKER aType = MARKER_UNSPEC );
|
MARKER_T aType = MARKER_UNSPEC );
|
||||||
virtual ~MARKER_BASE();
|
virtual ~MARKER_BASE();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -91,8 +92,8 @@ public:
|
||||||
/**
|
/**
|
||||||
* Accessors to set/get marker type (DRC, ERC, or other)
|
* Accessors to set/get marker type (DRC, ERC, or other)
|
||||||
*/
|
*/
|
||||||
void SetMarkerType( enum TYPEMARKER aMarkerType ) { m_markerType = aMarkerType; }
|
void SetMarkerType( enum MARKER_T aMarkerType ) { m_markerType = aMarkerType; }
|
||||||
enum TYPEMARKER GetMarkerType() const { return m_markerType; }
|
enum MARKER_T GetMarkerType() const { return m_markerType; }
|
||||||
|
|
||||||
bool IsExcluded() const { return m_excluded; }
|
bool IsExcluded() const { return m_excluded; }
|
||||||
void SetExcluded( bool aExcluded ) { m_excluded = aExcluded; }
|
void SetExcluded( bool aExcluded ) { m_excluded = aExcluded; }
|
||||||
|
@ -128,7 +129,7 @@ public:
|
||||||
VECTOR2I m_Pos; ///< position of the marker
|
VECTOR2I m_Pos; ///< position of the marker
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TYPEMARKER m_markerType; // The type of marker (useful to filter markers)
|
MARKER_T m_markerType; // The type of marker (useful to filter markers)
|
||||||
bool m_excluded; // User has excluded this specific error
|
bool m_excluded; // User has excluded this specific error
|
||||||
std::shared_ptr<RC_ITEM> m_rcItem;
|
std::shared_ptr<RC_ITEM> m_rcItem;
|
||||||
|
|
||||||
|
|
|
@ -322,12 +322,13 @@ std::vector<PCB_MARKER*> BOARD::ResolveDRCExclusions( bool aCreateMarkers )
|
||||||
{
|
{
|
||||||
for( PCB_MARKER* marker : GetBoard()->Markers() )
|
for( PCB_MARKER* marker : GetBoard()->Markers() )
|
||||||
{
|
{
|
||||||
auto i = m_designSettings->m_DrcExclusions.find( marker->Serialize() );
|
wxString serialized = marker->Serialize();
|
||||||
|
std::set<wxString>::iterator it = m_designSettings->m_DrcExclusions.find( serialized );
|
||||||
|
|
||||||
if( i != m_designSettings->m_DrcExclusions.end() )
|
if( it != m_designSettings->m_DrcExclusions.end() )
|
||||||
{
|
{
|
||||||
marker->SetExcluded( true );
|
marker->SetExcluded( true );
|
||||||
m_designSettings->m_DrcExclusions.erase( i );
|
m_designSettings->m_DrcExclusions.erase( it );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,9 +336,9 @@ std::vector<PCB_MARKER*> BOARD::ResolveDRCExclusions( bool aCreateMarkers )
|
||||||
|
|
||||||
if( aCreateMarkers )
|
if( aCreateMarkers )
|
||||||
{
|
{
|
||||||
for( const wxString& exclusionData : m_designSettings->m_DrcExclusions )
|
for( const wxString& serialized : m_designSettings->m_DrcExclusions )
|
||||||
{
|
{
|
||||||
PCB_MARKER* marker = PCB_MARKER::Deserialize( exclusionData );
|
PCB_MARKER* marker = PCB_MARKER::Deserialize( serialized );
|
||||||
|
|
||||||
if( !marker )
|
if( !marker )
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -218,8 +218,8 @@ private:
|
||||||
class DRC_ITEMS_PROVIDER : public RC_ITEMS_PROVIDER
|
class DRC_ITEMS_PROVIDER : public RC_ITEMS_PROVIDER
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DRC_ITEMS_PROVIDER( BOARD* aBoard, MARKER_BASE::TYPEMARKER aMarkerType,
|
DRC_ITEMS_PROVIDER( BOARD* aBoard, MARKER_BASE::MARKER_T aMarkerType,
|
||||||
MARKER_BASE::TYPEMARKER otherMarkerType = MARKER_BASE::MARKER_UNSPEC ) :
|
MARKER_BASE::MARKER_T otherMarkerType = MARKER_BASE::MARKER_UNSPEC ) :
|
||||||
m_board( aBoard ),
|
m_board( aBoard ),
|
||||||
m_severities( 0 )
|
m_severities( 0 )
|
||||||
{
|
{
|
||||||
|
@ -239,7 +239,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BOARD* m_board;
|
BOARD* m_board;
|
||||||
std::vector<MARKER_BASE::TYPEMARKER> m_markerTypes;
|
std::vector<MARKER_BASE::MARKER_T> m_markerTypes;
|
||||||
|
|
||||||
int m_severities;
|
int m_severities;
|
||||||
std::vector<PCB_MARKER*> m_filteredMarkers;
|
std::vector<PCB_MARKER*> m_filteredMarkers;
|
||||||
|
|
Loading…
Reference in New Issue