7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 21:29:17 +00:00

Convert timestamps to UUIDs.

This commit is contained in:
Jeff Young 2020-02-20 12:11:04 +00:00
parent 4014afad54
commit 129042f8a6
88 changed files with 951 additions and 1150 deletions
common
cvpcb
eeschema
include
pcbnew

View File

@ -86,7 +86,6 @@ void EDA_ITEM::initVars()
m_StructType = TYPE_NOT_INIT;
m_Parent = NULL; // Linked list: Link (parent struct)
m_Flags = 0; // flags for editions and other
SetTimeStamp( 0 ); // Time stamp used for logical links
m_Status = 0;
m_forceVisible = false; // true to override the visibility setting of the item.
}
@ -222,9 +221,6 @@ EDA_ITEM& EDA_ITEM::operator=( const EDA_ITEM& aItem )
m_Parent = aItem.m_Parent;
m_forceVisible = aItem.m_forceVisible;
// A copy of an item cannot have the same time stamp as the original item.
SetTimeStamp( GetNewTimeStamp() );
return *this;
}

View File

@ -23,16 +23,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file common.cpp
*/
#include <fctsys.h>
#include <eda_base_frame.h>
#include <base_struct.h>
#include <common.h>
#include <macros.h>
#include <base_units.h>
#include <reporter.h>
#include <mutex>
#include <settings/settings_manager.h>
@ -42,12 +36,137 @@
#include <wx/utils.h>
#include <wx/stdpaths.h>
#include <wx/url.h>
#include <pgm_base.h>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/functional/hash.hpp>
using KIGFX::COLOR4D;
// Create only once, as seeding is *very* expensive
static boost::uuids::random_generator randomGenerator;
// These don't have the same performance penalty, but might as well be consistent
static boost::uuids::string_generator stringGenerator;
static boost::uuids::nil_generator nilGenerator;
// Global nil reference
UUID niluuid( 0 );
UUID::UUID() :
m_uuid( randomGenerator() ),
m_cached_timestamp( 0 )
{
}
UUID::UUID( int null ) :
m_uuid( nilGenerator() ),
m_cached_timestamp( 0 )
{
wxASSERT( null == 0 );
}
UUID::UUID( const wxString& aString ) :
m_uuid(),
m_cached_timestamp( 0 )
{
if( aString.length() == 8 )
{
// A legacy-timestamp-based UUID has only the last 4 octets filled in.
// Convert them individually to avoid stepping in the little-endian/big-endian
// doo-doo.
for( int i = 0; i < 4; ++i )
{
wxString octet = aString.substr( i * 2, 2 );
m_uuid.data[ i + 12 ] = strtol( octet.data(), NULL, 16 );
}
m_cached_timestamp = strtol( aString.c_str(), NULL, 16 );
}
else
{
try
{
m_uuid = stringGenerator( aString.wc_str() );
if( IsLegacyTimestamp() )
m_cached_timestamp = strtol( aString.substr( 28 ).c_str(), NULL, 16 );
}
catch( ... )
{
// Failed to parse string representation; best we can do is assign a new
// random one.
m_uuid = randomGenerator();
}
}
}
UUID::UUID( timestamp_t aTimestamp )
{
m_cached_timestamp = aTimestamp;
// A legacy-timestamp-based UUID has only the last 4 octets filled in.
// Convert them individually to avoid stepping in the little-endian/big-endian
// doo-doo.
wxString str = AsLegacyTimestampString();
for( int i = 0; i < 4; ++i )
{
wxString octet = str.substr( i * 2, 2 );
m_uuid.data[ i + 12 ] = strtol( octet.data(), NULL, 16 );
}
}
bool UUID::IsLegacyTimestamp() const
{
return !m_uuid.data[8] && !m_uuid.data[9] && !m_uuid.data[10] && !m_uuid.data[11];
}
timestamp_t UUID::AsLegacyTimestamp() const
{
return m_cached_timestamp;
}
size_t UUID::Hash() const
{
size_t hash = 0;
// Note: this is NOT little-endian/big-endian safe, but as long as it's just used
// at runtime it won't matter.
for( int i = 0; i < 4; ++i )
boost::hash_combine( hash, reinterpret_cast<const uint32_t*>( m_uuid.data )[i] );
return hash;
}
void UUID::Clone( const UUID& aUUID )
{
m_uuid = aUUID.m_uuid;
m_cached_timestamp = aUUID.m_cached_timestamp;
}
wxString UUID::AsString() const
{
return boost::uuids::to_string( m_uuid );
}
wxString UUID::AsLegacyTimestampString() const
{
return wxString::Format( "%8.8lX", (unsigned long) AsLegacyTimestamp() );
}
/**
* Global variables definitions.
*

View File

@ -260,23 +260,6 @@ NODE_MAP MapChildren( wxXmlNode* aCurrentNode )
}
timestamp_t EagleTimeStamp( wxXmlNode* aTree )
{
// in this case from a unique tree memory location
return (timestamp_t) reinterpret_cast<uintptr_t>( aTree );
}
timestamp_t EagleModuleTstamp( const wxString& aName, const wxString& aValue, int aUnit )
{
std::size_t h1 = std::hash<wxString>{}( aName );
std::size_t h2 = std::hash<wxString>{}( aValue );
std::size_t h3 = std::hash<int>{}( aUnit );
return (timestamp_t)( h1 ^ (h2 << 1) ^ (h3 << 2) );
}
wxPoint ConvertArcCenter( const wxPoint& aStart, const wxPoint& aEnd, double aAngle )
{
// Eagle give us start and end.

View File

@ -30,6 +30,7 @@
// 'FT232BL' 'QFP:LQFP-32_7x7mm_Pitch0.8mm'
//
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // For boost...
#include <boost/ptr_container/ptr_vector.hpp>
class FOOTPRINT_EQUIVALENCE

View File

@ -1,12 +1,7 @@
/**
* @file annotate.cpp
* @brief Component annotation.
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -38,7 +33,7 @@
#include <class_library.h>
void mapExistingAnnotation( std::map<timestamp_t, wxString>& aMap )
void mapExistingAnnotation( std::map<UUID, wxString>& aMap )
{
SCH_SHEET_LIST sheets( g_RootSheet );
SCH_REFERENCE_LIST references;
@ -51,7 +46,7 @@ void mapExistingAnnotation( std::map<timestamp_t, wxString>& aMap )
wxString ref = comp->GetField( REFERENCE )->GetFullyQualifiedText();
if( !ref.Contains( wxT( "?" ) ) )
aMap[ comp->GetTimeStamp() ] = ref;
aMap[ comp->m_Uuid ] = ref;
}
}
@ -99,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<timestamp_t, wxString> previousAnnotation;
std::map<UUID, wxString> previousAnnotation;
// Test for and replace duplicate time stamps in components and sheets. Duplicate
// time stamps can happen with old schematics, schematic conversions, or manual
@ -120,13 +115,9 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
if( aLockUnits )
{
if( aAnnotateSchematic )
{
sheets.GetMultiUnitComponents( lockedComponents );
}
else
{
g_CurrentSheet->GetMultiUnitComponents( lockedComponents );
}
}
// Store previous annotations for building info messages
@ -141,13 +132,9 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
// Build component list
if( aAnnotateSchematic )
{
sheets.GetComponents( references );
}
else
{
g_CurrentSheet->GetComponents( references );
}
// Break full components reference in name (prefix) and number:
// example: IC1 become IC, and 1
@ -156,13 +143,8 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
switch( aSortOption )
{
default:
case SORT_BY_X_POSITION:
references.SortByXCoordinate();
break;
case SORT_BY_Y_POSITION:
references.SortByYCoordinate();
break;
case SORT_BY_X_POSITION: references.SortByXCoordinate(); break;
case SORT_BY_Y_POSITION: references.SortByYCoordinate(); break;
}
bool useSheetNum = false;
@ -191,7 +173,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
for( size_t i = 0; i < references.GetCount(); i++ )
{
SCH_COMPONENT* comp = references[ i ].GetComp();
wxString prevRef = previousAnnotation[ comp->GetTimeStamp() ];
wxString prevRef = previousAnnotation[ comp->m_Uuid ];
wxString newRef = comp->GetField( REFERENCE )->GetFullyQualifiedText();
wxString msg;
@ -202,27 +184,27 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
if( comp->GetUnitCount() > 1 )
msg.Printf( _( "Updated %s (unit %s) from %s to %s" ),
GetChars( comp->GetField( VALUE )->GetShownText() ),
comp->GetField( VALUE )->GetShownText(),
LIB_PART::SubReference( comp->GetUnit(), false ),
GetChars( prevRef ),
GetChars( newRef ) );
prevRef,
newRef );
else
msg.Printf( _( "Updated %s from %s to %s" ),
GetChars( comp->GetField( VALUE )->GetShownText() ),
GetChars( prevRef ),
GetChars( newRef ) );
comp->GetField( VALUE )->GetShownText(),
prevRef,
newRef );
}
else
{
if( comp->GetUnitCount() > 1 )
msg.Printf( _( "Annotated %s (unit %s) as %s" ),
GetChars( comp->GetField( VALUE )->GetShownText() ),
comp->GetField( VALUE )->GetShownText(),
LIB_PART::SubReference( comp->GetUnit(), false ),
GetChars( newRef ) );
newRef );
else
msg.Printf( _( "Annotated %s as %s" ),
GetChars( comp->GetField( VALUE )->GetShownText() ),
GetChars( newRef ) );
comp->GetField( VALUE )->GetShownText(),
newRef );
}
aReporter.Report( msg, REPORTER::RPT_ACTION );

View File

@ -31,7 +31,9 @@
#ifndef CLASS_LIBRARY_H
#define CLASS_LIBRARY_H
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // For boost...
#include <boost/ptr_container/ptr_vector.hpp>
#include <wx/filename.h>
#include <sch_io_mgr.h>

View File

@ -8,7 +8,7 @@
*
* Copyright (C) 1992-2018 jean-pierre Charras <jp.charras at wanadoo.fr>
* Copyright (C) 1992-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -43,48 +43,50 @@
#include <sch_edit_frame.h>
//#define USE_OLD_ALGO
void SCH_REFERENCE_LIST::RemoveItem( unsigned int aIndex )
{
if( aIndex < componentFlatList.size() )
componentFlatList.erase( componentFlatList.begin() + aIndex );
if( aIndex < flatList.size() )
flatList.erase( flatList.begin() + aIndex );
}
bool SCH_REFERENCE_LIST::sortByXPosition( const SCH_REFERENCE& item1,
const SCH_REFERENCE& item2 )
bool SCH_REFERENCE_LIST::sortByXPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 )
{
int ii = item1.CompareRef( item2 );
if( ii == 0 )
ii = item1.m_SheetNum - item2.m_SheetNum;
if( ii == 0 )
ii = item1.m_CmpPos.x - item2.m_CmpPos.x;
if( ii == 0 )
ii = item1.m_CmpPos.y - item2.m_CmpPos.y;
if( ii == 0 )
ii = item1.m_TimeStamp - item2.m_TimeStamp;
return ii < 0;
if( ii == 0 )
return item1.m_Uuid < item2.m_Uuid; // ensure a deterministic sort
else
return ii < 0;
}
bool SCH_REFERENCE_LIST::sortByYPosition( const SCH_REFERENCE& item1,
const SCH_REFERENCE& item2 )
bool SCH_REFERENCE_LIST::sortByYPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 )
{
int ii = item1.CompareRef( item2 );
if( ii == 0 )
ii = item1.m_SheetNum - item2.m_SheetNum;
if( ii == 0 )
ii = item1.m_CmpPos.y - item2.m_CmpPos.y;
if( ii == 0 )
ii = item1.m_CmpPos.x - item2.m_CmpPos.x;
if( ii == 0 )
ii = item1.m_TimeStamp - item2.m_TimeStamp;
return ii < 0;
if( ii == 0 )
return item1.m_Uuid < item2.m_Uuid; // ensure a deterministic sort
else
return ii < 0;
}
@ -92,41 +94,41 @@ bool SCH_REFERENCE_LIST::sortByRefAndValue( const SCH_REFERENCE& item1,
const SCH_REFERENCE& item2 )
{
int ii = item1.CompareRef( item2 );
if( ii == 0 )
ii = item1.CompareValue( item2 );
if( ii == 0 )
ii = item1.m_Unit - item2.m_Unit;
if( ii == 0 )
ii = item1.m_SheetNum - item2.m_SheetNum;
if( ii == 0 )
ii = item1.m_CmpPos.x - item2.m_CmpPos.x;
if( ii == 0 )
ii = item1.m_CmpPos.y - item2.m_CmpPos.y;
if( ii == 0 )
ii = item1.m_TimeStamp - item2.m_TimeStamp;
return ii < 0;
if( ii == 0 )
return item1.m_Uuid < item2.m_Uuid; // ensure a deterministic sort
else
return ii < 0;
}
bool SCH_REFERENCE_LIST::sortByReferenceOnly( const SCH_REFERENCE& item1,
const SCH_REFERENCE& item2 )
{
int ii;
ii = UTIL::RefDesStringCompare( item1.GetRef(), item2.GetRef() );
int ii = UTIL::RefDesStringCompare( item1.GetRef(), item2.GetRef() );
if( ii == 0 )
{
ii = item1.m_RootCmp->GetField( VALUE )->GetText().CmpNoCase( item2.m_RootCmp->GetField( VALUE )->GetText() );
}
if( ii == 0 )
{
ii = item1.m_Unit - item2.m_Unit;
}
return ii < 0;
if( ii == 0 )
return item1.m_Uuid < item2.m_Uuid; // ensure a deterministic sort
else
return ii < 0;
}
@ -136,70 +138,43 @@ bool SCH_REFERENCE_LIST::sortByTimeStamp( const SCH_REFERENCE& item1,
int ii = item1.m_SheetPath.Cmp( item2.m_SheetPath );
if( ii == 0 )
ii = item1.m_TimeStamp - item2.m_TimeStamp;
return ii < 0;
return item1.m_Uuid < item2.m_Uuid; // ensure a deterministic sort
else
return ii < 0;
}
int SCH_REFERENCE_LIST::FindUnit( size_t aIndex, int aUnit )
{
int NumRef;
NumRef = componentFlatList[aIndex].m_NumRef;
NumRef = flatList[aIndex].m_NumRef;
for( size_t ii = 0; ii < componentFlatList.size(); ii++ )
for( size_t ii = 0; ii < flatList.size(); ii++ )
{
if( ( aIndex == ii )
|| ( componentFlatList[ii].m_IsNew )
|| ( componentFlatList[ii].m_NumRef != NumRef )
|| ( componentFlatList[aIndex].CompareRef( componentFlatList[ii] ) != 0 ) )
|| ( flatList[ii].m_IsNew )
|| ( flatList[ii].m_NumRef != NumRef )
|| ( flatList[aIndex].CompareRef( flatList[ii] ) != 0 ) )
continue;
if( componentFlatList[ii].m_Unit == aUnit )
if( flatList[ii].m_Unit == aUnit )
return (int) ii;
}
return -1;
}
int SCH_REFERENCE_LIST::FindRefByPath( const wxString& aPath ) const
{
for( size_t i = 0; i < componentFlatList.size(); ++i )
if( componentFlatList[i].GetPath() == aPath )
return i;
return -1;
}
void SCH_REFERENCE_LIST::RemoveSubComponentsFromList()
{
SCH_COMPONENT* libItem;
wxString oldName;
wxString currName;
// The component list **MUST** be sorted by reference and by unit number
// in order to find all parts of a component
SortByReferenceOnly();
for( unsigned ii = 0; ii < componentFlatList.size(); ii++ )
for( size_t i = 0; i < flatList.size(); ++i )
{
libItem = componentFlatList[ii].m_RootCmp;
if( libItem == NULL )
continue;
currName = componentFlatList[ii].GetRef();
if( !oldName.IsEmpty() )
{
if( oldName == currName ) // currName is a subpart of oldName: remove it
{
componentFlatList.erase( componentFlatList.begin() + ii );
ii--;
}
}
oldName = currName;
if( flatList[i].GetPath() == aPath )
return i;
}
return -1;
}
@ -207,11 +182,10 @@ void SCH_REFERENCE_LIST::GetRefsInUse( int aIndex, std::vector< int >& aIdList,
{
aIdList.clear();
for( unsigned ii = 0; ii < componentFlatList.size(); ii++ )
for( SCH_REFERENCE& ref : flatList )
{
if( ( componentFlatList[aIndex].CompareRef( componentFlatList[ii] ) == 0 )
&& ( componentFlatList[ii].m_NumRef >= aMinRefId ) )
aIdList.push_back( componentFlatList[ii].m_NumRef );
if( flatList[aIndex].CompareRef( ref ) == 0 && ref.m_NumRef >= aMinRefId )
aIdList.push_back( ref.m_NumRef );
}
sort( aIdList.begin(), aIdList.end() );
@ -230,15 +204,15 @@ int SCH_REFERENCE_LIST::GetLastReference( int aIndex, int aMinValue )
{
int lastNumber = aMinValue;
for( unsigned ii = 0; ii < componentFlatList.size(); ii++ )
for( SCH_REFERENCE& ref : flatList )
{
// search only for the current reference prefix:
if( componentFlatList[aIndex].CompareRef( componentFlatList[ii] ) != 0 )
if( flatList[aIndex].CompareRef( ref ) != 0 )
continue;
// update max value for the current reference prefix
if( lastNumber < componentFlatList[ii].m_NumRef )
lastNumber = componentFlatList[ii].m_NumRef;
if( lastNumber < ref.m_NumRef )
lastNumber = ref.m_NumRef;
}
return lastNumber;
@ -296,9 +270,9 @@ wxString buildFullReference( const SCH_REFERENCE& aItem, int aUnitNumber = -1 )
void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int aStartNumber,
SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap )
SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap )
{
if ( componentFlatList.size() == 0 )
if ( flatList.size() == 0 )
return;
int LastReferenceNumber = 0;
@ -312,20 +286,11 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
unsigned first = 0;
// calculate the last used number for this reference prefix:
#ifdef USE_OLD_ALGO
int minRefId = 0;
// when using sheet number, ensure ref number >= sheet number* aSheetIntervalId
if( aUseSheetNum )
minRefId = componentFlatList[first].m_SheetNum * aSheetIntervalId;
LastReferenceNumber = GetLastReference( first, minRefId );
#else
int minRefId;
// when using sheet number, ensure ref number >= sheet number* aSheetIntervalId
if( aUseSheetNum )
minRefId = componentFlatList[first].m_SheetNum * aSheetIntervalId + 1;
minRefId = flatList[first].m_SheetNum * aSheetIntervalId + 1;
else
minRefId = aStartNumber + 1;
@ -345,10 +310,10 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
// Will be refilled for each new reference prefix.
std::vector<int>idList;
GetRefsInUse( first, idList, minRefId );
#endif
for( unsigned ii = 0; ii < componentFlatList.size(); ii++ )
for( unsigned ii = 0; ii < flatList.size(); ii++ )
{
auto& ref_unit = componentFlatList[ii];
auto& ref_unit = flatList[ii];
if( ref_unit.m_Flag )
continue;
@ -372,21 +337,12 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
if( lockedList != NULL ) break;
}
if( ( componentFlatList[first].CompareRef( ref_unit ) != 0 )
|| ( aUseSheetNum && ( componentFlatList[first].m_SheetNum != ref_unit.m_SheetNum ) ) )
if( ( flatList[first].CompareRef( ref_unit ) != 0 )
|| ( aUseSheetNum && ( flatList[first].m_SheetNum != ref_unit.m_SheetNum ) ) )
{
// New reference found: we need a new ref number for this reference
first = ii;
#ifdef USE_OLD_ALGO
minRefId = 0;
// when using sheet number, ensure ref number >= sheet number* aSheetIntervalId
if( aUseSheetNum )
minRefId = ref_unit.m_SheetNum * aSheetIntervalId;
LastReferenceNumber = GetLastReference( ii, minRefId );
#else
// when using sheet number, ensure ref number >= sheet number* aSheetIntervalId
if( aUseSheetNum )
minRefId = ref_unit.m_SheetNum * aSheetIntervalId + 1;
@ -394,7 +350,6 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
minRefId = aStartNumber + 1;
GetRefsInUse( first, idList, minRefId );
#endif
}
// Annotation of one part per package components (trivial case).
@ -402,11 +357,7 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
{
if( ref_unit.m_IsNew )
{
#ifdef USE_OLD_ALGO
LastReferenceNumber++;
#else
LastReferenceNumber = CreateFirstFreeRefId( idList, minRefId );
#endif
ref_unit.m_NumRef = LastReferenceNumber;
}
@ -421,11 +372,7 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
if( ref_unit.m_IsNew )
{
#ifdef USE_OLD_ALGO
LastReferenceNumber++;
#else
LastReferenceNumber = CreateFirstFreeRefId( idList, minRefId );
#endif
ref_unit.m_NumRef = LastReferenceNumber;
if( !ref_unit.IsUnitsLocked() )
@ -459,9 +406,9 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
continue;
// Find the matching component
for( unsigned jj = ii + 1; jj < componentFlatList.size(); jj++ )
for( unsigned jj = ii + 1; jj < flatList.size(); jj++ )
{
if( ! thisRef.IsSameInstance( componentFlatList[jj] ) )
if( ! thisRef.IsSameInstance( flatList[jj] ) )
continue;
wxString ref_candidate = buildFullReference( ref_unit, thisRef.m_Unit );
@ -471,10 +418,10 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
// multiunits components have duplicate references)
if( inUseRefs.find( ref_candidate ) == inUseRefs.end() )
{
componentFlatList[jj].m_NumRef = ref_unit.m_NumRef;
componentFlatList[jj].m_Unit = thisRef.m_Unit;
componentFlatList[jj].m_IsNew = false;
componentFlatList[jj].m_Flag = 1;
flatList[jj].m_NumRef = ref_unit.m_NumRef;
flatList[jj].m_Unit = thisRef.m_Unit;
flatList[jj].m_IsNew = false;
flatList[jj].m_Flag = 1;
// lock this new full reference
inUseRefs.insert( ref_candidate );
break;
@ -499,9 +446,9 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
continue; // this unit exists for this reference (unit already annotated)
// Search a component to annotate ( same prefix, same value, not annotated)
for( unsigned jj = ii + 1; jj < componentFlatList.size(); jj++ )
for( unsigned jj = ii + 1; jj < flatList.size(); jj++ )
{
auto& cmp_unit = componentFlatList[jj];
auto& cmp_unit = flatList[jj];
if( cmp_unit.m_Flag ) // already tested
continue;
@ -538,33 +485,6 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
}
}
int SCH_REFERENCE_LIST::checkForDuplicatedElements( REPORTER& aReporter )
{
int error = 0;
wxString msg;
for( size_t ii = 0; ii < componentFlatList.size() - 1; ii++ )
{
if( ( componentFlatList[ii].m_TimeStamp != componentFlatList[ii + 1].m_TimeStamp )
|| ( componentFlatList[ii].GetSheetPath()
!= componentFlatList[ii + 1].GetSheetPath() ) )
continue;
// Same time stamp found.
wxString full_path;
full_path.Printf( wxT( "%s%8.8X" ), GetChars( componentFlatList[ii].GetSheetPath().Path() ),
componentFlatList[ii].m_TimeStamp );
msg.Printf( _( "Duplicate time stamp (%s) for %s%d and %s%d" ), full_path,
componentFlatList[ii].GetRef(), componentFlatList[ii].m_NumRef,
componentFlatList[ii + 1].GetRef(), componentFlatList[ii + 1].m_NumRef );
aReporter.Report( msg, REPORTER::RPT_WARNING );
error++;
}
return error;
}
int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
{
int error = 0;
@ -577,32 +497,32 @@ int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
SplitReferences();
// count not yet annotated items or annotation error.
for( unsigned ii = 0; ii < componentFlatList.size(); ii++ )
for( unsigned ii = 0; ii < flatList.size(); ii++ )
{
msg.Empty();
tmp.Empty();
if( componentFlatList[ii].m_IsNew ) // Not yet annotated
if( flatList[ii].m_IsNew ) // Not yet annotated
{
if( componentFlatList[ii].m_NumRef >= 0 )
tmp << componentFlatList[ii].m_NumRef;
if( flatList[ii].m_NumRef >= 0 )
tmp << flatList[ii].m_NumRef;
else
tmp = wxT( "?" );
if( ( componentFlatList[ii].m_Unit > 0 )
&& ( componentFlatList[ii].m_Unit < 0x7FFFFFFF ) )
if( ( flatList[ii].m_Unit > 0 )
&& ( flatList[ii].m_Unit < 0x7FFFFFFF ) )
{
msg.Printf( _( "Item not annotated: %s%s (unit %d)\n" ),
componentFlatList[ii].GetRef(),
flatList[ii].GetRef(),
tmp,
componentFlatList[ii].m_Unit );
flatList[ii].m_Unit );
}
else
{
msg.Printf( _( "Item not annotated: %s%s\n" ),
GetChars( componentFlatList[ii].GetRef() ),
GetChars( tmp ) );
flatList[ii].GetRef(),
tmp );
}
aReporter.Report( msg, REPORTER::RPT_WARNING );
@ -613,19 +533,19 @@ int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
// Error if unit number selected does not exist ( greater than the number of
// parts in the component ). This can happen if a component has changed in a
// library after a previous annotation.
if( std::max( componentFlatList[ii].GetLibPart()->GetUnitCount(), 1 )
< componentFlatList[ii].m_Unit )
if( std::max( flatList[ii].GetLibPart()->GetUnitCount(), 1 )
< flatList[ii].m_Unit )
{
if( componentFlatList[ii].m_NumRef >= 0 )
tmp << componentFlatList[ii].m_NumRef;
if( flatList[ii].m_NumRef >= 0 )
tmp << flatList[ii].m_NumRef;
else
tmp = wxT( "?" );
msg.Printf( _( "Error: symbol %s%s unit %d and symbol has only %d units defined\n" ),
componentFlatList[ii].GetRef(),
flatList[ii].GetRef(),
tmp,
componentFlatList[ii].m_Unit,
componentFlatList[ii].GetLibPart()->GetUnitCount() );
flatList[ii].m_Unit,
flatList[ii].GetLibPart()->GetUnitCount() );
aReporter.Report( msg, REPORTER::RPT_ERROR );
error++;
@ -637,37 +557,37 @@ int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
return error;
// count the duplicated elements (if all are annotated)
int imax = componentFlatList.size() - 1;
int imax = flatList.size() - 1;
for( int ii = 0; ii < imax; ii++ )
{
msg.Empty();
tmp.Empty();
if( ( componentFlatList[ii].CompareRef( componentFlatList[ii + 1] ) != 0 )
|| ( componentFlatList[ii].m_NumRef != componentFlatList[ii + 1].m_NumRef ) )
if( ( flatList[ii].CompareRef( flatList[ii + 1] ) != 0 )
|| ( flatList[ii].m_NumRef != flatList[ii + 1].m_NumRef ) )
continue;
// Same reference found. If same unit, error!
if( componentFlatList[ii].m_Unit == componentFlatList[ii + 1].m_Unit )
if( flatList[ii].m_Unit == flatList[ii + 1].m_Unit )
{
if( componentFlatList[ii].m_NumRef >= 0 )
tmp << componentFlatList[ii].m_NumRef;
if( flatList[ii].m_NumRef >= 0 )
tmp << flatList[ii].m_NumRef;
else
tmp = wxT( "?" );
if( ( componentFlatList[ii].m_Unit > 0 )
&& ( componentFlatList[ii].m_Unit < 0x7FFFFFFF ) )
if( ( flatList[ii].m_Unit > 0 )
&& ( flatList[ii].m_Unit < 0x7FFFFFFF ) )
{
msg.Printf( _( "Multiple item %s%s (unit %d)\n" ),
componentFlatList[ii].GetRef(),
flatList[ii].GetRef(),
tmp,
componentFlatList[ii].m_Unit );
flatList[ii].m_Unit );
}
else
{
msg.Printf( _( "Multiple item %s%s\n" ),
componentFlatList[ii].GetRef(),
flatList[ii].GetRef(),
tmp );
}
@ -678,27 +598,27 @@ int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
/* Test error if units are different but number of parts per package
* too high (ex U3 ( 1 part) and we find U3B this is an error) */
if( componentFlatList[ii].GetLibPart()->GetUnitCount()
!= componentFlatList[ii + 1].GetLibPart()->GetUnitCount() )
if( flatList[ii].GetLibPart()->GetUnitCount()
!= flatList[ ii + 1].GetLibPart()->GetUnitCount() )
{
if( componentFlatList[ii].m_NumRef >= 0 )
tmp << componentFlatList[ii].m_NumRef;
if( flatList[ii].m_NumRef >= 0 )
tmp << flatList[ii].m_NumRef;
else
tmp = wxT( "?" );
if( ( componentFlatList[ii].m_Unit > 0 )
&& ( componentFlatList[ii].m_Unit < 0x7FFFFFFF ) )
if( ( flatList[ii].m_Unit > 0 )
&& ( flatList[ii].m_Unit < 0x7FFFFFFF ) )
{
msg.Printf( _( "Multiple item %s%s (unit %d)\n" ),
GetChars( componentFlatList[ii].GetRef() ),
GetChars( tmp ),
componentFlatList[ii].m_Unit );
flatList[ii].GetRef(),
tmp,
flatList[ii].m_Unit );
}
else
{
msg.Printf( _( "Multiple item %s%s\n" ),
GetChars( componentFlatList[ii].GetRef() ),
GetChars( tmp ) );
flatList[ii].GetRef(),
tmp );
}
aReporter.Report( msg, REPORTER::RPT_ERROR );
@ -708,27 +628,23 @@ int SCH_REFERENCE_LIST::CheckAnnotation( REPORTER& aReporter )
// Error if values are different between units, for the same reference
int next = ii + 1;
if( componentFlatList[ii].CompareValue( componentFlatList[next] ) != 0 )
if( flatList[ii].CompareValue( flatList[next] ) != 0 )
{
msg.Printf( _( "Different values for %s%d%s (%s) and %s%d%s (%s)" ),
componentFlatList[ii].GetRef(),
componentFlatList[ii].m_NumRef,
LIB_PART::SubReference( componentFlatList[ii].m_Unit ),
componentFlatList[ii].m_Value->GetText(),
componentFlatList[next].GetRef(),
componentFlatList[next].m_NumRef,
LIB_PART::SubReference( componentFlatList[next].m_Unit ),
componentFlatList[next].m_Value->GetText() );
flatList[ii].GetRef(),
flatList[ii].m_NumRef,
LIB_PART::SubReference( flatList[ii].m_Unit ),
flatList[ii].m_Value->GetText(),
flatList[next].GetRef(),
flatList[next].m_NumRef,
LIB_PART::SubReference( flatList[next].m_Unit ),
flatList[next].m_Value->GetText() );
aReporter.Report( msg, REPORTER::RPT_ERROR );
error++;
}
}
// count the duplicated time stamps
SortByTimeStamp();
error += checkForDuplicatedElements( aReporter );
return error;
}
@ -745,7 +661,7 @@ SCH_REFERENCE::SCH_REFERENCE( SCH_COMPONENT* aComponent, LIB_PART* aLibPart,
m_SheetPath = aSheetPath;
m_IsNew = false;
m_Flag = 0;
m_TimeStamp = aComponent->GetTimeStamp();
m_Uuid = aComponent->m_Uuid;
m_CmpPos = aComponent->GetPosition();
m_SheetNum = 0;
@ -769,9 +685,7 @@ void SCH_REFERENCE::Annotate()
if( m_NumRef < 0 )
m_Ref += '?';
else
{
m_Ref = TO_UTF8( GetRef() << GetRefNumber() );
}
m_RootCmp->SetRef( &m_SheetPath, FROM_UTF8( m_Ref.c_str() ) );
m_RootCmp->SetUnit( m_Unit );

View File

@ -171,7 +171,6 @@ bool CONNECTION_SUBGRAPH::ResolveDrivers( bool aCreateMarkers )
second_item->GetPosition();
auto marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_WARNING );
marker->SetData( ERCE_DRIVER_CONFLICT, p0, msg, p1 );
@ -1987,7 +1986,6 @@ bool CONNECTION_GRAPH::ercCheckBusToNetConflicts( const CONNECTION_SUBGRAPH* aSu
net_item->GetSelectMenuText( m_frame->GetUserUnits() ) );
auto marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_ERROR );
marker->SetData( ERCE_BUS_TO_NET_CONFLICT,
@ -2068,7 +2066,6 @@ bool CONNECTION_GRAPH::ercCheckBusToBusConflicts( const CONNECTION_SUBGRAPH* aSu
port->GetSelectMenuText( m_frame->GetUserUnits() ) );
auto marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_ERROR );
marker->SetData( ERCE_BUS_TO_BUS_CONFLICT,
@ -2162,7 +2159,6 @@ bool CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts( const CONNECTION_SUBGRAPH
bus_wire->Connection( sheet )->Name( true ) );
auto marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_WARNING );
marker->SetData( ERCE_BUS_ENTRY_CONFLICT,
@ -2229,7 +2225,6 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph,
pin->GetParentComponent()->GetRef( &aSubgraph->m_sheet ) );
auto marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_WARNING );
marker->SetData( ERCE_NOCONNECT_CONNECTED, pos, msg, pos );
@ -2249,7 +2244,6 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph,
msg.Printf( _( "No-connect marker is not connected to anything" ) );
auto marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_WARNING );
marker->SetData( ERCE_NOCONNECT_NOT_CONNECTED, pos, msg, pos );
@ -2315,7 +2309,6 @@ bool CONNECTION_GRAPH::ercCheckNoConnects( const CONNECTION_SUBGRAPH* aSubgraph,
pin->GetParentComponent()->GetRef( &aSubgraph->m_sheet ) );
auto marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_WARNING );
marker->SetData( ERCE_PIN_NOT_CONNECTED, pos, msg, pos );
@ -2423,7 +2416,6 @@ bool CONNECTION_GRAPH::ercCheckLabels( const CONNECTION_SUBGRAPH* aSubgraph,
msg.Printf( _( "%s %s is not connected anywhere else in the schematic." ),
prefix, GetChars( text->ShortenedShownText() ) );
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_WARNING );
marker->SetData( type, pos, msg, pos );

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -271,8 +271,8 @@ std::string FormatProbeItem( EDA_ITEM* aItem, SCH_COMPONENT* aComp )
case SCH_SHEET_T:
{
SCH_SHEET* sheet = (SCH_SHEET*)aItem;
return StrPrintf( "$SHEET: \"%8.8lX\"", (unsigned long) sheet->GetTimeStamp() );
SCH_SHEET* sheet = (SCH_SHEET*)aItem;
return StrPrintf( "$SHEET: \"%s\"", TO_UTF8( sheet->m_Uuid.AsString() ) );
}
case SCH_PIN_T:

