Naming conventions; no functional changes.

This commit is contained in:
Jeff Young 2024-01-29 11:51:06 +00:00
parent 258929090e
commit ee5e2e56c0
7 changed files with 39 additions and 33 deletions

View File

@ -58,7 +58,7 @@ static const VECTOR2I 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_excluded( false ),
m_rcItem( aItem ),

View File

@ -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 )
{
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 )
{
DeleteMarkers( aMarkerType, ERCE_UNSPECIFIED, aIncludeExclusions );

View File

@ -739,12 +739,12 @@ public:
*
* @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.
*/
void DeleteMarkers( enum MARKER_BASE::TYPEMARKER aMarkerTyp, int aErrorCode,
void DeleteMarkers( enum MARKER_BASE::MARKER_T aMarkerTyp, int aErrorCode,
bool aIncludeExclusions = true );
/**

View File

@ -313,11 +313,13 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
for( auto it = settings.m_ErcExclusions.begin(); it != settings.m_ErcExclusions.end(); )
{
SCH_MARKER* testMarker = SCH_MARKER::Deserialize( this, *it );
if( testMarker->IsLegacyMarker() )
{
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" ) )
{
migratedExclusions.insert( testMarker->Serialize() );
@ -329,6 +331,7 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
{
++it;
}
delete testMarker;
}
@ -340,8 +343,9 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
{
for( SCH_ITEM* item : sheet.LastScreen()->Items().OfType( SCH_MARKER_T ) )
{
SCH_MARKER* marker = static_cast<SCH_MARKER*>( item );
auto it = settings.m_ErcExclusions.find( marker->Serialize() );
SCH_MARKER* marker = static_cast<SCH_MARKER*>( item );
wxString serialized = marker->Serialize();
std::set<wxString>::iterator it = settings.m_ErcExclusions.find( serialized );
if( it != settings.m_ErcExclusions.end() )
{
@ -353,9 +357,9 @@ std::vector<SCH_MARKER*> SCHEMATIC::ResolveERCExclusions()
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 )
{

View File

@ -48,7 +48,8 @@ using KIGFX::RENDER_SETTINGS;
class MARKER_BASE
{
public:
enum TYPEMARKER {
enum MARKER_T
{
MARKER_UNSPEC,
MARKER_ERC,
MARKER_DRC,
@ -59,7 +60,7 @@ public:
};
MARKER_BASE( int aScalingFactor, std::shared_ptr<RC_ITEM> aItem,
TYPEMARKER aType = MARKER_UNSPEC );
MARKER_T aType = MARKER_UNSPEC );
virtual ~MARKER_BASE();
/**
@ -91,8 +92,8 @@ public:
/**
* Accessors to set/get marker type (DRC, ERC, or other)
*/
void SetMarkerType( enum TYPEMARKER aMarkerType ) { m_markerType = aMarkerType; }
enum TYPEMARKER GetMarkerType() const { return m_markerType; }
void SetMarkerType( enum MARKER_T aMarkerType ) { m_markerType = aMarkerType; }
enum MARKER_T GetMarkerType() const { return m_markerType; }
bool IsExcluded() const { return m_excluded; }
void SetExcluded( bool aExcluded ) { m_excluded = aExcluded; }
@ -125,18 +126,18 @@ protected:
virtual KIGFX::COLOR4D getColor() const = 0;
public:
VECTOR2I m_Pos; ///< position of the marker
VECTOR2I m_Pos; ///< position of the marker
protected:
TYPEMARKER m_markerType; // The type of marker (useful to filter markers)
bool m_excluded; // User has excluded this specific error
MARKER_T m_markerType; // The type of marker (useful to filter markers)
bool m_excluded; // User has excluded this specific error
std::shared_ptr<RC_ITEM> m_rcItem;
int m_scalingFactor; // Scaling factor to convert corners coordinates
// to internal units coordinates
BOX2I m_shapeBoundingBox; // Bounding box of the graphic symbol, relative
// to the position of the shape, in marker shape
// units
int m_scalingFactor; // Scaling factor to convert corners coordinates
// to internal units coordinates
BOX2I m_shapeBoundingBox; // Bounding box of the graphic symbol, relative
// to the position of the shape, in marker shape
// units
};

View File

@ -322,12 +322,13 @@ std::vector<PCB_MARKER*> BOARD::ResolveDRCExclusions( bool aCreateMarkers )
{
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 );
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 )
{
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 )
continue;

View File

@ -218,8 +218,8 @@ private:
class DRC_ITEMS_PROVIDER : public RC_ITEMS_PROVIDER
{
public:
DRC_ITEMS_PROVIDER( BOARD* aBoard, MARKER_BASE::TYPEMARKER aMarkerType,
MARKER_BASE::TYPEMARKER otherMarkerType = MARKER_BASE::MARKER_UNSPEC ) :
DRC_ITEMS_PROVIDER( BOARD* aBoard, MARKER_BASE::MARKER_T aMarkerType,
MARKER_BASE::MARKER_T otherMarkerType = MARKER_BASE::MARKER_UNSPEC ) :
m_board( aBoard ),
m_severities( 0 )
{
@ -238,11 +238,11 @@ public:
void DeleteItem( int aIndex, bool aDeep ) override;
private:
BOARD* m_board;
std::vector<MARKER_BASE::TYPEMARKER> m_markerTypes;
BOARD* m_board;
std::vector<MARKER_BASE::MARKER_T> m_markerTypes;
int m_severities;
std::vector<PCB_MARKER*> m_filteredMarkers;
int m_severities;
std::vector<PCB_MARKER*> m_filteredMarkers;
};