Eeschema: remove dead code from LIB_PART object.

(cherry picked from commit 9020a3a26c)
This commit is contained in:
Wayne Stambaugh 2019-08-12 12:13:21 -04:00
parent e8ab661504
commit 2a9412042c
2 changed files with 2 additions and 76 deletions

View File

@ -64,9 +64,7 @@ int LIB_PART::m_subpartFirstId = 'A';
LIB_ALIAS::LIB_ALIAS( const wxString& aName, LIB_PART* aRootPart ) : LIB_ALIAS::LIB_ALIAS( const wxString& aName, LIB_PART* aRootPart ) :
EDA_ITEM( LIB_ALIAS_T ), EDA_ITEM( LIB_ALIAS_T ),
shared( aRootPart ), shared( aRootPart )
tmpUnit( 0 ),
tmpConversion( 0 )
{ {
SetName( aName ); SetName( aName );
} }
@ -74,9 +72,7 @@ LIB_ALIAS::LIB_ALIAS( const wxString& aName, LIB_PART* aRootPart ) :
LIB_ALIAS::LIB_ALIAS( const LIB_ALIAS& aAlias, LIB_PART* aRootPart ) : LIB_ALIAS::LIB_ALIAS( const LIB_ALIAS& aAlias, LIB_PART* aRootPart ) :
EDA_ITEM( aAlias ), EDA_ITEM( aAlias ),
shared( aRootPart ), shared( aRootPart )
tmpUnit( 0 ),
tmpConversion( 0 )
{ {
name = aAlias.name; name = aAlias.name;
@ -931,45 +927,6 @@ LIB_FIELD& LIB_PART::GetFootprintField()
} }
bool LIB_PART::SaveDateAndTime( OUTPUTFORMATTER& aFormatter )
{
int year, mon, day, hour, min, sec;
if( m_dateLastEdition == 0 )
return true;
sec = m_dateLastEdition & 63;
min = ( m_dateLastEdition >> 6 ) & 63;
hour = ( m_dateLastEdition >> 12 ) & 31;
day = ( m_dateLastEdition >> 17 ) & 31;
mon = ( m_dateLastEdition >> 22 ) & 15;
year = ( m_dateLastEdition >> 26 ) + 1990;
aFormatter.Print( 0, "Ti %d/%d/%d %d:%d:%d\n", year, mon, day, hour, min, sec );
return true;
}
bool LIB_PART::LoadDateAndTime( char* aLine )
{
int year, mon, day, hour, min, sec;
year = mon = day = hour = min = sec = 0;
strtok( aLine, " \r\t\n" );
strtok( NULL, " \r\t\n" );
if( sscanf( aLine, "%d/%d/%d %d:%d:%d", &year, &mon, &day, &hour, &min, &sec ) != 6 )
return false;
m_dateLastEdition = ( sec & 63 ) + ( ( min & 63 ) << 6 ) +
( ( hour & 31 ) << 12 ) + ( ( day & 31 ) << 17 ) +
( ( mon & 15 ) << 22 ) + ( ( year - 1990 ) << 26 );
return true;
}
void LIB_PART::SetOffset( const wxPoint& aOffset ) void LIB_PART::SetOffset( const wxPoint& aOffset )
{ {
for( LIB_ITEM& item : m_drawings ) for( LIB_ITEM& item : m_drawings )

View File

@ -87,9 +87,6 @@ protected:
wxString keyWords; ///< keyword list (used for search for parts by keyword) wxString keyWords; ///< keyword list (used for search for parts by keyword)
wxString docFileName; ///< Associate doc file name wxString docFileName; ///< Associate doc file name
int tmpUnit; ///< Temporary unit designator (used for rendering)
int tmpConversion; ///< Temporary conversion designator (used for rendering)
public: public:
LIB_ALIAS( const wxString& aName, LIB_PART* aRootComponent ); LIB_ALIAS( const wxString& aName, LIB_PART* aRootComponent );
LIB_ALIAS( const LIB_ALIAS& aAlias, LIB_PART* aRootComponent = NULL ); LIB_ALIAS( const LIB_ALIAS& aAlias, LIB_PART* aRootComponent = NULL );
@ -174,12 +171,6 @@ public:
*/ */
wxString GetUnitReference( int aUnit ) override; wxString GetUnitReference( int aUnit ) override;
/**
* A temporary conversion (deMorgan) designation for rendering, preview, etc.
*/
void SetTmpConversion( int aConversion ) { tmpConversion = aConversion; }
int GetTmpConversion() { return tmpConversion; }
/** /**
* KEEPCASE sensitive comparison of the part entry name. * KEEPCASE sensitive comparison of the part entry name.
*/ */
@ -272,8 +263,6 @@ class LIB_PART : public EDA_ITEM
private: private:
void deleteAllFields(); void deleteAllFields();
public: public:
LIB_PART( const wxString& aName, PART_LIB* aLibrary = NULL ); LIB_PART( const wxString& aName, PART_LIB* aLibrary = NULL );
@ -377,26 +366,6 @@ public:
return GetUnitBoundingBox( 0, 0 ); return GetUnitBoundingBox( 0, 0 );
} }
/**
* Write the date and time of part to \a aFile in the format:
* "Ti yy/mm/jj hh:mm:ss"
*
* @param aFormatter A reference to an #OUTPUTFORMATTER object containing the
* output format to write to.
* @return True if the date and time were successfully written to \a aFormatter.
*/
bool SaveDateAndTime( OUTPUTFORMATTER& aFormatter );
bool LoadDateAndTime( char* aLine );
/**
* Write the data structures out to \a aFormatter in the part library "*.lib" format.
*
* @param aFormatter A reference to an OUTPUTFORMATTER to write to.
* @return True if success writing else false.
*/
bool Save( OUTPUTFORMATTER& aFormatter );
bool IsPower() const { return m_options == ENTRY_POWER; } bool IsPower() const { return m_options == ENTRY_POWER; }
bool IsNormal() const { return m_options == ENTRY_NORMAL; } bool IsNormal() const { return m_options == ENTRY_NORMAL; }