Change KUUID to KIID.

This commit is contained in:
Jeff Young 2020-02-21 22:20:42 +00:00
parent 383403ef98
commit ea025a35e5
28 changed files with 107 additions and 106 deletions

View File

@ -51,10 +51,10 @@ static boost::uuids::string_generator stringGenerator;
static boost::uuids::nil_generator nilGenerator; static boost::uuids::nil_generator nilGenerator;
// Global nil reference // Global nil reference
KUUID niluuid( 0 ); KIID niluuid( 0 );
KUUID::KUUID() : KIID::KIID() :
m_uuid( randomGenerator() ), m_uuid( randomGenerator() ),
m_cached_timestamp( 0 ) m_cached_timestamp( 0 )
{ {
@ -73,7 +73,7 @@ KUUID::KUUID() :
} }
KUUID::KUUID( int null ) : KIID::KIID( int null ) :
m_uuid( nilGenerator() ), m_uuid( nilGenerator() ),
m_cached_timestamp( 0 ) m_cached_timestamp( 0 )
{ {
@ -81,7 +81,7 @@ KUUID::KUUID( int null ) :
} }
KUUID::KUUID( const wxString& aString ) : KIID::KIID( const wxString& aString ) :
m_uuid(), m_uuid(),
m_cached_timestamp( 0 ) m_cached_timestamp( 0 )
{ {
@ -117,7 +117,7 @@ KUUID::KUUID( const wxString& aString ) :
} }
KUUID::KUUID( timestamp_t aTimestamp ) KIID::KIID( timestamp_t aTimestamp )
{ {
m_cached_timestamp = aTimestamp; m_cached_timestamp = aTimestamp;
@ -134,19 +134,19 @@ KUUID::KUUID( timestamp_t aTimestamp )
} }
bool KUUID::IsLegacyTimestamp() const bool KIID::IsLegacyTimestamp() const
{ {
return !m_uuid.data[8] && !m_uuid.data[9] && !m_uuid.data[10] && !m_uuid.data[11]; return !m_uuid.data[8] && !m_uuid.data[9] && !m_uuid.data[10] && !m_uuid.data[11];
} }
timestamp_t KUUID::AsLegacyTimestamp() const timestamp_t KIID::AsLegacyTimestamp() const
{ {
return m_cached_timestamp; return m_cached_timestamp;
} }
size_t KUUID::Hash() const size_t KIID::Hash() const
{ {
size_t hash = 0; size_t hash = 0;
@ -160,20 +160,20 @@ size_t KUUID::Hash() const
} }
void KUUID::Clone( const KUUID& aUUID ) void KIID::Clone( const KIID& aUUID )
{ {
m_uuid = aUUID.m_uuid; m_uuid = aUUID.m_uuid;
m_cached_timestamp = aUUID.m_cached_timestamp; m_cached_timestamp = aUUID.m_cached_timestamp;
} }
wxString KUUID::AsString() const wxString KIID::AsString() const
{ {
return boost::uuids::to_string( m_uuid ); return boost::uuids::to_string( m_uuid );
} }
wxString KUUID::AsLegacyTimestampString() const wxString KIID::AsLegacyTimestampString() const
{ {
return wxString::Format( "%8.8lX", (unsigned long) AsLegacyTimestamp() ); return wxString::Format( "%8.8lX", (unsigned long) AsLegacyTimestamp() );
} }

View File

@ -168,7 +168,7 @@ const wxString PROJECT::libTableName( const wxString& aLibTableName ) const
} }
const wxString PROJECT::GetSheetName( const KUUID& aSheetID ) const wxString PROJECT::GetSheetName( const KIID& aSheetID )
{ {
if( m_sheetNames.empty() ) if( m_sheetNames.empty() )
{ {
@ -184,7 +184,7 @@ const wxString PROJECT::GetSheetName( const KUUID& aSheetID )
wxArrayString tokens = wxSplit( entry, ':' ); wxArrayString tokens = wxSplit( entry, ':' );
if( tokens.size() == 2 ) if( tokens.size() == 2 )
m_sheetNames[ KUUID( tokens[0] ) ] = tokens[1]; m_sheetNames[ KIID( tokens[0] ) ] = tokens[1];
} }
} }

View File

