本文整理汇总了C++中SCH_ITEM::GetTimeStamp方法的典型用法代码示例。如果您正苦于以下问题:C++ SCH_ITEM::GetTimeStamp方法的具体用法?C++ SCH_ITEM::GetTimeStamp怎么用?C++ SCH_ITEM::GetTimeStamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SCH_ITEM
的用法示例。
在下文中一共展示了SCH_ITEM::GetTimeStamp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReplaceDuplicateTimeStamps
int SCH_SCREENS::ReplaceDuplicateTimeStamps()
{
EDA_ITEMS items;
SCH_ITEM* item;
for( size_t i = 0; i < m_screens.size(); i++ )
m_screens[i]->GetHierarchicalItems( items );
if( items.size() < 2 )
return 0;
sort( items.begin(), items.end(), SortByTimeStamp );
int count = 0;
for( size_t ii = 0; ii < items.size() - 1; ii++ )
{
item = (SCH_ITEM*)items[ii];
SCH_ITEM* nextItem = (SCH_ITEM*)items[ii + 1];
if( item->GetTimeStamp() == nextItem->GetTimeStamp() )
{
count++;
// for a component, update its Time stamp and its paths
// (m_PathsAndReferences field)
if( item->Type() == SCH_COMPONENT_T )
( (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() );
}
}
return count;
}