Remove shadowed member variables.

This commit is contained in:
Jeff Young 2024-04-18 10:58:39 +01:00
parent e5cdf3785b
commit cc78196f81
3 changed files with 36 additions and 70 deletions

View File

@ -99,7 +99,6 @@ static LIB_SYMBOL* dummy()
SCH_SYMBOL::SCH_SYMBOL() :
SYMBOL( nullptr, SCH_SYMBOL_T )
{
m_DNP = false;
Init( VECTOR2I( 0, 0 ) );
}
@ -139,7 +138,6 @@ SCH_SYMBOL::SCH_SYMBOL( const LIB_SYMBOL& aSymbol, const LIB_ID& aLibId,
m_excludedFromSim = m_part->GetExcludedFromSim();
m_excludedFromBOM = m_part->GetExcludedFromBOM();
m_excludedFromBoard = m_part->GetExcludedFromBoard();
m_DNP = false;
}
@ -222,9 +220,6 @@ void SCH_SYMBOL::Init( const VECTOR2I& pos )
m_prefix = wxString( wxT( "U" ) );
m_isInNetlist = true;
m_excludedFromSim = false;
m_excludedFromBOM = false;
m_excludedFromBoard = false;
}
@ -2754,14 +2749,12 @@ static struct SCH_SYMBOL_DESC
return false;
};
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Pin numbers" ),
&SCH_SYMBOL::SetShowPinNumbers,
&SCH_SYMBOL::GetShowPinNumbers ) )
propMgr.AddProperty( new PROPERTY<SYMBOL, bool>( _HKI( "Pin numbers" ),
&SYMBOL::SetShowPinNumbers, &SYMBOL::GetShowPinNumbers ) )
.SetAvailableFunc( hasLibPart );
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Pin names" ),
&SCH_SYMBOL::SetShowPinNames,
&SCH_SYMBOL::GetShowPinNames ) )
propMgr.AddProperty( new PROPERTY<SYMBOL, bool>( _HKI( "Pin names" ),
&SYMBOL::SetShowPinNames, &SYMBOL::GetShowPinNames ) )
.SetAvailableFunc( hasLibPart );
const wxString groupFields = _HKI( "Fields" );
@ -2784,18 +2777,18 @@ static struct SCH_SYMBOL_DESC
const wxString groupAttributes = _HKI( "Attributes" );
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Exclude From Board" ),
&SCH_SYMBOL::SetExcludedFromBoard, &SCH_SYMBOL::GetExcludedFromBoard ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Exclude From Simulation" ),
&SCH_SYMBOL::SetExcludedFromSim, &SCH_SYMBOL::GetExcludedFromSim ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Exclude From Bill of Materials" ),
&SCH_SYMBOL::SetExcludedFromBOM, &SCH_SYMBOL::GetExcludedFromBOM ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Do not Populate" ),
&SCH_SYMBOL::SetDNP, &SCH_SYMBOL::GetDNP ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<SYMBOL, bool>( _HKI( "Exclude From Board" ),
&SYMBOL::SetExcludedFromBoard, &SYMBOL::GetExcludedFromBoard ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<SYMBOL, bool>( _HKI( "Exclude From Simulation" ),
&SYMBOL::SetExcludedFromSim, &SYMBOL::GetExcludedFromSim ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<SYMBOL, bool>( _HKI( "Exclude From Bill of Materials" ),
&SYMBOL::SetExcludedFromBOM, &SYMBOL::GetExcludedFromBOM ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<SYMBOL, bool>( _HKI( "Do not Populate" ),
&SYMBOL::SetDNP, &SYMBOL::GetDNP ),
groupAttributes );
}
} _SCH_SYMBOL_DESC;

View File