@ -33,7 +33,7 @@
#include <class_library.h> #include <class_library.h>
void mapExistingAnnotation( std::map<KUUID, wxString>& aMap ) void mapExistingAnnotation( std::map<KIID, wxString>& aMap )
{ {
SCH_SHEET_LIST sheets( g_RootSheet ); SCH_SHEET_LIST sheets( g_RootSheet );
SCH_REFERENCE_LIST references; SCH_REFERENCE_LIST references;
@ -94,7 +94,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
SCH_MULTI_UNIT_REFERENCE_MAP lockedComponents; SCH_MULTI_UNIT_REFERENCE_MAP lockedComponents;
// Map of previous annotation for building info messages // Map of previous annotation for building info messages
std::map<KUUID, wxString> previousAnnotation; std::map<KIID, wxString> previousAnnotation;
// Test for and replace duplicate time stamps in components and sheets. Duplicate // Test for and replace duplicate time stamps in components and sheets. Duplicate
// time stamps can happen with old schematics, schematic conversions, or manual // time stamps can happen with old schematics, schematic conversions, or manual

View File

@ -184,7 +184,7 @@ protected:
// Data store // Data store
// A map of compID : fieldSet, where fieldSet is a map of fieldName : fieldValue // A map of compID : fieldSet, where fieldSet is a map of fieldName : fieldValue
std::map< KUUID, std::map<wxString, wxString> > m_dataStore; std::map< KIID, std::map<wxString, wxString> > m_dataStore;
public: public:
@ -269,7 +269,7 @@ public:
} }
else // Other columns are either a single value or ROW_MULTI_ITEMS else // Other columns are either a single value or ROW_MULTI_ITEMS
{ {
const KUUID& compID = ref.GetComp()->m_Uuid; const KIID& compID = ref.GetComp()->m_Uuid;
if( !m_dataStore.count( compID ) || if( !m_dataStore.count( compID ) ||
!m_dataStore[ compID ].count( m_fieldNames[ aCol ] ) ) !m_dataStore[ compID ].count( m_fieldNames[ aCol ] ) )
@ -418,8 +418,8 @@ public:
matchFound = true; matchFound = true;
} }
const KUUID& lhRefID = lhRef.GetComp()->m_Uuid; const KIID& lhRefID = lhRef.GetComp()->m_Uuid;
const KUUID& rhRefID = rhRef.GetComp()->m_Uuid; const KIID& rhRefID = rhRef.GetComp()->m_Uuid;
// Now check all the other columns. This must be done out of the dataStore // Now check all the other columns. This must be done out of the dataStore
// for the refresh button to work after editing. // for the refresh button to work after editing.
@ -647,8 +647,9 @@ public:
for( unsigned compRef = 0; compRef < m_componentRefs.GetCount(); ++ compRef ) for( unsigned compRef = 0; compRef < m_componentRefs.GetCount(); ++ compRef )
{ {
const KUUID& compId = m_componentRefs[ compRef ].GetComp()->m_Uuid; const KIID& compId = m_componentRefs[ compRef ].GetComp()->m_Uuid;
wxString text = m_dataStore[ compId ][ column_label ]; wxString text = m_dataStore[ compId ][ column_label ];
width = std::max( width, GetTextSize( text, GetView() ).x ); width = std::max( width, GetTextSize( text, GetView() ).x );
} }
} }

View File

@ -179,7 +179,7 @@ SCH_COMPONENT::SCH_COMPONENT( const SCH_COMPONENT& aComponent ) :
if( aComponent.m_part ) if( aComponent.m_part )
m_part.reset( new LIB_PART( *aComponent.m_part.get() ) ); m_part.reset( new LIB_PART( *aComponent.m_part.get() ) );
const_cast<KUUID&>( m_Uuid ) = aComponent.m_Uuid; const_cast<KIID&>( m_Uuid ) = aComponent.m_Uuid;
m_transform = aComponent.m_transform; m_transform = aComponent.m_transform;
m_prefix = aComponent.m_prefix; m_prefix = aComponent.m_prefix;

View File

@ -77,7 +77,7 @@ SCH_ITEM* SCH_ITEM::Duplicate( bool doClone ) const
SCH_ITEM* newItem = (SCH_ITEM*) Clone(); SCH_ITEM* newItem = (SCH_ITEM*) Clone();
if( !doClone ) if( !doClone )
const_cast<KUUID&>( newItem->m_Uuid ) = KUUID(); const_cast<KIID&>( newItem->m_Uuid ) = KIID();
newItem->ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED ); newItem->ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED );

View File

@ -984,7 +984,7 @@ SCH_SHEET* SCH_LEGACY_PLUGIN::loadSheet( LINE_READER& aReader )
{ {
wxString text; wxString text;
parseUnquotedString( text, aReader, line ); parseUnquotedString( text, aReader, line );
const_cast<KUUID&>( sheet->m_Uuid ) = KUUID( text ); const_cast<KIID&>( sheet->m_Uuid ) = KIID( text );
} }
else if( *line == 'F' ) // Sheet field. else if( *line == 'F' ) // Sheet field.
{ {
@ -1564,7 +1564,7 @@ SCH_COMPONENT* SCH_LEGACY_PLUGIN::loadComponent( LINE_READER& aReader )
wxString text; wxString text;
parseUnquotedString( text, aReader, line, &line ); parseUnquotedString( text, aReader, line, &line );
const_cast<KUUID&>( component->m_Uuid ) = KUUID( text ); const_cast<KIID&>( component->m_Uuid ) = KIID( text );
} }
else if( strCompare( "P", line, &line ) ) else if( strCompare( "P", line, &line ) )
{ {

View File

@ -60,7 +60,7 @@ class SCH_REFERENCE
SCH_SHEET_PATH m_SheetPath; ///< The sheet path for this reference. SCH_SHEET_PATH m_SheetPath; ///< The sheet path for this reference.
bool m_IsNew; ///< True if not yet annotated. bool m_IsNew; ///< True if not yet annotated.
int m_SheetNum; ///< The sheet number for the reference. int m_SheetNum; ///< The sheet number for the reference.
KUUID m_Uuid; ///< UUID of the component. KIID m_Uuid; ///< UUID of the component.
EDA_TEXT* m_Value; ///< The component value of the reference. It is the EDA_TEXT* m_Value; ///< The component value of the reference. It is the
///< same for all instances. ///< same for all instances.
int m_NumRef; ///< The numeric part of the reference designator. int m_NumRef; ///< The numeric part of the reference designator.

View File

@ -1086,7 +1086,7 @@ int SCH_SCREENS::ReplaceDuplicateTimeStamps()
// Reset to fully random UUID. This may lose reference, but better to be // Reset to fully random UUID. This may lose reference, but better to be
// deterministic about it rather than to have duplicate UUIDs with random // deterministic about it rather than to have duplicate UUIDs with random
// side-effects. // side-effects.
const_cast<KUUID&>( item->m_Uuid ) = KUUID(); const_cast<KIID&>( item->m_Uuid ) = KIID();
count++; count++;
} }
} }

