Changed BOARD_DESIGN_SETTINGS::m_VisibleElements from int to long, to assure at least 32 bits length (without depending on the platfrom int size).
This commit is contained in:
parent
44861f5889
commit
db252ea88c
|
@ -100,7 +100,7 @@ public:
|
||||||
* returns a bit-mask of all the element categories that are visible
|
* returns a bit-mask of all the element categories that are visible
|
||||||
* @return int - the visible element categories in bit-mapped form.
|
* @return int - the visible element categories in bit-mapped form.
|
||||||
*/
|
*/
|
||||||
int GetVisibleElements() const
|
long GetVisibleElements() const
|
||||||
{
|
{
|
||||||
return m_VisibleElements;
|
return m_VisibleElements;
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ public:
|
||||||
* changes the bit-mask of visible element categories
|
* changes the bit-mask of visible element categories
|
||||||
* @param aMask = The new bit-mask of visible element categories
|
* @param aMask = The new bit-mask of visible element categories
|
||||||
*/
|
*/
|
||||||
void SetVisibleElements( int aMask )
|
void SetVisibleElements( long aMask )
|
||||||
{
|
{
|
||||||
m_VisibleElements = aMask;
|
m_VisibleElements = aMask;
|
||||||
}
|
}
|
||||||
|
@ -119,23 +119,25 @@ public:
|
||||||
* Function IsElementVisible
|
* Function IsElementVisible
|
||||||
* tests whether a given element category is visible. Keep this as an
|
* tests whether a given element category is visible. Keep this as an
|
||||||
* inline function.
|
* inline function.
|
||||||
* @param aPCB_VISIBLE is from the enum by the same name
|
* @param aElementCategory is from the enum by the same name
|
||||||
* @return bool - true if the element is visible.
|
* @return bool - true if the element is visible.
|
||||||
* @see enum PCB_VISIBLE
|
* @see enum PCB_VISIBLE
|
||||||
*/
|
*/
|
||||||
bool IsElementVisible( int aPCB_VISIBLE ) const
|
bool IsElementVisible( int aElementCategory ) const
|
||||||
{
|
{
|
||||||
return bool( m_VisibleElements & (1 << aPCB_VISIBLE) );
|
assert( aElementCategory >= 0 && aElementCategory < END_PCB_VISIBLE_LIST );
|
||||||
|
|
||||||
|
return ( m_VisibleElements & ( 1 << aElementCategory ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function SetElementVisibility
|
* Function SetElementVisibility
|
||||||
* changes the visibility of an element category
|
* changes the visibility of an element category
|
||||||
* @param aPCB_VISIBLE is from the enum by the same name
|
* @param aElementCategory is from the enum by the same name
|
||||||
* @param aNewState = The new visibility state of the element category
|
* @param aNewState = The new visibility state of the element category
|
||||||
* @see enum PCB_VISIBLE
|
* @see enum PCB_VISIBLE
|
||||||
*/
|
*/
|
||||||
void SetElementVisibility( int aPCB_VISIBLE, bool aNewState );
|
void SetElementVisibility( int aElementCategory, bool aNewState );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetEnabledLayers
|
* Function GetEnabledLayers
|
||||||
|
@ -196,7 +198,7 @@ private:
|
||||||
int m_CopperLayerCount; ///< Number of copper layers for this design
|
int m_CopperLayerCount; ///< Number of copper layers for this design
|
||||||
LAYER_MSK m_EnabledLayers; ///< Bit-mask for layer enabling
|
LAYER_MSK m_EnabledLayers; ///< Bit-mask for layer enabling
|
||||||
LAYER_MSK m_VisibleLayers; ///< Bit-mask for layer visibility
|
LAYER_MSK m_VisibleLayers; ///< Bit-mask for layer visibility
|
||||||
int m_VisibleElements; ///< Bit-mask for element category visibility
|
long m_VisibleElements; ///< Bit-mask for element category visibility
|
||||||
int m_boardThickness; ///< Board thickness for 3D viewer
|
int m_boardThickness; ///< Board thickness for 3D viewer
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -647,7 +647,7 @@ void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const
|
||||||
FMTIU( aBoard->GetGridOrigin().x ).c_str(),
|
FMTIU( aBoard->GetGridOrigin().x ).c_str(),
|
||||||
FMTIU( aBoard->GetGridOrigin().y ).c_str() );
|
FMTIU( aBoard->GetGridOrigin().y ).c_str() );
|
||||||
|
|
||||||
m_out->Print( aNestLevel+1, "(visible_elements %X)\n",
|
m_out->Print( aNestLevel+1, "(visible_elements %lX)\n",
|
||||||
aBoard->GetDesignSettings().GetVisibleElements() );
|
aBoard->GetDesignSettings().GetVisibleElements() );
|
||||||
|
|
||||||
aBoard->GetPlotOptions().Format( m_out, aNestLevel+1 );
|
aBoard->GetPlotOptions().Format( m_out, aNestLevel+1 );
|
||||||
|
|
|
@ -870,7 +870,7 @@ void LEGACY_PLUGIN::loadSETUP()
|
||||||
|
|
||||||
else if( TESTLINE( "VisibleElements" ) )
|
else if( TESTLINE( "VisibleElements" ) )
|
||||||
{
|
{
|
||||||
int visibleElements = hexParse( line + SZ( "VisibleElements" ) );
|
long visibleElements = hexParse( line + SZ( "VisibleElements" ) );
|
||||||
bds.SetVisibleElements( visibleElements );
|
bds.SetVisibleElements( visibleElements );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3071,7 +3071,7 @@ void LEGACY_PLUGIN::saveSETUP( const BOARD* aBoard ) const
|
||||||
fprintf( m_fp, "GridOrigin %s\n", fmtBIUPoint( aBoard->GetGridOrigin() ).c_str() );
|
fprintf( m_fp, "GridOrigin %s\n", fmtBIUPoint( aBoard->GetGridOrigin() ).c_str() );
|
||||||
fprintf( m_fp, "AuxiliaryAxisOrg %s\n", fmtBIUPoint( aBoard->GetAuxOrigin() ).c_str() );
|
fprintf( m_fp, "AuxiliaryAxisOrg %s\n", fmtBIUPoint( aBoard->GetAuxOrigin() ).c_str() );
|
||||||
|
|
||||||
fprintf( m_fp, "VisibleElements %X\n", bds.GetVisibleElements() );
|
fprintf( m_fp, "VisibleElements %lX\n", bds.GetVisibleElements() );
|
||||||
|
|
||||||
{
|
{
|
||||||
STRING_FORMATTER sf;
|
STRING_FORMATTER sf;
|
||||||
|
|
Loading…
Reference in New Issue