@ -831,37 +831,6 @@ public:
bool HasBrightenedPins();
bool GetExcludedFromSim() const override { return m_excludedFromSim; }
void SetExcludedFromSim( bool aExclude ) override { m_excludedFromSim = aExclude; }
bool GetExcludedFromBOM() const { return m_excludedFromBOM; }
void SetExcludedFromBOM( bool aIncludeInBOM ) { m_excludedFromBOM = aIncludeInBOM; }
bool GetExcludedFromBoard() const { return m_excludedFromBoard; }
void SetExcludedFromBoard( bool aIncludeOnBoard ) { m_excludedFromBoard = aIncludeOnBoard; }
bool GetDNP() const { return m_DNP; }
void SetDNP( bool aDNP ) { m_DNP = aDNP; }
bool GetShowPinNumbers() const
{
return m_part && m_part->GetShowPinNumbers();
}
void SetShowPinNumbers( bool aShow )
{
if( m_part )
m_part->SetShowPinNumbers( aShow );
}
bool GetShowPinNames() const { return m_part && m_part->GetShowPinNames(); }
void SetShowPinNames( bool aShow )
{
if( m_part )
m_part->SetShowPinNames( aShow );
}
bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override;
/**
@ -899,25 +868,21 @@ private:
* multiple variants of the same library symbol. Set this member in order to preserve the
* link to the original symbol library. If empty, #LIB_ID::GetLibItemName() should be used.
*/
wxString m_schLibSymbolName;
wxString m_schLibSymbolName;
TRANSFORM m_transform; ///< The rotation/mirror transformation.
std::vector<SCH_FIELD> m_fields; ///< Variable length list of fields.
TRANSFORM m_transform; ///< The rotation/mirror transformation.
std::vector<SCH_FIELD> m_fields; ///< Variable length list of fields.
std::unique_ptr< LIB_SYMBOL > m_part; ///< a flattened copy of the LIB_SYMBOL
///< from the PROJECT's libraries.
std::vector<std::unique_ptr<SCH_PIN>> m_pins; ///< a SCH_PIN for every LIB_PIN (all units)
std::unordered_map<LIB_PIN*, SCH_PIN*> m_pinMap; ///< library pin pointer : SCH_PIN's index
std::unique_ptr<LIB_SYMBOL> m_part; ///< A flattened copy of the LIB_SYMBOL from the
///< PROJECT's libraries.
bool m_isInNetlist; ///< True if the symbol should appear in netlist
bool m_isInNetlist; ///< True if the symbol should appear in the netlist
bool m_excludedFromSim; ///< True to exclude from simulation.
bool m_excludedFromBOM; ///< True to exclude from bill of materials export.
bool m_excludedFromBoard; ///< True to exclude from netlist when updating board.
bool m_DNP; ///< True if symbol is set to 'Do Not Populate'.
std::vector<std::unique_ptr<SCH_PIN>> m_pins; ///< a SCH_PIN for every LIB_PIN (all units)
std::unordered_map<LIB_PIN*, SCH_PIN*> m_pinMap; ///< library pin pointer : SCH_PIN's index
// Defines the hierarchical path and reference of the symbol. This allows support
// for multiple references to a single sub-sheet.
std::vector<SCH_SYMBOL_INSTANCE> m_instanceReferences;
// Defines the hierarchical path and reference of the symbol. This allows support for multiple
// references to a single sub-sheet.
std::vector<SCH_SYMBOL_INSTANCE> m_instanceReferences;
/// @see SCH_SYMBOL::GetOrientation
static std::unordered_map<TRANSFORM, int> s_transformToOrientationCache;

View File

@ -41,6 +41,7 @@ public:
m_excludedFromSim = false;
m_excludedFromBOM = false;
m_excludedFromBoard = false;
m_DNP = false;
};
SYMBOL( KICAD_T idType ) :
@ -152,7 +153,13 @@ public:
void SetExcludedFromBoard( bool aExcludeFromBoard ) { m_excludedFromBoard = aExcludeFromBoard; }
bool GetExcludedFromBoard() const { return m_excludedFromBoard; }
void ViewGetLayers( int aLayers[], int& aCount ) const override;
/**
* Set or clear the 'Do Not Populate' flaga
*/
bool GetDNP() const { return m_DNP; }
void SetDNP( bool aDNP ) { m_DNP = aDNP; }
void ViewGetLayers( int aLayers[], int& aCount ) const override;
protected:
int m_pinNameOffset; ///< The offset in mils to draw the pin name. Set to
@ -163,6 +170,7 @@ protected:
bool m_excludedFromSim;
bool m_excludedFromBOM;
bool m_excludedFromBoard;
bool m_DNP; ///< True if symbol is set to 'Do Not Populate'.
};
#endif // SYMBOL_H