View File

@ -60,7 +60,7 @@ SCH_SHEET::SCH_SHEET( const SCH_SHEET& aSheet ) :
m_pos = aSheet.m_pos; m_pos = aSheet.m_pos;
m_size = aSheet.m_size; m_size = aSheet.m_size;
m_Layer = aSheet.m_Layer; m_Layer = aSheet.m_Layer;
const_cast<KUUID&>( m_Uuid ) = aSheet.m_Uuid; const_cast<KIID&>( m_Uuid ) = aSheet.m_Uuid;
m_showSheetName = aSheet.m_showSheetName; m_showSheetName = aSheet.m_showSheetName;
m_sheetNameSize = aSheet.m_sheetNameSize; m_sheetNameSize = aSheet.m_sheetNameSize;
m_showFileName = aSheet.m_showFileName; m_showFileName = aSheet.m_showFileName;

View File

@ -1055,7 +1055,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
if( dropAnnotations ) if( dropAnnotations )
{ {
const_cast<KUUID&>( component->m_Uuid ) = KUUID(); const_cast<KIID&>( component->m_Uuid ) = KIID();
// clear the annotation, but preserve the selected unit // clear the annotation, but preserve the selected unit
int unit = component->GetUnit(); int unit = component->GetUnit();
@ -1069,7 +1069,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
else else
{ {
// Everything else gets a new UUID // Everything else gets a new UUID
const_cast<KUUID&>( item->m_Uuid ) = KUUID(); const_cast<KIID&>( item->m_Uuid ) = KIID();
} }
if( item->Type() == SCH_SHEET_T ) if( item->Type() == SCH_SHEET_T )

View File

@ -163,7 +163,7 @@ typedef unsigned STATUS_FLAGS;
class EDA_ITEM : public KIGFX::VIEW_ITEM class EDA_ITEM : public KIGFX::VIEW_ITEM
{ {
public: public:
const KUUID m_Uuid; const KIID m_Uuid;
private: private:

View File

@ -165,7 +165,7 @@ public:
BOARD_ITEM* Duplicate() const BOARD_ITEM* Duplicate() const
{ {
EDA_ITEM* dupe = Clone(); EDA_ITEM* dupe = Clone();
const_cast<KUUID&>( dupe->m_Uuid ) = KUUID(); const_cast<KIID&>( dupe->m_Uuid ) = KIID();
return static_cast<BOARD_ITEM*>( dupe ); return static_cast<BOARD_ITEM*>( dupe );
} }

View File

@ -62,15 +62,15 @@ class REPORTER;
*/ */
typedef uint32_t timestamp_t; typedef uint32_t timestamp_t;
class KUUID class KIID
{ {
public: public:
KUUID(); KIID();
KUUID( int null ); KIID( int null );
KUUID( const wxString& aString ); KIID( const wxString& aString );
KUUID( timestamp_t aTimestamp ); KIID( timestamp_t aTimestamp );
void Clone( const KUUID& aUUID ); void Clone( const KIID& aUUID );
size_t Hash() const; size_t Hash() const;
@ -80,17 +80,17 @@ public:
wxString AsString() const; wxString AsString() const;
wxString AsLegacyTimestampString() const; wxString AsLegacyTimestampString() const;
bool operator==( KUUID const& rhs) const bool operator==( KIID const& rhs) const
{ {
return m_uuid == rhs.m_uuid; return m_uuid == rhs.m_uuid;
} }
bool operator!=( KUUID const& rhs) const bool operator!=( KIID const& rhs) const
{ {
return m_uuid != rhs.m_uuid; return m_uuid != rhs.m_uuid;
} }
bool operator<( KUUID const& rhs) const bool operator<( KIID const& rhs) const
{ {
return m_uuid < rhs.m_uuid; return m_uuid < rhs.m_uuid;
} }
@ -102,21 +102,21 @@ private:
}; };
extern KUUID niluuid; extern KIID niluuid;
class UUID_PATH : public std::vector<KUUID> class KIID_PATH : public std::vector<KIID>
{ {
public: public:
UUID_PATH() KIID_PATH()
{} {}
UUID_PATH( const wxString& aString ) KIID_PATH( const wxString& aString )
{ {
for( const wxString& pathStep : wxSplit( aString, '/' ) ) for( const wxString& pathStep : wxSplit( aString, '/' ) )
{ {
if( !pathStep.empty() ) if( !pathStep.empty() )
emplace_back( KUUID( pathStep ) ); emplace_back( KIID( pathStep ) );
} }
} }
@ -124,13 +124,13 @@ public:
{ {
wxString path; wxString path;
for( const KUUID& pathStep : *this ) for( const KIID& pathStep : *this )
path += '/' + pathStep.AsString(); path += '/' + pathStep.AsString();
return path; return path;
} }
bool operator==( UUID_PATH const& rhs) const bool operator==( KIID_PATH const& rhs) const
{ {
if( size() != rhs.size() ) if( size() != rhs.size() )
return false; return false;
@ -144,7 +144,7 @@ public:
return true; return true;
} }
bool operator<( UUID_PATH const& rhs) const bool operator<( KIID_PATH const& rhs) const
{ {
if( size() != rhs.size() ) if( size() != rhs.size() )
return size() < rhs.size(); return size() < rhs.size();

View File

@ -115,7 +115,7 @@ public:
/** /**
* Return the name of the sheet identified by the given UUID. * Return the name of the sheet identified by the given UUID.
*/ */
VTBL_ENTRY const wxString GetSheetName( const KUUID& aSheetID ); VTBL_ENTRY const wxString GetSheetName( const KIID& aSheetID );
/** /**
* Function FootprintLibTblName * Function FootprintLibTblName
@ -337,7 +337,7 @@ private:
wxFileName m_project_name; ///< \<fullpath\>/\<basename\>.pro wxFileName m_project_name; ///< \<fullpath\>/\<basename\>.pro
wxString m_pro_date_and_time; wxString m_pro_date_and_time;
std::map<KUUID, wxString> m_sheetNames; std::map<KIID, wxString> m_sheetNames;
/// @see this::SetRString(), GetRString(), and enum RSTRING_T. /// @see this::SetRString(), GetRString(), and enum RSTRING_T.
wxString m_rstrings[RSTRING_COUNT]; wxString m_rstrings[RSTRING_COUNT];

View File

@ -1076,7 +1076,7 @@ MODULE* BOARD::FindModuleByReference( const wxString& aReference ) const
} }
MODULE* BOARD::FindModuleByPath( const UUID_PATH& aPath ) const MODULE* BOARD::FindModuleByPath( const KIID_PATH& aPath ) const
{ {
for( MODULE* module : m_modules ) for( MODULE* module : m_modules )
{ {

View File

@ -827,7 +827,7 @@ public:
* @param aPath The path ([sheetUUID, .., symbolUUID]) to search for. * @param aPath The path ([sheetUUID, .., symbolUUID]) to search for.
* @return MODULE* - If found, the MODULE having the given uuid, else NULL. * @return MODULE* - If found, the MODULE having the given uuid, else NULL.
*/ */
MODULE* FindModuleByPath( const UUID_PATH& aPath ) const; MODULE* FindModuleByPath( const KIID_PATH& aPath ) const;
/** /**
* Function SortedNetnamesList * Function SortedNetnamesList

View File

@ -225,8 +225,8 @@ public:
const wxString& GetKeywords() const { return m_KeyWord; } const wxString& GetKeywords() const { return m_KeyWord; }
void SetKeywords( const wxString& aKeywords ) { m_KeyWord = aKeywords; } void SetKeywords( const wxString& aKeywords ) { m_KeyWord = aKeywords; }
const UUID_PATH& GetPath() const { return m_Path; } const KIID_PATH& GetPath() const { return m_Path; }
void SetPath( const UUID_PATH& aPath ) { m_Path = aPath; } void SetPath( const KIID_PATH& aPath ) { m_Path = aPath; }
int GetLocalSolderMaskMargin() const { return m_LocalSolderMaskMargin; } int GetLocalSolderMaskMargin() const { return m_LocalSolderMaskMargin; }
void SetLocalSolderMaskMargin( int aMargin ) { m_LocalSolderMaskMargin = aMargin; } void SetLocalSolderMaskMargin( int aMargin ) { m_LocalSolderMaskMargin = aMargin; }
@ -546,8 +546,8 @@ public:
double GetArea( int aPadding = 0 ) const; double GetArea( int aPadding = 0 ) const;
KUUID GetLink() const { return m_Link; } KIID GetLink() const { return m_Link; }
void SetLink( const KUUID& aLink ) { m_Link = aLink; } void SetLink( const KIID& aLink ) { m_Link = aLink; }
int GetPlacementCost180() const { return m_CntRot180; } int GetPlacementCost180() const { return m_CntRot180; }
void SetPlacementCost180( int aCost ) { m_CntRot180 = aCost; } void SetPlacementCost180( int aCost ) { m_CntRot180 = aCost; }
@ -705,10 +705,10 @@ private:
wxString m_Doc; // File name and path for documentation file. wxString m_Doc; // File name and path for documentation file.
wxString m_KeyWord; // Search keywords to find module in library. wxString m_KeyWord; // Search keywords to find module in library.
UUID_PATH m_Path; // Path to associated symbol ([sheetUUID, .., symbolUUID]). KIID_PATH m_Path; // Path to associated symbol ([sheetUUID, .., symbolUUID]).
timestamp_t m_LastEditTime; timestamp_t m_LastEditTime;
int m_arflag; // Use to trace ratsnest and auto routing. int m_arflag; // Use to trace ratsnest and auto routing.
KUUID m_Link; // Temporary logical link used during editing KIID m_Link; // Temporary logical link used during editing
int m_CntRot90; // Horizontal automatic placement cost ( 0..10 ). int m_CntRot90; // Horizontal automatic placement cost ( 0..10 ).
int m_CntRot180; // Vertical automatic placement cost ( 0..10 ). int m_CntRot180; // Vertical automatic placement cost ( 0..10 ).

View File

@ -488,7 +488,7 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aSrc, MODULE* aDest, BOARD_COMMIT&
aDest->Models() = aSrc->Models(); // Linked list of 3D models. aDest->Models() = aSrc->Models(); // Linked list of 3D models.
// Updating other parameters // Updating other parameters
const_cast<KUUID&>( aDest->m_Uuid ) = aSrc->m_Uuid; const_cast<KIID&>( aDest->m_Uuid ) = aSrc->m_Uuid;
aDest->SetPath( aSrc->GetPath() ); aDest->SetPath( aSrc->GetPath() );
aDest->CalculateBoundingBox(); aDest->CalculateBoundingBox();

View File

@ -826,7 +826,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew )
// and connexions are kept) // and connexions are kept)
// and the source_module (old module) is deleted // and the source_module (old module) is deleted
pcbframe->Exchange_Module( source_module, newmodule, commit ); pcbframe->Exchange_Module( source_module, newmodule, commit );
const_cast<KUUID&>( newmodule->m_Uuid ) = module_in_edit->GetLink(); const_cast<KIID&>( newmodule->m_Uuid ) = module_in_edit->GetLink();
commit.Push( wxT( "Update module" ) ); commit.Push( wxT( "Update module" ) );
} }
else // This is an insert command else // This is an insert command
@ -839,7 +839,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew )
pcbframe->PlaceModule( newmodule ); pcbframe->PlaceModule( newmodule );
newmodule->SetPosition( wxPoint( 0, 0 ) ); newmodule->SetPosition( wxPoint( 0, 0 ) );
viewControls->SetCrossHairCursorPosition( cursorPos, false ); viewControls->SetCrossHairCursorPosition( cursorPos, false );
const_cast<KUUID&>( newmodule->m_Uuid ) = KUUID(); const_cast<KIID&>( newmodule->m_Uuid ) = KIID();
commit.Push( wxT( "Insert module" ) ); commit.Push( wxT( "Insert module" ) );
pcbframe->Raise(); pcbframe->Raise();

View File

@ -1236,7 +1236,7 @@ void LEGACY_PLUGIN::loadMODULE( MODULE* aModule )
aModule->SetPosition( wxPoint( pos_x, pos_y ) ); aModule->SetPosition( wxPoint( pos_x, pos_y ) );
aModule->SetLayer( layer_id ); aModule->SetLayer( layer_id );
aModule->SetOrientation( orient ); aModule->SetOrientation( orient );
const_cast<KUUID&>( aModule->m_Uuid ) = KUUID( uuid ); const_cast<KIID&>( aModule->m_Uuid ) = KIID( uuid );
aModule->SetLastEditTime( edittime ); aModule->SetLastEditTime( edittime );
} }
@ -1252,7 +1252,7 @@ void LEGACY_PLUGIN::loadMODULE( MODULE* aModule )
else if( TESTLINE( "Sc" ) ) // timestamp else if( TESTLINE( "Sc" ) ) // timestamp
{ {
char* uuid = strtok_r( (char*) line + SZ( "Sc" ), delims, (char**) &data ); char* uuid = strtok_r( (char*) line + SZ( "Sc" ), delims, (char**) &data );
const_cast<KUUID&>( aModule->m_Uuid ) = KUUID( uuid ); const_cast<KIID&>( aModule->m_Uuid ) = KIID( uuid );
} }
else if( TESTLINE( "Op" ) ) // (Op)tions for auto placement else if( TESTLINE( "Op" ) ) // (Op)tions for auto placement
@ -1298,7 +1298,7 @@ void LEGACY_PLUGIN::loadMODULE( MODULE* aModule )
data = strtok_r( line + SZ( "AR" ), delims, (char**) &data ); data = strtok_r( line + SZ( "AR" ), delims, (char**) &data );
if( data ) if( data )
aModule->SetPath( UUID_PATH( FROM_UTF8( data ) ) ); aModule->SetPath( KIID_PATH( FROM_UTF8( data ) ) );
} }
else if( TESTLINE( "$SHAPE3D" ) ) else if( TESTLINE( "$SHAPE3D" ) )
@ -1969,7 +1969,7 @@ void LEGACY_PLUGIN::loadPCB_LINE()
dseg->SetAngle( angle ); // m_Angle dseg->SetAngle( angle ); // m_Angle
break; break;
case 3: case 3:
const_cast<KUUID&>( dseg->m_Uuid ) = KUUID( data ); const_cast<KIID&>( dseg->m_Uuid ) = KIID( data );
break; break;
case 4: case 4:
STATUS_FLAGS state; STATUS_FLAGS state;
@ -2152,7 +2152,7 @@ void LEGACY_PLUGIN::loadPCB_TEXT()
char* vJustify = strtok_r( NULL, delims, (char**) &data ); char* vJustify = strtok_r( NULL, delims, (char**) &data );
pcbtxt->SetMirrored( !notMirrored ); pcbtxt->SetMirrored( !notMirrored );
const_cast<KUUID&>( pcbtxt->m_Uuid ) = KUUID( uuid ); const_cast<KIID&>( pcbtxt->m_Uuid ) = KIID( uuid );
pcbtxt->SetItalic( !strcmp( style, "Italic" ) ); pcbtxt->SetItalic( !strcmp( style, "Italic" ) );
if( hJustify ) if( hJustify )
@ -2274,7 +2274,7 @@ void LEGACY_PLUGIN::loadTrackList( int aStructType )
case PCB_VIA_T: newTrack = new VIA( m_board ); break; case PCB_VIA_T: newTrack = new VIA( m_board ); break;
} }
const_cast<KUUID&>( newTrack->m_Uuid ) = KUUID( uuid ); const_cast<KIID&>( newTrack->m_Uuid ) = KIID( uuid );
newTrack->SetPosition( wxPoint( start_x, start_y ) ); newTrack->SetPosition( wxPoint( start_x, start_y ) );
newTrack->SetEnd( wxPoint( end_x, end_y ) ); newTrack->SetEnd( wxPoint( end_x, end_y ) );
@ -2471,7 +2471,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
if( ReadDelimitedText( buf, data, sizeof(buf) ) > (int) sizeof(buf) ) if( ReadDelimitedText( buf, data, sizeof(buf) ) > (int) sizeof(buf) )
THROW_IO_ERROR( "ZInfo netname too long" ); THROW_IO_ERROR( "ZInfo netname too long" );
const_cast<KUUID&>( zc->m_Uuid ) = KUUID( uuid ); const_cast<KIID&>( zc->m_Uuid ) = KIID( uuid );
// Init the net code only, not the netname, to be sure // Init the net code only, not the netname, to be sure
// the zone net name is the name read in file. // the zone net name is the name read in file.
// (When mismatch, the user will be prompted in DRC, to fix the actual name) // (When mismatch, the user will be prompted in DRC, to fix the actual name)
@ -2745,7 +2745,7 @@ void LEGACY_PLUGIN::loadDIMENSION()
char* uuid = strtok_r( (char*) data, delims, (char**) &data ); char* uuid = strtok_r( (char*) data, delims, (char**) &data );
dim->SetLayer( leg_layer2new( m_cu_count, layer_num ) ); dim->SetLayer( leg_layer2new( m_cu_count, layer_num ) );
const_cast<KUUID&>( dim->m_Uuid ) = KUUID( uuid ); const_cast<KIID&>( dim->m_Uuid ) = KIID( uuid );
dim->SetShape( shape ); dim->SetShape( shape );
} }
@ -2914,7 +2914,7 @@ void LEGACY_PLUGIN::loadPCB_TARGET()
wxPoint( pos_x, pos_y ), size, width ); wxPoint( pos_x, pos_y ), size, width );
m_board->Add( t, ADD_MODE::APPEND ); m_board->Add( t, ADD_MODE::APPEND );
const_cast<KUUID&>( t->m_Uuid ) = KUUID( uuid ); const_cast<KIID&>( t->m_Uuid ) = KIID( uuid );
} }
} }

View File

@ -292,14 +292,14 @@ void KICAD_NETLIST_PARSER::parseComponent()
* A component need a reference, value, footprint name and a full time stamp * A component need a reference, value, footprint name and a full time stamp
* The full time stamp is the sheetpath time stamp + the component time stamp * The full time stamp is the sheetpath time stamp + the component time stamp
*/ */
LIB_ID fpid; LIB_ID fpid;
wxString footprint; wxString footprint;
wxString ref; wxString ref;
wxString value; wxString value;
wxString library; wxString library;
wxString name; wxString name;
UUID_PATH path; KIID_PATH path;
KUUID uuid; KIID uuid;
// The token comp was read, so the next data is (ref P1) // The token comp was read, so the next data is (ref P1)
while( (token = NextTok()) != T_RIGHT ) while( (token = NextTok()) != T_RIGHT )
@ -366,14 +366,14 @@ void KICAD_NETLIST_PARSER::parseComponent()
} }
NeedSYMBOLorNUMBER(); NeedSYMBOLorNUMBER();
path = UUID_PATH( FROM_UTF8( CurText() ) ); path = KIID_PATH( FROM_UTF8( CurText() ) );
NeedRIGHT(); NeedRIGHT();
NeedRIGHT(); NeedRIGHT();
break; break;
case T_tstamp: case T_tstamp:
NeedSYMBOLorNUMBER(); NeedSYMBOLorNUMBER();
uuid = KUUID( FROM_UTF8( CurText() ) ); uuid = KIID( FROM_UTF8( CurText() ) );
NeedRIGHT(); NeedRIGHT();
break; break;

View File

@ -121,7 +121,7 @@ COMPONENT* LEGACY_NETLIST_READER::loadComponent( char* aText )
m_lineReader->Length() ); m_lineReader->Length() );
} }
UUID_PATH path( FROM_UTF8( text ) ); KIID_PATH path( FROM_UTF8( text ) );
// Read footprint name (second word) // Read footprint name (second word)
if( ( text = strtok( NULL, " ()\t\n" ) ) == NULL ) if( ( text = strtok( NULL, " ()\t\n" ) ) == NULL )

View File

@ -88,7 +88,7 @@ void COMPONENT::Format( OUTPUTFORMATTER* aOut, int aNestLevel, int aCtl )
wxString path; wxString path;
for( const KUUID& pathStep : m_path ) for( const KIID& pathStep : m_path )
path += '/' + pathStep.AsString(); path += '/' + pathStep.AsString();
aOut->Print( nl+1, "(timestamp %s)\n", aOut->Quotew( path ).c_str() ); aOut->Print( nl+1, "(timestamp %s)\n", aOut->Quotew( path ).c_str() );
@ -164,7 +164,7 @@ COMPONENT* NETLIST::GetComponentByReference( const wxString& aReference )
} }
COMPONENT* NETLIST::GetComponentByPath( const UUID_PATH& aUuidPath ) COMPONENT* NETLIST::GetComponentByPath( const KIID_PATH& aUuidPath )
{ {
for( COMPONENT& component : m_components ) for( COMPONENT& component : m_components )
{ {

View File

@ -86,7 +86,7 @@ class COMPONENT
wxString m_value; ///< The component value found in netlist. wxString m_value; ///< The component value found in netlist.
/// A fully specified path to the component: [ sheetUUID, sheetUUID, .., componentUUID ] /// A fully specified path to the component: [ sheetUUID, sheetUUID, .., componentUUID ]
UUID_PATH m_path; KIID_PATH m_path;
/// The name of the component in #m_library used when it was placed on the schematic.. /// The name of the component in #m_library used when it was placed on the schematic..
wxString m_name; wxString m_name;
@ -112,10 +112,10 @@ class COMPONENT
static COMPONENT_NET m_emptyNet; static COMPONENT_NET m_emptyNet;
public: public:
COMPONENT( const LIB_ID& aFPID, COMPONENT( const LIB_ID& aFPID,
const wxString& aReference, const wxString& aReference,
const wxString& aValue, const wxString& aValue,
const UUID_PATH& aPath ) const KIID_PATH& aPath )
{ {
m_fpid = aFPID; m_fpid = aFPID;
m_reference = aReference; m_reference = aReference;
@ -165,7 +165,7 @@ public:
const LIB_ID& GetAltFPID() const { return m_altFpid; } const LIB_ID& GetAltFPID() const { return m_altFpid; }
const UUID_PATH& GetPath() const { return m_path; } const KIID_PATH& GetPath() const { return m_path; }
void SetFootprintFilters( const wxArrayString& aFilterList ) void SetFootprintFilters( const wxArrayString& aFilterList )
{ {
@ -286,10 +286,10 @@ public:
* Function GetComponentByPath * Function GetComponentByPath
* returns a #COMPONENT by \a aPath. * returns a #COMPONENT by \a aPath.
* *
* @param aPath is the UUID_PATH [ sheetUUID, .., compUUID ] of the #COMPONENT. * @param aPath is the KIID_PATH [ sheetUUID, .., compUUID ] of the #COMPONENT.
* @return a pointer to the #COMPONENT that matches \a aPath if found. Otherwise NULL. * @return a pointer to the #COMPONENT that matches \a aPath if found. Otherwise NULL.
*/ */
COMPONENT* GetComponentByPath( const UUID_PATH& aPath ); COMPONENT* GetComponentByPath( const KIID_PATH& aPath );
void SortByFPID(); void SortByFPID();

View File

@ -52,7 +52,7 @@ public:
char m_objType; char m_objType;
int m_PCadLayer; int m_PCadLayer;
PCB_LAYER_ID m_KiCadLayer; PCB_LAYER_ID m_KiCadLayer;
KUUID m_uuid; KIID m_uuid;
int m_positionX; int m_positionX;
int m_positionY; int m_positionY;
int m_rotation; int m_rotation;

View File

@ -2036,7 +2036,7 @@ DRAWSEGMENT* PCB_PARSER::parseDRAWSEGMENT( bool aAllowCirclesZeroWidth )
case T_tstamp: case T_tstamp:
NextTok(); NextTok();
const_cast<KUUID&>( segment->m_Uuid ) = KUUID( CurStr() ); const_cast<KIID&>( segment->m_Uuid ) = KIID( CurStr() );
break; break;
case T_status: case T_status:
@ -2114,7 +2114,7 @@ TEXTE_PCB* PCB_PARSER::parseTEXTE_PCB()
case T_tstamp: case T_tstamp:
NextTok(); NextTok();
const_cast<KUUID&>( text->m_Uuid ) = KUUID( CurStr() ); const_cast<KIID&>( text->m_Uuid ) = KIID( CurStr() );
NeedRIGHT(); NeedRIGHT();
break; break;
@ -2166,7 +2166,7 @@ DIMENSION* PCB_PARSER::parseDIMENSION()
case T_tstamp: case T_tstamp:
NextTok(); NextTok();
const_cast<KUUID&>( dimension->m_Uuid ) = KUUID( CurStr() ); const_cast<KIID&>( dimension->m_Uuid ) = KIID( CurStr() );
NeedRIGHT(); NeedRIGHT();
break; break;
@ -2176,7 +2176,7 @@ DIMENSION* PCB_PARSER::parseDIMENSION()
dimension->Text() = *text; dimension->Text() = *text;
// The text is part of the dimension and shares its uuid // The text is part of the dimension and shares its uuid
const_cast<KUUID&>( dimension->Text().m_Uuid ) = dimension->m_Uuid; const_cast<KIID&>( dimension->Text().m_Uuid ) = dimension->m_Uuid;
// Fetch other dimension properties out of the text item // Fetch other dimension properties out of the text item
dimension->SetPosition( text->GetTextPos() ); dimension->SetPosition( text->GetTextPos() );
@ -2385,7 +2385,7 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments )
case T_tstamp: case T_tstamp:
NextTok(); NextTok();
const_cast<KUUID&>( module->m_Uuid ) = KUUID( CurStr() ); const_cast<KIID&>( module->m_Uuid ) = KIID( CurStr() );
NeedRIGHT(); NeedRIGHT();
break; break;
@ -2421,7 +2421,7 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments )
case T_path: case T_path:
NeedSYMBOLorNUMBER(); // Paths can be numerical so a number is also a symbol here NeedSYMBOLorNUMBER(); // Paths can be numerical so a number is also a symbol here
module->SetPath( UUID_PATH( FromUTF8() ) ); module->SetPath( KIID_PATH( FromUTF8() ) );
NeedRIGHT(); NeedRIGHT();
break; break;
@ -2815,7 +2815,7 @@ EDGE_MODULE* PCB_PARSER::parseEDGE_MODULE()
case T_tstamp: case T_tstamp:
NextTok(); NextTok();
const_cast<KUUID&>( segment->m_Uuid ) = KUUID( CurStr() ); const_cast<KIID&>( segment->m_Uuid ) = KIID( CurStr() );
break; break;
case T_status: case T_status:
@ -3398,7 +3398,7 @@ TRACK* PCB_PARSER::parseTRACK()
case T_tstamp: case T_tstamp:
NextTok(); NextTok();
const_cast<KUUID&>( track->m_Uuid ) = KUUID( CurStr() ); const_cast<KIID&>( track->m_Uuid ) = KIID( CurStr() );
break; break;
case T_status: case T_status:
@ -3482,7 +3482,7 @@ VIA* PCB_PARSER::parseVIA()
case T_tstamp: case T_tstamp:
NextTok(); NextTok();
const_cast<KUUID&>( via->m_Uuid ) = KUUID( CurStr() ); const_cast<KIID&>( via->m_Uuid ) = KIID( CurStr() );
NeedRIGHT(); NeedRIGHT();
break; break;
@ -3570,7 +3570,7 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER( BOARD_ITEM_CONTAINER* aParent )
case T_tstamp: case T_tstamp:
NextTok(); NextTok();
const_cast<KUUID&>( zone->m_Uuid ) = KUUID( CurStr() ); const_cast<KIID&>( zone->m_Uuid ) = KIID( CurStr() );
NeedRIGHT(); NeedRIGHT();
break; break;
@ -3999,7 +3999,7 @@ PCB_TARGET* PCB_PARSER::parsePCB_TARGET()
case T_tstamp: case T_tstamp:
NextTok(); NextTok();
const_cast<KUUID&>( target->m_Uuid ) = KUUID( CurStr() ); const_cast<KIID&>( target->m_Uuid ) = KIID( CurStr() );
NeedRIGHT(); NeedRIGHT();
break; break;

View File

@ -965,7 +965,7 @@ int SELECTION_TOOL::selectNet( const TOOL_EVENT& aEvent )
void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetID ) void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetID )
{ {
KUUID uuid( aSheetID ); KIID uuid( aSheetID );
std::list<MODULE*> modList; std::list<MODULE*> modList;
// store all modules that are on that sheet // store all modules that are on that sheet
@ -974,7 +974,7 @@ void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetID )
if( module == nullptr ) if( module == nullptr )
continue; continue;
for( const KUUID& pathStep : module->GetPath() ) for( const KIID& pathStep : module->GetPath() )
{ {
if( pathStep == uuid ) if( pathStep == uuid )
{ {