View File

@ -206,8 +206,7 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow()
m_rbMirror->SetSelection( 0 );
// Set the component's unique ID time stamp.
m_textCtrlTimeStamp->SetValue( wxString::Format( wxT( "%8.8lX" ),
(unsigned long) m_cmp->GetTimeStamp() ) );
m_textCtrlTimeStamp->SetValue( m_cmp->m_Uuid.AsString() );
// Set the component's library name.
m_libraryNameTextCtrl->SetValue( m_cmp->GetLibId().Format() );

View File

@ -577,11 +577,13 @@ void DIALOG_ERC::TestErc( REPORTER& aReporter )
{
SCH_MARKER* marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetData( ERCE_DIFFERENT_UNIT_NET, item->m_Start,
wxString::Format( _( "Pin %s on %s is connected to both %s and %s" ),
item->m_PinNum, ref, pin_to_net_map[pin_name], item->GetNetName() ),
item->m_Start );
wxString::Format( _( "Pin %s on %s is connected to both %s and %s" ),
item->m_PinNum,
ref,
pin_to_net_map[pin_name],
item->GetNetName() ),
item->m_Start );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_ERROR );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Oliver Walters
* Copyright (C) 2017-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -184,7 +184,7 @@ protected:
// Data store
// A map of compID : fieldSet, where fieldSet is a map of fieldName : fieldValue
std::map< timestamp_t, std::map<wxString, wxString> > m_dataStore;
std::map< UUID, std::map<wxString, wxString> > m_dataStore;
public:
@ -206,8 +206,7 @@ public:
for( unsigned i = 0; i < m_componentRefs.GetCount(); ++i )
{
SCH_COMPONENT* comp = m_componentRefs[ i ].GetComp();
timestamp_t compID = comp->GetTimeStamp();
m_dataStore[ compID ][ aFieldName ] = comp->GetFieldText( aFieldName, m_frame );
m_dataStore[ comp->m_Uuid ][ aFieldName ] = comp->GetFieldText( aFieldName, m_frame );
}
}
@ -270,7 +269,7 @@ public:
}
else // Other columns are either a single value or ROW_MULTI_ITEMS
{
timestamp_t compID = ref.GetComp()->GetTimeStamp();
const UUID& compID = ref.GetComp()->m_Uuid;
if( !m_dataStore.count( compID ) ||
!m_dataStore[ compID ].count( m_fieldNames[ aCol ] ) )
@ -331,7 +330,7 @@ public:
wxString fieldName = m_fieldNames[ aCol ];
for( const auto& ref : rowGroup.m_Refs )
m_dataStore[ ref.GetComp()->GetTimeStamp() ][ fieldName ] = aValue;
m_dataStore[ ref.GetComp()->m_Uuid ][ fieldName ] = aValue;
m_edited = true;
}
@ -419,8 +418,8 @@ public:
matchFound = true;
}
timestamp_t lhRefID = lhRef.GetComp()->GetTimeStamp();
timestamp_t rhRefID = rhRef.GetComp()->GetTimeStamp();
const UUID& lhRefID = lhRef.GetComp()->m_Uuid;
const UUID& 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.
@ -598,7 +597,7 @@ public:
m_frame->SetCurrentSheet( m_componentRefs[i].GetSheetPath() );
m_frame->SaveCopyInUndoList( &comp, UR_CHANGED, true );
const std::map<wxString, wxString>& fieldStore = m_dataStore[comp.GetTimeStamp()];
const std::map<wxString, wxString>& fieldStore = m_dataStore[comp.m_Uuid];
for( const std::pair<wxString, wxString> srcData : fieldStore )
{
@ -648,7 +647,7 @@ public:
for( unsigned compRef = 0; compRef < m_componentRefs.GetCount(); ++ compRef )
{
timestamp_t compId = m_componentRefs[ compRef ].GetComp()->GetTimeStamp();
const UUID& compId = m_componentRefs[ compRef ].GetComp()->m_Uuid;
wxString text = m_dataStore[ compId ][ column_label ];
width = std::max( width, GetTextSize( text, GetView() ).x );
}

View File

@ -90,8 +90,7 @@ bool DIALOG_SCH_SHEET_PROPS::TransferDataToWindow()
m_filenameTextSize.SetValue( m_sheet->GetFileNameSize() );
m_sheetnameTextSize.SetValue( m_sheet->GetSheetNameSize() );
auto tstamp = wxString::Format( wxT( "%8.8lX" ), (unsigned long) m_sheet->GetTimeStamp() );
m_textCtrlTimeStamp->SetValue( tstamp );
m_textCtrlTimeStamp->SetValue( m_sheet->m_Uuid.AsString() );
return true;
}

