From ea025a35e54af5819bc858a8b9b609121f8bdd1b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 21 Feb 2020 22:20:42 +0000 Subject: [PATCH] Change KUUID to KIID. --- common/common.cpp | 22 ++++++------ common/project.cpp | 4 +-- eeschema/annotate.cpp | 4 +-- .../dialogs/dialog_fields_editor_global.cpp | 13 +++---- eeschema/sch_component.cpp | 2 +- eeschema/sch_item.cpp | 2 +- eeschema/sch_legacy_plugin.cpp | 4 +-- eeschema/sch_reference_list.h | 2 +- eeschema/sch_screen.cpp | 2 +- eeschema/sch_sheet.cpp | 2 +- eeschema/tools/sch_editor_control.cpp | 4 +-- include/base_struct.h | 2 +- include/class_board_item.h | 2 +- include/common.h | 34 +++++++++---------- include/project.h | 4 +-- pcbnew/class_board.cpp | 2 +- pcbnew/class_board.h | 2 +- pcbnew/class_module.h | 12 +++---- pcbnew/dialogs/dialog_exchange_footprints.cpp | 2 +- pcbnew/footprint_libraries_utils.cpp | 4 +-- pcbnew/legacy_plugin.cpp | 18 +++++----- .../netlist_reader/kicad_netlist_reader.cpp | 20 +++++------ .../netlist_reader/legacy_netlist_reader.cpp | 2 +- pcbnew/netlist_reader/pcb_netlist.cpp | 4 +-- pcbnew/netlist_reader/pcb_netlist.h | 16 ++++----- pcbnew/pcad2kicadpcb_plugin/pcb_component.h | 2 +- pcbnew/pcb_parser.cpp | 22 ++++++------ pcbnew/tools/selection_tool.cpp | 4 +-- 28 files changed, 107 insertions(+), 106 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index be135284bb..ca876869d6 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -51,10 +51,10 @@ static boost::uuids::string_generator stringGenerator; static boost::uuids::nil_generator nilGenerator; // Global nil reference -KUUID niluuid( 0 ); +KIID niluuid( 0 ); -KUUID::KUUID() : +KIID::KIID() : m_uuid( randomGenerator() ), m_cached_timestamp( 0 ) { @@ -73,7 +73,7 @@ KUUID::KUUID() : } -KUUID::KUUID( int null ) : +KIID::KIID( int null ) : m_uuid( nilGenerator() ), 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_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; @@ -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]; } -timestamp_t KUUID::AsLegacyTimestamp() const +timestamp_t KIID::AsLegacyTimestamp() const { return m_cached_timestamp; } -size_t KUUID::Hash() const +size_t KIID::Hash() const { 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_cached_timestamp = aUUID.m_cached_timestamp; } -wxString KUUID::AsString() const +wxString KIID::AsString() const { return boost::uuids::to_string( m_uuid ); } -wxString KUUID::AsLegacyTimestampString() const +wxString KIID::AsLegacyTimestampString() const { return wxString::Format( "%8.8lX", (unsigned long) AsLegacyTimestamp() ); } diff --git a/common/project.cpp b/common/project.cpp index 1324402c85..cb62ea91f1 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -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() ) { @@ -184,7 +184,7 @@ const wxString PROJECT::GetSheetName( const KUUID& aSheetID ) wxArrayString tokens = wxSplit( entry, ':' ); if( tokens.size() == 2 ) - m_sheetNames[ KUUID( tokens[0] ) ] = tokens[1]; + m_sheetNames[ KIID( tokens[0] ) ] = tokens[1]; } } diff --git a/eeschema/annotate.cpp b/eeschema/annotate.cpp index f935c71cd5..37e044bd3b 100644 --- a/eeschema/annotate.cpp +++ b/eeschema/annotate.cpp @@ -33,7 +33,7 @@ #include -void mapExistingAnnotation( std::map& aMap ) +void mapExistingAnnotation( std::map& aMap ) { SCH_SHEET_LIST sheets( g_RootSheet ); SCH_REFERENCE_LIST references; @@ -94,7 +94,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic, SCH_MULTI_UNIT_REFERENCE_MAP lockedComponents; // Map of previous annotation for building info messages - std::map previousAnnotation; + std::map previousAnnotation; // Test for and replace duplicate time stamps in components and sheets. Duplicate // time stamps can happen with old schematics, schematic conversions, or manual diff --git a/eeschema/dialogs/dialog_fields_editor_global.cpp b/eeschema/dialogs/dialog_fields_editor_global.cpp index 2b0e185964..c051827f7d 100644 --- a/eeschema/dialogs/dialog_fields_editor_global.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global.cpp @@ -184,7 +184,7 @@ protected: // Data store // A map of compID : fieldSet, where fieldSet is a map of fieldName : fieldValue - std::map< KUUID, std::map > m_dataStore; + std::map< KIID, std::map > m_dataStore; public: @@ -269,7 +269,7 @@ public: } 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 ) || !m_dataStore[ compID ].count( m_fieldNames[ aCol ] ) ) @@ -418,8 +418,8 @@ public: matchFound = true; } - const KUUID& lhRefID = lhRef.GetComp()->m_Uuid; - const KUUID& rhRefID = rhRef.GetComp()->m_Uuid; + const KIID& lhRefID = lhRef.GetComp()->m_Uuid; + const KIID& rhRefID = rhRef.GetComp()->m_Uuid; // Now check all the other columns. This must be done out of the dataStore // for the refresh button to work after editing. @@ -647,8 +647,9 @@ public: for( unsigned compRef = 0; compRef < m_componentRefs.GetCount(); ++ compRef ) { - const KUUID& compId = m_componentRefs[ compRef ].GetComp()->m_Uuid; - wxString text = m_dataStore[ compId ][ column_label ]; + const KIID& compId = m_componentRefs[ compRef ].GetComp()->m_Uuid; + wxString text = m_dataStore[ compId ][ column_label ]; + width = std::max( width, GetTextSize( text, GetView() ).x ); } } diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 499d7ef51a..bc78499d27 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -179,7 +179,7 @@ SCH_COMPONENT::SCH_COMPONENT( const SCH_COMPONENT& aComponent ) : if( aComponent.m_part ) m_part.reset( new LIB_PART( *aComponent.m_part.get() ) ); - const_cast( m_Uuid ) = aComponent.m_Uuid; + const_cast( m_Uuid ) = aComponent.m_Uuid; m_transform = aComponent.m_transform; m_prefix = aComponent.m_prefix; diff --git a/eeschema/sch_item.cpp b/eeschema/sch_item.cpp index d3d9e39608..1a8ddc5337 100644 --- a/eeschema/sch_item.cpp +++ b/eeschema/sch_item.cpp @@ -77,7 +77,7 @@ SCH_ITEM* SCH_ITEM::Duplicate( bool doClone ) const SCH_ITEM* newItem = (SCH_ITEM*) Clone(); if( !doClone ) - const_cast( newItem->m_Uuid ) = KUUID(); + const_cast( newItem->m_Uuid ) = KIID(); newItem->ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED ); diff --git a/eeschema/sch_legacy_plugin.cpp b/eeschema/sch_legacy_plugin.cpp index bc412741fc..3ed55288c6 100644 --- a/eeschema/sch_legacy_plugin.cpp +++ b/eeschema/sch_legacy_plugin.cpp @@ -984,7 +984,7 @@ SCH_SHEET* SCH_LEGACY_PLUGIN::loadSheet( LINE_READER& aReader ) { wxString text; parseUnquotedString( text, aReader, line ); - const_cast( sheet->m_Uuid ) = KUUID( text ); + const_cast( sheet->m_Uuid ) = KIID( text ); } else if( *line == 'F' ) // Sheet field. { @@ -1564,7 +1564,7 @@ SCH_COMPONENT* SCH_LEGACY_PLUGIN::loadComponent( LINE_READER& aReader ) wxString text; parseUnquotedString( text, aReader, line, &line ); - const_cast( component->m_Uuid ) = KUUID( text ); + const_cast( component->m_Uuid ) = KIID( text ); } else if( strCompare( "P", line, &line ) ) { diff --git a/eeschema/sch_reference_list.h b/eeschema/sch_reference_list.h index 90b59f583a..6f24198205 100644 --- a/eeschema/sch_reference_list.h +++ b/eeschema/sch_reference_list.h @@ -60,7 +60,7 @@ class SCH_REFERENCE SCH_SHEET_PATH m_SheetPath; ///< The sheet path for this reference. bool m_IsNew; ///< True if not yet annotated. 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 ///< same for all instances. int m_NumRef; ///< The numeric part of the reference designator. diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index 7ea0962cbe..ea215047ec 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -1086,7 +1086,7 @@ int SCH_SCREENS::ReplaceDuplicateTimeStamps() // Reset to fully random UUID. This may lose reference, but better to be // deterministic about it rather than to have duplicate UUIDs with random // side-effects. - const_cast( item->m_Uuid ) = KUUID(); + const_cast( item->m_Uuid ) = KIID(); count++; } } diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 7f07c48a1f..491e3f877b 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -60,7 +60,7 @@ SCH_SHEET::SCH_SHEET( const SCH_SHEET& aSheet ) : m_pos = aSheet.m_pos; m_size = aSheet.m_size; m_Layer = aSheet.m_Layer; - const_cast( m_Uuid ) = aSheet.m_Uuid; + const_cast( m_Uuid ) = aSheet.m_Uuid; m_showSheetName = aSheet.m_showSheetName; m_sheetNameSize = aSheet.m_sheetNameSize; m_showFileName = aSheet.m_showFileName; diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 52b727e9bb..927dccad12 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -1055,7 +1055,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) if( dropAnnotations ) { - const_cast( component->m_Uuid ) = KUUID(); + const_cast( component->m_Uuid ) = KIID(); // clear the annotation, but preserve the selected unit int unit = component->GetUnit(); @@ -1069,7 +1069,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) else { // Everything else gets a new UUID - const_cast( item->m_Uuid ) = KUUID(); + const_cast( item->m_Uuid ) = KIID(); } if( item->Type() == SCH_SHEET_T ) diff --git a/include/base_struct.h b/include/base_struct.h index 2a8eeb0a6b..eb6cf24bed 100644 --- a/include/base_struct.h +++ b/include/base_struct.h @@ -163,7 +163,7 @@ typedef unsigned STATUS_FLAGS; class EDA_ITEM : public KIGFX::VIEW_ITEM { public: - const KUUID m_Uuid; + const KIID m_Uuid; private: diff --git a/include/class_board_item.h b/include/class_board_item.h index 92dd646153..c58c7b25ae 100644 --- a/include/class_board_item.h +++ b/include/class_board_item.h @@ -165,7 +165,7 @@ public: BOARD_ITEM* Duplicate() const { EDA_ITEM* dupe = Clone(); - const_cast( dupe->m_Uuid ) = KUUID(); + const_cast( dupe->m_Uuid ) = KIID(); return static_cast( dupe ); } diff --git a/include/common.h b/include/common.h index a192fdf3c8..592524630c 100644 --- a/include/common.h +++ b/include/common.h @@ -62,15 +62,15 @@ class REPORTER; */ typedef uint32_t timestamp_t; -class KUUID +class KIID { public: - KUUID(); - KUUID( int null ); - KUUID( const wxString& aString ); - KUUID( timestamp_t aTimestamp ); + KIID(); + KIID( int null ); + KIID( const wxString& aString ); + KIID( timestamp_t aTimestamp ); - void Clone( const KUUID& aUUID ); + void Clone( const KIID& aUUID ); size_t Hash() const; @@ -80,17 +80,17 @@ public: wxString AsString() const; wxString AsLegacyTimestampString() const; - bool operator==( KUUID const& rhs) const + bool operator==( KIID const& rhs) const { return m_uuid == rhs.m_uuid; } - bool operator!=( KUUID const& rhs) const + bool operator!=( KIID const& rhs) const { return m_uuid != rhs.m_uuid; } - bool operator<( KUUID const& rhs) const + bool operator<( KIID const& rhs) const { return m_uuid < rhs.m_uuid; } @@ -102,21 +102,21 @@ private: }; -extern KUUID niluuid; +extern KIID niluuid; -class UUID_PATH : public std::vector +class KIID_PATH : public std::vector { public: - UUID_PATH() + KIID_PATH() {} - UUID_PATH( const wxString& aString ) + KIID_PATH( const wxString& aString ) { for( const wxString& pathStep : wxSplit( aString, '/' ) ) { if( !pathStep.empty() ) - emplace_back( KUUID( pathStep ) ); + emplace_back( KIID( pathStep ) ); } } @@ -124,13 +124,13 @@ public: { wxString path; - for( const KUUID& pathStep : *this ) + for( const KIID& pathStep : *this ) path += '/' + pathStep.AsString(); return path; } - bool operator==( UUID_PATH const& rhs) const + bool operator==( KIID_PATH const& rhs) const { if( size() != rhs.size() ) return false; @@ -144,7 +144,7 @@ public: return true; } - bool operator<( UUID_PATH const& rhs) const + bool operator<( KIID_PATH const& rhs) const { if( size() != rhs.size() ) return size() < rhs.size(); diff --git a/include/project.h b/include/project.h index f2e821a1bc..2334e4875e 100644 --- a/include/project.h +++ b/include/project.h @@ -115,7 +115,7 @@ public: /** * 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 @@ -337,7 +337,7 @@ private: wxFileName m_project_name; ///< \/\.pro wxString m_pro_date_and_time; - std::map m_sheetNames; + std::map m_sheetNames; /// @see this::SetRString(), GetRString(), and enum RSTRING_T. wxString m_rstrings[RSTRING_COUNT]; diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 52e2939af2..5d4c145952 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -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 ) { diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index abc5d0a091..b309306d93 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -827,7 +827,7 @@ public: * @param aPath The path ([sheetUUID, .., symbolUUID]) to search for. * @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 diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h index 05d8168bb1..6c6e526b04 100644 --- a/pcbnew/class_module.h +++ b/pcbnew/class_module.h @@ -225,8 +225,8 @@ public: const wxString& GetKeywords() const { return m_KeyWord; } void SetKeywords( const wxString& aKeywords ) { m_KeyWord = aKeywords; } - const UUID_PATH& GetPath() const { return m_Path; } - void SetPath( const UUID_PATH& aPath ) { m_Path = aPath; } + const KIID_PATH& GetPath() const { return m_Path; } + void SetPath( const KIID_PATH& aPath ) { m_Path = aPath; } int GetLocalSolderMaskMargin() const { return m_LocalSolderMaskMargin; } void SetLocalSolderMaskMargin( int aMargin ) { m_LocalSolderMaskMargin = aMargin; } @@ -546,8 +546,8 @@ public: double GetArea( int aPadding = 0 ) const; - KUUID GetLink() const { return m_Link; } - void SetLink( const KUUID& aLink ) { m_Link = aLink; } + KIID GetLink() const { return m_Link; } + void SetLink( const KIID& aLink ) { m_Link = aLink; } int GetPlacementCost180() const { return m_CntRot180; } void SetPlacementCost180( int aCost ) { m_CntRot180 = aCost; } @@ -705,10 +705,10 @@ private: wxString m_Doc; // File name and path for documentation file. 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; 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_CntRot180; // Vertical automatic placement cost ( 0..10 ). diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index 2538f21413..dfd0f6190c 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -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. // Updating other parameters - const_cast( aDest->m_Uuid ) = aSrc->m_Uuid; + const_cast( aDest->m_Uuid ) = aSrc->m_Uuid; aDest->SetPath( aSrc->GetPath() ); aDest->CalculateBoundingBox(); diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index 45efa7f9b9..2356df51ab 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -826,7 +826,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew ) // and connexions are kept) // and the source_module (old module) is deleted pcbframe->Exchange_Module( source_module, newmodule, commit ); - const_cast( newmodule->m_Uuid ) = module_in_edit->GetLink(); + const_cast( newmodule->m_Uuid ) = module_in_edit->GetLink(); commit.Push( wxT( "Update module" ) ); } else // This is an insert command @@ -839,7 +839,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew ) pcbframe->PlaceModule( newmodule ); newmodule->SetPosition( wxPoint( 0, 0 ) ); viewControls->SetCrossHairCursorPosition( cursorPos, false ); - const_cast( newmodule->m_Uuid ) = KUUID(); + const_cast( newmodule->m_Uuid ) = KIID(); commit.Push( wxT( "Insert module" ) ); pcbframe->Raise(); diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index 11efb6b99b..55628e8aee 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -1236,7 +1236,7 @@ void LEGACY_PLUGIN::loadMODULE( MODULE* aModule ) aModule->SetPosition( wxPoint( pos_x, pos_y ) ); aModule->SetLayer( layer_id ); aModule->SetOrientation( orient ); - const_cast( aModule->m_Uuid ) = KUUID( uuid ); + const_cast( aModule->m_Uuid ) = KIID( uuid ); aModule->SetLastEditTime( edittime ); } @@ -1252,7 +1252,7 @@ void LEGACY_PLUGIN::loadMODULE( MODULE* aModule ) else if( TESTLINE( "Sc" ) ) // timestamp { char* uuid = strtok_r( (char*) line + SZ( "Sc" ), delims, (char**) &data ); - const_cast( aModule->m_Uuid ) = KUUID( uuid ); + const_cast( aModule->m_Uuid ) = KIID( uuid ); } 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 ); if( data ) - aModule->SetPath( UUID_PATH( FROM_UTF8( data ) ) ); + aModule->SetPath( KIID_PATH( FROM_UTF8( data ) ) ); } else if( TESTLINE( "$SHAPE3D" ) ) @@ -1969,7 +1969,7 @@ void LEGACY_PLUGIN::loadPCB_LINE() dseg->SetAngle( angle ); // m_Angle break; case 3: - const_cast( dseg->m_Uuid ) = KUUID( data ); + const_cast( dseg->m_Uuid ) = KIID( data ); break; case 4: STATUS_FLAGS state; @@ -2152,7 +2152,7 @@ void LEGACY_PLUGIN::loadPCB_TEXT() char* vJustify = strtok_r( NULL, delims, (char**) &data ); pcbtxt->SetMirrored( !notMirrored ); - const_cast( pcbtxt->m_Uuid ) = KUUID( uuid ); + const_cast( pcbtxt->m_Uuid ) = KIID( uuid ); pcbtxt->SetItalic( !strcmp( style, "Italic" ) ); if( hJustify ) @@ -2274,7 +2274,7 @@ void LEGACY_PLUGIN::loadTrackList( int aStructType ) case PCB_VIA_T: newTrack = new VIA( m_board ); break; } - const_cast( newTrack->m_Uuid ) = KUUID( uuid ); + const_cast( newTrack->m_Uuid ) = KIID( uuid ); newTrack->SetPosition( wxPoint( start_x, start_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) ) THROW_IO_ERROR( "ZInfo netname too long" ); - const_cast( zc->m_Uuid ) = KUUID( uuid ); + const_cast( zc->m_Uuid ) = KIID( uuid ); // Init the net code only, not the netname, to be sure // the zone net name is the name read in file. // (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 ); dim->SetLayer( leg_layer2new( m_cu_count, layer_num ) ); - const_cast( dim->m_Uuid ) = KUUID( uuid ); + const_cast( dim->m_Uuid ) = KIID( uuid ); dim->SetShape( shape ); } @@ -2914,7 +2914,7 @@ void LEGACY_PLUGIN::loadPCB_TARGET() wxPoint( pos_x, pos_y ), size, width ); m_board->Add( t, ADD_MODE::APPEND ); - const_cast( t->m_Uuid ) = KUUID( uuid ); + const_cast( t->m_Uuid ) = KIID( uuid ); } } diff --git a/pcbnew/netlist_reader/kicad_netlist_reader.cpp b/pcbnew/netlist_reader/kicad_netlist_reader.cpp index f7e78e0696..9a61b60766 100644 --- a/pcbnew/netlist_reader/kicad_netlist_reader.cpp +++ b/pcbnew/netlist_reader/kicad_netlist_reader.cpp @@ -292,14 +292,14 @@ void KICAD_NETLIST_PARSER::parseComponent() * 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 */ - LIB_ID fpid; - wxString footprint; - wxString ref; - wxString value; - wxString library; - wxString name; - UUID_PATH path; - KUUID uuid; + LIB_ID fpid; + wxString footprint; + wxString ref; + wxString value; + wxString library; + wxString name; + KIID_PATH path; + KIID uuid; // The token comp was read, so the next data is (ref P1) while( (token = NextTok()) != T_RIGHT ) @@ -366,14 +366,14 @@ void KICAD_NETLIST_PARSER::parseComponent() } NeedSYMBOLorNUMBER(); - path = UUID_PATH( FROM_UTF8( CurText() ) ); + path = KIID_PATH( FROM_UTF8( CurText() ) ); NeedRIGHT(); NeedRIGHT(); break; case T_tstamp: NeedSYMBOLorNUMBER(); - uuid = KUUID( FROM_UTF8( CurText() ) ); + uuid = KIID( FROM_UTF8( CurText() ) ); NeedRIGHT(); break; diff --git a/pcbnew/netlist_reader/legacy_netlist_reader.cpp b/pcbnew/netlist_reader/legacy_netlist_reader.cpp index 2926a02c73..8e7e4800ee 100644 --- a/pcbnew/netlist_reader/legacy_netlist_reader.cpp +++ b/pcbnew/netlist_reader/legacy_netlist_reader.cpp @@ -121,7 +121,7 @@ COMPONENT* LEGACY_NETLIST_READER::loadComponent( char* aText ) m_lineReader->Length() ); } - UUID_PATH path( FROM_UTF8( text ) ); + KIID_PATH path( FROM_UTF8( text ) ); // Read footprint name (second word) if( ( text = strtok( NULL, " ()\t\n" ) ) == NULL ) diff --git a/pcbnew/netlist_reader/pcb_netlist.cpp b/pcbnew/netlist_reader/pcb_netlist.cpp index 3fc23c96fa..fb16583f55 100644 --- a/pcbnew/netlist_reader/pcb_netlist.cpp +++ b/pcbnew/netlist_reader/pcb_netlist.cpp @@ -88,7 +88,7 @@ void COMPONENT::Format( OUTPUTFORMATTER* aOut, int aNestLevel, int aCtl ) wxString path; - for( const KUUID& pathStep : m_path ) + for( const KIID& pathStep : m_path ) path += '/' + pathStep.AsString(); 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 ) { diff --git a/pcbnew/netlist_reader/pcb_netlist.h b/pcbnew/netlist_reader/pcb_netlist.h index 066e90d9f6..a4bdc53223 100644 --- a/pcbnew/netlist_reader/pcb_netlist.h +++ b/pcbnew/netlist_reader/pcb_netlist.h @@ -86,7 +86,7 @@ class COMPONENT wxString m_value; ///< The component value found in netlist. /// 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.. wxString m_name; @@ -112,10 +112,10 @@ class COMPONENT static COMPONENT_NET m_emptyNet; public: - COMPONENT( const LIB_ID& aFPID, - const wxString& aReference, - const wxString& aValue, - const UUID_PATH& aPath ) + COMPONENT( const LIB_ID& aFPID, + const wxString& aReference, + const wxString& aValue, + const KIID_PATH& aPath ) { m_fpid = aFPID; m_reference = aReference; @@ -165,7 +165,7 @@ public: 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 ) { @@ -286,10 +286,10 @@ public: * Function GetComponentByPath * 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. */ - COMPONENT* GetComponentByPath( const UUID_PATH& aPath ); + COMPONENT* GetComponentByPath( const KIID_PATH& aPath ); void SortByFPID(); diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_component.h b/pcbnew/pcad2kicadpcb_plugin/pcb_component.h index 2f4e6a870a..2ac279ef7f 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_component.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_component.h @@ -52,7 +52,7 @@ public: char m_objType; int m_PCadLayer; PCB_LAYER_ID m_KiCadLayer; - KUUID m_uuid; + KIID m_uuid; int m_positionX; int m_positionY; int m_rotation; diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index 3cf32f2e9f..2b07302a26 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -2036,7 +2036,7 @@ DRAWSEGMENT* PCB_PARSER::parseDRAWSEGMENT( bool aAllowCirclesZeroWidth ) case T_tstamp: NextTok(); - const_cast( segment->m_Uuid ) = KUUID( CurStr() ); + const_cast( segment->m_Uuid ) = KIID( CurStr() ); break; case T_status: @@ -2114,7 +2114,7 @@ TEXTE_PCB* PCB_PARSER::parseTEXTE_PCB() case T_tstamp: NextTok(); - const_cast( text->m_Uuid ) = KUUID( CurStr() ); + const_cast( text->m_Uuid ) = KIID( CurStr() ); NeedRIGHT(); break; @@ -2166,7 +2166,7 @@ DIMENSION* PCB_PARSER::parseDIMENSION() case T_tstamp: NextTok(); - const_cast( dimension->m_Uuid ) = KUUID( CurStr() ); + const_cast( dimension->m_Uuid ) = KIID( CurStr() ); NeedRIGHT(); break; @@ -2176,7 +2176,7 @@ DIMENSION* PCB_PARSER::parseDIMENSION() dimension->Text() = *text; // The text is part of the dimension and shares its uuid - const_cast( dimension->Text().m_Uuid ) = dimension->m_Uuid; + const_cast( dimension->Text().m_Uuid ) = dimension->m_Uuid; // Fetch other dimension properties out of the text item dimension->SetPosition( text->GetTextPos() ); @@ -2385,7 +2385,7 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments ) case T_tstamp: NextTok(); - const_cast( module->m_Uuid ) = KUUID( CurStr() ); + const_cast( module->m_Uuid ) = KIID( CurStr() ); NeedRIGHT(); break; @@ -2421,7 +2421,7 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments ) case T_path: NeedSYMBOLorNUMBER(); // Paths can be numerical so a number is also a symbol here - module->SetPath( UUID_PATH( FromUTF8() ) ); + module->SetPath( KIID_PATH( FromUTF8() ) ); NeedRIGHT(); break; @@ -2815,7 +2815,7 @@ EDGE_MODULE* PCB_PARSER::parseEDGE_MODULE() case T_tstamp: NextTok(); - const_cast( segment->m_Uuid ) = KUUID( CurStr() ); + const_cast( segment->m_Uuid ) = KIID( CurStr() ); break; case T_status: @@ -3398,7 +3398,7 @@ TRACK* PCB_PARSER::parseTRACK() case T_tstamp: NextTok(); - const_cast( track->m_Uuid ) = KUUID( CurStr() ); + const_cast( track->m_Uuid ) = KIID( CurStr() ); break; case T_status: @@ -3482,7 +3482,7 @@ VIA* PCB_PARSER::parseVIA() case T_tstamp: NextTok(); - const_cast( via->m_Uuid ) = KUUID( CurStr() ); + const_cast( via->m_Uuid ) = KIID( CurStr() ); NeedRIGHT(); break; @@ -3570,7 +3570,7 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER( BOARD_ITEM_CONTAINER* aParent ) case T_tstamp: NextTok(); - const_cast( zone->m_Uuid ) = KUUID( CurStr() ); + const_cast( zone->m_Uuid ) = KIID( CurStr() ); NeedRIGHT(); break; @@ -3999,7 +3999,7 @@ PCB_TARGET* PCB_PARSER::parsePCB_TARGET() case T_tstamp: NextTok(); - const_cast( target->m_Uuid ) = KUUID( CurStr() ); + const_cast( target->m_Uuid ) = KIID( CurStr() ); NeedRIGHT(); break; diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index a943ade880..242279f7c1 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -965,7 +965,7 @@ int SELECTION_TOOL::selectNet( const TOOL_EVENT& aEvent ) void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetID ) { - KUUID uuid( aSheetID ); + KIID uuid( aSheetID ); std::list modList; // store all modules that are on that sheet @@ -974,7 +974,7 @@ void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetID ) if( module == nullptr ) continue; - for( const KUUID& pathStep : module->GetPath() ) + for( const KIID& pathStep : module->GetPath() ) { if( pathStep == uuid ) {