View File

@ -185,7 +185,6 @@ int TestDuplicateSheetNames( bool aCreateMarker )
{
/* Create a new marker type ERC error*/
SCH_MARKER* marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetData( ERCE_DUPLICATE_SHEET_NAME,
( (SCH_SHEET*) test_item )->GetPosition(),
_( "Duplicate sheet name" ),
@ -306,7 +305,6 @@ int TestMultiunitFootprints( SCH_SHEET_LIST& aSheetList )
wxPoint pos = unit->GetPosition();
SCH_MARKER* marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetData( ERCE_DIFFERENT_UNIT_FP, pos, msg, pos );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_WARNING );
@ -332,8 +330,6 @@ void Diagnose( NETLIST_OBJECT* aNetItemRef, NETLIST_OBJECT* aNetItemTst, int aMi
/* Create new marker for ERC error. */
marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_WARNING );
screen = aNetItemRef->m_SheetPath.LastScreen();
@ -827,8 +823,6 @@ static void SimilarLabelsDiagnose( NETLIST_OBJECT* aItemA, NETLIST_OBJECT* aItem
{
// Create new marker for ERC.
SCH_MARKER* marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_WARNING );
SCH_SCREEN* screen = aItemA->m_SheetPath.LastScreen();

View File

@ -201,8 +201,6 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeComponents()
{
XNODE* xcomps = node( "components" );
wxString timeStamp;
m_ReferencesAlreadyFound.Clear();
SCH_SHEET_LIST sheetList( g_RootSheet );
@ -273,9 +271,7 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeComponents()
xcomp->AddChild( xsheetpath = node( "sheetpath" ) );
xsheetpath->AddAttribute( "names", sheetList[i].PathHumanReadable() );
xsheetpath->AddAttribute( "tstamps", sheetList[i].Path() );
timeStamp.Printf( "%8.8lX", (unsigned long)comp->GetTimeStamp() );
xcomp->AddChild( node( "tstamp", timeStamp ) );
xcomp->AddChild( node( "tstamp", comp->m_Uuid.AsString() ) );
}
}

View File

@ -138,8 +138,6 @@ SCH_COMPONENT::SCH_COMPONENT( LIB_PART& aPart, LIB_ID aLibId, SCH_SHEET_PATH* sh
m_part.reset( part.release() );
m_fieldsAutoplaced = AUTOPLACED_NO;
SetTimeStamp( GetNewTimeStamp() );
// Copy fields from the library component
UpdateFields( true, true );
@ -181,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() ) );
SetTimeStamp( aComponent.m_TimeStamp );
const_cast<UUID&>( m_Uuid ) = aComponent.m_Uuid;
m_transform = aComponent.m_transform;
m_prefix = aComponent.m_prefix;
@ -596,10 +594,7 @@ wxString SCH_COMPONENT::GetPath( const SCH_SHEET_PATH* sheet ) const
wxCHECK_MSG( sheet != NULL, wxEmptyString,
wxT( "Cannot get component path with invalid sheet object." ) );
wxString str;
str.Printf( wxT( "%8.8lX" ), (long unsigned) m_TimeStamp );
return sheet->Path() + str;
return sheet->Path() + m_Uuid.AsString();
}
@ -739,19 +734,6 @@ bool SCH_COMPONENT::IsAnnotated( const SCH_SHEET_PATH* aSheet )
}
void SCH_COMPONENT::SetTimeStamp( timestamp_t aNewTimeStamp )
{
wxString string_timestamp, string_oldtimestamp;
string_timestamp.Printf( wxT( "%08lX" ), (long unsigned) aNewTimeStamp );
string_oldtimestamp.Printf( wxT( "%08lX" ), (long unsigned) m_TimeStamp );
EDA_ITEM::SetTimeStamp( aNewTimeStamp );
for( wxString& entry : m_PathsAndReferences )
entry.Replace( string_oldtimestamp.GetData(), string_timestamp.GetData() );
}
int SCH_COMPONENT::GetUnitSelection( const SCH_SHEET_PATH* aSheet ) const
{
wxString path = GetPath( aSheet );
@ -1101,8 +1083,7 @@ bool SCH_COMPONENT::AddSheetPathReferenceEntryIfMissing( const wxString& aSheetP
// The full component reference path is aSheetPathName + the component time stamp itself
// full_AR_path is the alternate reference path to search
wxString full_AR_path = aSheetPathName
+ wxString::Format( "%8.8lX", (unsigned long) GetTimeStamp() );
wxString full_AR_path = aSheetPathName + m_Uuid.AsString();
for( unsigned int ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ )
{
@ -1757,7 +1738,7 @@ bool SCH_COMPONENT::operator <( const SCH_ITEM& aItem ) const
if( m_Pos.y != component->m_Pos.y )
return m_Pos.y < component->m_Pos.y;
return GetTimeStamp() < aItem.GetTimeStamp();
return m_Uuid < aItem.m_Uuid; // Ensure deterministic sort
}

View File

@ -326,15 +326,6 @@ public:
*/
bool AddSheetPathReferenceEntryIfMissing( const wxString& aSheetPathName );
/**
* Change the time stamp to \a aNewTimeStamp and updates the reference path.
*
* @see m_PathsAndReferences
*
* @param aNewTimeStamp = new time stamp
*/
void SetTimeStamp( timestamp_t aNewTimeStamp );
/**
* Clear the HIGHLIGHTED flag of all items of the component (fields, pins ...)
*/

View File

@ -588,8 +588,6 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
std::unique_ptr<SCH_SHEET> sheet( new SCH_SHEET( pos ) );
SCH_SCREEN* screen = new SCH_SCREEN( m_kiway );
sheet->SetTimeStamp(
GetNewTimeStamp() - i ); // minus the sheet index to make it unique.
sheet->SetParent( m_rootSheet->GetScreen() );
sheet->SetScreen( screen );
sheet->GetScreen()->SetFileName( sheet->GetFileName() );
@ -646,11 +644,9 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
// Instantiate the missing component unit
int unit = unitEntry.first;
const wxString reference = origCmp->GetField( REFERENCE )->GetText();
std::unique_ptr<SCH_COMPONENT> component( new SCH_COMPONENT( *origCmp ) );
std::unique_ptr<SCH_COMPONENT> component( (SCH_COMPONENT*) origCmp->Duplicate() );
component->SetUnitSelection( &sheetpath, unit );
component->SetUnit( unit );
component->SetTimeStamp(
EagleModuleTstamp( reference, origCmp->GetField( VALUE )->GetText(), unit ) );
component->SetOrientation( 0 );
component->AddHierarchicalReference( sheetpath.Path(), reference, unit );
@ -1102,17 +1098,15 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
auto p = elib->package.find( kisymbolname );
if( p != elib->package.end() )
{
package = p->second;
}
LIB_PART* part =
m_pi->LoadSymbol( getLibFileName().GetFullPath(), kisymbolname, m_properties.get() );
if( !part )
{
wxLogMessage( wxString::Format(
_( "Could not find %s in the imported library" ), kisymbolname ) );
wxLogMessage( wxString::Format( _( "Could not find %s in the imported library" ),
kisymbolname ) );
return;
}
@ -1122,17 +1116,13 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
component->SetUnit( unit );
component->SetPosition( wxPoint( einstance.x.ToSchUnits(), -einstance.y.ToSchUnits() ) );
component->GetField( FOOTPRINT )->SetText( package );
component->SetTimeStamp(
EagleModuleTstamp( einstance.part, epart->value ? *epart->value : "", unit ) );
if( einstance.rot )
{
component->SetOrientation( kiCadComponentRotation( einstance.rot->degrees ) );
if( einstance.rot->mirror )
{
component->MirrorY( einstance.x.ToSchUnits() );
}
}
LIB_FIELDS partFields;
@ -1158,10 +1148,7 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
SCH_SHEET_PATH sheetpath;
m_rootSheet->LocatePathOfScreen( screen, &sheetpath );
wxString current_sheetpath = sheetpath.Path();
wxString tstamp;
tstamp.Printf( "%8.8lX", (unsigned long) component->GetTimeStamp() );
current_sheetpath += tstamp;
current_sheetpath += component->m_Uuid.AsString();
component->GetField( REFERENCE )->SetText( reference );
component->AddHierarchicalReference( current_sheetpath, reference, unit );

View File

@ -72,12 +72,12 @@ SCH_ITEM::~SCH_ITEM()
}
SCH_ITEM* SCH_ITEM::Duplicate( bool doClone )
SCH_ITEM* SCH_ITEM::Duplicate( bool doClone ) const
{
SCH_ITEM* newItem = (SCH_ITEM*) Clone();
if( doClone )
newItem->SetTimeStamp( GetTimeStamp() );
if( !doClone )
const_cast<UUID&>( newItem->m_Uuid ) = UUID();
newItem->ClearFlags( SELECTED | HIGHLIGHTED | BRIGHTENED );
@ -174,8 +174,8 @@ bool SCH_ITEM::operator < ( const SCH_ITEM& aItem ) const
if( Type() != aItem.Type() )
return Type() < aItem.Type();
if( GetTimeStamp() != aItem.GetTimeStamp() )
return GetTimeStamp() < aItem.GetTimeStamp();
if( m_Uuid != aItem.m_Uuid )
return m_Uuid < aItem.m_Uuid;
if( GetPosition().x != aItem.GetPosition().x )
return GetPosition().x < aItem.GetPosition().x;

View File

@ -181,7 +181,7 @@ public:
* @param doClone (default = false) indicates unique values (such as timestamp and
* sheet name) should be duplicated. Use only for undo/redo operations.
*/
SCH_ITEM* Duplicate( bool doClone = false );
SCH_ITEM* Duplicate( bool doClone = false ) const;
/**
* Virtual function IsMovableFromAnchorPoint

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016 CERN
* Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Wayne Stambaugh <stambaughw@gmail.com>
*
@ -193,8 +193,7 @@ static int parseInt( LINE_READER& aReader, const char* aLine, const char** aOutp
* @throw IO_ERROR on an unexpected end of line.
* @throw PARSE_ERROR if the parsed token is not a valid integer.
*/
static uint32_t parseHex( LINE_READER& aReader, const char* aLine,
const char** aOutput = NULL )
static uint32_t parseHex( LINE_READER& aReader, const char* aLine, const char** aOutput = NULL )
{
if( !*aLine )
SCH_PARSE_ERROR( _( "unexpected end of line" ), aReader, aLine );
@ -458,7 +457,7 @@ static void parseQuotedString( wxString& aString, LINE_READER& aReader,
{
const char* next = tmp;
while( *next && *next == ' ' )
while( *next == ' ' )
next++;
*aNextToken = next;
@ -963,8 +962,6 @@ SCH_SHEET* SCH_LEGACY_PLUGIN::loadSheet( LINE_READER& aReader )
{
std::unique_ptr< SCH_SHEET > sheet( new SCH_SHEET() );
sheet->SetTimeStamp( GetNewTimeStamp() );
const char* line = aReader.ReadLine();
while( line != NULL )
@ -983,9 +980,11 @@ SCH_SHEET* SCH_LEGACY_PLUGIN::loadSheet( LINE_READER& aReader )
size.SetHeight( Mils2Iu( parseInt( aReader, line, &line ) ) );
sheet->SetSize( size );
}
else if( strCompare( "U", line, &line ) ) // Sheet time stamp.
else if( strCompare( "U", line, &line ) ) // Sheet UUID.
{
sheet->SetTimeStamp( parseHex( aReader, line ) );
wxString text;
parseUnquotedString( text, aReader, line );
const_cast<UUID&>( sheet->m_Uuid ) = UUID( text );
}
else if( *line == 'F' ) // Sheet field.
{
@ -1578,7 +1577,9 @@ SCH_COMPONENT* SCH_LEGACY_PLUGIN::loadComponent( LINE_READER& aReader )
component->SetConvert( convert );
component->SetTimeStamp( parseHex( aReader, line, &line ) );
wxString text;
parseUnquotedString( text, aReader, line, &line );
const_cast<UUID&>( component->m_Uuid ) = UUID( text );
}
else if( strCompare( "P", line, &line ) )
{
@ -2009,9 +2010,11 @@ void SCH_LEGACY_PLUGIN::saveComponent( SCH_COMPONENT* aComponent )
m_out->Print( 0, "$Comp\n" );
m_out->Print( 0, "L %s %s\n", name2.c_str(), name1.c_str() );
// Generate unit number, convert and time stamp
m_out->Print( 0, "U %d %d %8.8X\n", aComponent->GetUnit(), aComponent->GetConvert(),
aComponent->GetTimeStamp() );
// Generate unit number, conversion and UUID (including legacy timestamp if present)
m_out->Print( 0, "U %d %d %s\n",
aComponent->GetUnit(),
aComponent->GetConvert(),
TO_UTF8( aComponent->m_Uuid.AsString() ) );
// Save the position
m_out->Print( 0, "P %d %d\n",
@ -2160,17 +2163,21 @@ void SCH_LEGACY_PLUGIN::saveSheet( SCH_SHEET* aSheet )
m_out->Print( 0, "$Sheet\n" );
m_out->Print( 0, "S %-4d %-4d %-4d %-4d\n",
Iu2Mils( aSheet->GetPosition().x ), Iu2Mils( aSheet->GetPosition().y ),
Iu2Mils( aSheet->GetSize().x ), Iu2Mils( aSheet->GetSize().y ) );
Iu2Mils( aSheet->GetPosition().x ),
Iu2Mils( aSheet->GetPosition().y ),
Iu2Mils( aSheet->GetSize().x ),
Iu2Mils( aSheet->GetSize().y ) );
m_out->Print( 0, "U %8.8X\n", aSheet->GetTimeStamp() );
m_out->Print( 0, "U %s\n", TO_UTF8( aSheet->m_Uuid.AsString() ) );
if( !aSheet->GetName().IsEmpty() )
m_out->Print( 0, "F0 %s %d\n", EscapedUTF8( aSheet->GetName() ).c_str(),
m_out->Print( 0, "F0 %s %d\n",
EscapedUTF8( aSheet->GetName() ).c_str(),
Iu2Mils( aSheet->GetSheetNameSize() ) );
if( !aSheet->GetFileName().IsEmpty() )
m_out->Print( 0, "F1 %s %d\n", EscapedUTF8( aSheet->GetFileName() ).c_str(),
m_out->Print( 0, "F1 %s %d\n",
EscapedUTF8( aSheet->GetFileName() ).c_str(),
Iu2Mils( aSheet->GetFileNameSize() ) );
for( const SCH_SHEET_PIN* pin : aSheet->GetPins() )
@ -2191,25 +2198,16 @@ void SCH_LEGACY_PLUGIN::saveSheet( SCH_SHEET* aSheet )
switch( pin->GetShape() )
{
case PINSHEETLABEL_SHAPE::PS_INPUT:
type = 'I';
break;
case PINSHEETLABEL_SHAPE::PS_OUTPUT:
type = 'O';
break;
case PINSHEETLABEL_SHAPE::PS_BIDI:
type = 'B';
break;
case PINSHEETLABEL_SHAPE::PS_TRISTATE:
type = 'T';
break;
default:
case PINSHEETLABEL_SHAPE::PS_UNSPECIFIED:
type = 'U';
break;
case PINSHEETLABEL_SHAPE::PS_UNSPECIFIED: type = 'U'; break;
case PINSHEETLABEL_SHAPE::PS_INPUT: type = 'I'; break;
case PINSHEETLABEL_SHAPE::PS_OUTPUT: type = 'O'; break;
case PINSHEETLABEL_SHAPE::PS_BIDI: type = 'B'; break;
case PINSHEETLABEL_SHAPE::PS_TRISTATE: type = 'T'; break;
}
m_out->Print( 0, "F%d %s %c %c %-3d %-3d %-3d\n", pin->GetNumber(),
m_out->Print( 0, "F%d %s %c %c %-3d %-3d %-3d\n",
pin->GetNumber(),
EscapedUTF8( pin->GetText() ).c_str(), // supplies wrapping quotes
type, side, Iu2Mils( pin->GetPosition().x ),
Iu2Mils( pin->GetPosition().y ),
@ -2225,7 +2223,8 @@ void SCH_LEGACY_PLUGIN::saveJunction( SCH_JUNCTION* aJunction )
wxCHECK_RET( aJunction != NULL, "SCH_JUNCTION* is NULL" );
m_out->Print( 0, "Connection ~ %-4d %-4d\n",
Iu2Mils( aJunction->GetPosition().x ), Iu2Mils( aJunction->GetPosition().y ) );
Iu2Mils( aJunction->GetPosition().x ),
Iu2Mils( aJunction->GetPosition().y ) );
}
@ -2233,7 +2232,8 @@ void SCH_LEGACY_PLUGIN::saveNoConnect( SCH_NO_CONNECT* aNoConnect )
{
wxCHECK_RET( aNoConnect != NULL, "SCH_NOCONNECT* is NULL" );
m_out->Print( 0, "NoConn ~ %-4d %-4d\n", Iu2Mils( aNoConnect->GetPosition().x ),
m_out->Print( 0, "NoConn ~ %-4d %-4d\n",
Iu2Mils( aNoConnect->GetPosition().x ),
Iu2Mils( aNoConnect->GetPosition().y ) );
}

View File

@ -100,7 +100,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH aPath )
// Add timestamp for uninitialized components
if( name.Last() == '?' )
{
name << GetParentComponent()->GetTimeStamp();
name << GetParentComponent()->m_Uuid.AsString();
annotated = false;
}

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 1992-2011 jean-pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
* Copyright (C) 1992-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2018 KiCad Developers, see authors.txt for contributors.
* Copyright (C) 1992-2020 KiCad Developers, see authors.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -23,11 +23,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file eeschema/sch_reference_list.h
*/
#ifndef _SCH_REFERENCE_LIST_H_
#define _SCH_REFERENCE_LIST_H_
@ -65,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.
timestamp_t m_TimeStamp; ///< The time stamp for the reference.
UUID 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.
@ -79,15 +74,14 @@ public:
SCH_REFERENCE() :
m_SheetPath()
{
m_RootCmp = NULL;
m_Entry = NULL;
m_Unit = 0;
m_TimeStamp = 0;
m_IsNew = false;
m_Value = NULL;
m_NumRef = 0;
m_Flag = 0;
m_SheetNum = 0;
m_RootCmp = NULL;
m_Entry = NULL;
m_Unit = 0;
m_IsNew = false;
m_Value = NULL;
m_NumRef = 0;
m_Flag = 0;
m_SheetNum = 0;
}
SCH_REFERENCE( SCH_COMPONENT* aComponent, LIB_PART* aLibComponent,
@ -215,7 +209,7 @@ public:
class SCH_REFERENCE_LIST
{
private:
std::vector <SCH_REFERENCE> componentFlatList;
std::vector <SCH_REFERENCE> flatList;
public:
/** Constructor
@ -226,7 +220,7 @@ public:
SCH_REFERENCE& operator[]( int aIndex )
{
return componentFlatList[ aIndex ];
return flatList[ aIndex ];
}
/**
@ -235,7 +229,7 @@ public:
*/
unsigned GetCount()
{
return componentFlatList.size();
return flatList.size();
}
/**
@ -244,7 +238,7 @@ public:
*/
SCH_REFERENCE& GetItem( int aIdx )
{
return componentFlatList[aIdx];
return flatList[aIdx];
}
/**
@ -254,7 +248,7 @@ public:
*/
void AddItem( SCH_REFERENCE& aItem )
{
componentFlatList.push_back( aItem );
flatList.push_back( aItem );
}
/**
@ -265,14 +259,6 @@ public:
*/
void RemoveItem( unsigned int aIndex );
/**
* Function RemoveSubComponentsFromList
* Remove sub components from the list, when multiples parts per package are
* found in this list.
* Useful to create BOM, when a component must appear only once
*/
void RemoveSubComponentsFromList();
/* Sort functions:
* Sort functions are used to sort components for annotation or BOM generation.
* Because sorting depends on what we want to do, there are many sort functions.
@ -294,7 +280,7 @@ public:
void SplitReferences()
{
for( unsigned ii = 0; ii < GetCount(); ii++ )
componentFlatList[ii].Split();
flatList[ii].Split();
}
/**
@ -309,7 +295,7 @@ public:
/* update the reference numbers */
for( unsigned ii = 0; ii < GetCount(); ii++ )
{
componentFlatList[ii].Annotate();
flatList[ii].Annotate();
}
}
@ -350,14 +336,6 @@ public:
*/
int CheckAnnotation( REPORTER& aReporter );
/**
* @brief Check components having same references designator. Must be called with references
* sorted by timestamp \ref SortByTimeStamp()
* @param aReporter A sink for error messages. Use NULL_REPORTER if you don't need errors.
* @return The number of errors found.
*/
int checkForDuplicatedElements( REPORTER& aReporter );
/**
* Function sortByXCoordinate
* sorts the list of references by X position.
@ -374,7 +352,7 @@ public:
*/
void SortByXCoordinate()
{
sort( componentFlatList.begin(), componentFlatList.end(), sortByXPosition );
sort( flatList.begin(), flatList.end(), sortByXPosition );
}
/**
@ -393,7 +371,7 @@ public:
*/
void SortByYCoordinate()
{
sort( componentFlatList.begin(), componentFlatList.end(), sortByYPosition );
sort( flatList.begin(), flatList.end(), sortByYPosition );
}
/**
@ -403,7 +381,7 @@ public:
*/
void SortByTimeStamp()
{
sort( componentFlatList.begin(), componentFlatList.end(), sortByTimeStamp );
sort( flatList.begin(), flatList.end(), sortByTimeStamp );
}
/**
@ -423,7 +401,7 @@ public:
*/
void SortByRefAndValue()
{
sort( componentFlatList.begin(), componentFlatList.end(), sortByRefAndValue );
sort( flatList.begin(), flatList.end(), sortByRefAndValue );
}
/**
@ -439,7 +417,7 @@ public:
*/
void SortByReferenceOnly()
{
sort( componentFlatList.begin(), componentFlatList.end(), sortByReferenceOnly );
sort( flatList.begin(), flatList.end(), sortByReferenceOnly );
}
/**
@ -485,9 +463,9 @@ public:
{
printf( "%s\n", aPrefix );
for( unsigned i=0; i<componentFlatList.size(); ++i )
for( unsigned i=0; i < flatList.size(); ++i )
{
SCH_REFERENCE& schref = componentFlatList[i];
SCH_REFERENCE& schref = flatList[i];
printf( " [%-2d] ref:%-8s num:%-3d lib_part:%s\n",
i,
@ -510,7 +488,7 @@ public:
friend class BACK_ANNOTATION;
private:
/* sort functions used to sort componentFlatList
/* sort functions used to sort flatList
*/
static bool sortByRefAndValue( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );

View File

@ -1081,40 +1081,28 @@ int SCH_SCREENS::ReplaceDuplicateTimeStamps()
int count = 0;
auto timestamp_cmp = []( const EDA_ITEM* a, const EDA_ITEM* b ) -> bool
{
return a->GetTimeStamp() < b->GetTimeStamp();
};
{
return a->m_Uuid < b->m_Uuid;
};
std::set<EDA_ITEM*, decltype( timestamp_cmp )> unique_stamps( timestamp_cmp );
for( size_t i = 0; i < m_screens.size(); i++ )
m_screens[i]->GetHierarchicalItems( items );
for( SCH_SCREEN* screen : m_screens )
screen->GetHierarchicalItems( items );
if( items.size() < 2 )
return 0;
for( auto item : items )
for( EDA_ITEM* item : items )
{
int failed = 0;
while( !unique_stamps.insert( item ).second )
if( !unique_stamps.insert( item ).second )
{
failed = 1;
// for a component, update its Time stamp and its paths
// (m_PathsAndReferences field)
if( item->Type() == SCH_COMPONENT_T )
static_cast<SCH_COMPONENT*>( item )->SetTimeStamp( GetNewTimeStamp() );
// for a sheet, update only its time stamp (annotation of its
// components will be lost)
// @todo: see how to change sheet paths for its cmp list (can
// be possible in most cases)
else
item->SetTimeStamp( GetNewTimeStamp() );
// 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<UUID&>( item->m_Uuid ) = UUID();
count++;
}
count += failed;
}
return count;

View File

@ -51,12 +51,11 @@ SCH_SHEET::SCH_SHEET( const wxPoint& pos ) :
m_Layer = LAYER_SHEET;
m_pos = pos;
m_size = wxSize( Mils2iu( MIN_SHEET_WIDTH ), Mils2iu( MIN_SHEET_HEIGHT ) );
SetTimeStamp( GetNewTimeStamp() );
m_sheetNameSize = GetDefaultTextSize();
m_fileNameSize = GetDefaultTextSize();
m_screen = NULL;
m_name.Printf( wxT( "Sheet%8.8lX" ), (long) m_TimeStamp );
m_fileName.Printf( wxT( "file%8.8lX.sch" ), (long) m_TimeStamp );
m_name.Printf( wxT( "Sheet%s" ), m_Uuid.AsString() );
m_fileName.Printf( wxT( "file%s.sch" ), m_Uuid.AsString() );
}
@ -66,7 +65,7 @@ SCH_SHEET::SCH_SHEET( const SCH_SHEET& aSheet ) :
m_pos = aSheet.m_pos;
m_size = aSheet.m_size;
m_Layer = aSheet.m_Layer;
SetTimeStamp( aSheet.m_TimeStamp );
const_cast<UUID&>( m_Uuid ) = aSheet.m_Uuid;
m_sheetNameSize = aSheet.m_sheetNameSize;
m_fileNameSize = aSheet.m_fileNameSize;
m_screen = aSheet.m_screen;

Some files were not shown because too many files have changed in this diff Show More