Fix build; renaming.

This commit is contained in:
Alex Shvartzkop 2023-11-28 22:18:33 +03:00
parent 4d2b964f52
commit f84bab00b4
3 changed files with 29 additions and 29 deletions

View File

@ -537,7 +537,7 @@ void PCB_TUNING_PATTERN::EditStart( GENERATOR_TOOL* aTool, BOARD* aBoard,
int layer = GetLayer(); int layer = GetLayer();
PNS::ROUTER* router = aTool->Router(); PNS::ROUTER* router = aTool->Router();
aTool->ClearRouterCommits(); aTool->ClearRouterChanges();
router->SyncWorld(); router->SyncWorld();
PNS::RULE_RESOLVER* resolver = router->GetRuleResolver(); PNS::RULE_RESOLVER* resolver = router->GetRuleResolver();
@ -854,7 +854,7 @@ void PCB_TUNING_PATTERN::Remove( GENERATOR_TOOL* aTool, BOARD* aBoard, PCB_BASE_
aCommit->Remove( this ); aCommit->Remove( this );
aTool->ClearRouterCommits(); aTool->ClearRouterChanges();
if( baselineValid() ) if( baselineValid() )
{ {
@ -864,14 +864,14 @@ void PCB_TUNING_PATTERN::Remove( GENERATOR_TOOL* aTool, BOARD* aBoard, PCB_BASE_
removeToBaseline( router, layer, *m_baseLineCoupled ); removeToBaseline( router, layer, *m_baseLineCoupled );
} }
const std::vector<GENERATOR_TOOL_PNS_PROXY::PNS_COMMIT>& pnsCommits = aTool->GetRouterCommits(); const std::vector<GENERATOR_PNS_CHANGES>& allPnsChanges = aTool->GetRouterChanges();
for( const GENERATOR_TOOL_PNS_PROXY::PNS_COMMIT& pnsCommit : pnsCommits ) for( const GENERATOR_PNS_CHANGES& pnsChanges : allPnsChanges )
{ {
const std::set<BOARD_ITEM*> routerRemovedItems = pnsCommit.removedItems; const std::set<BOARD_ITEM*> routerRemovedItems = pnsChanges.removedItems;
const std::set<BOARD_ITEM*> routerAddedItems = pnsCommit.addedItems; const std::set<BOARD_ITEM*> routerAddedItems = pnsChanges.addedItems;
/*std::cout << "Push commits << " << pnsCommits.size() << " routerRemovedItems " /*std::cout << "Push commits << " << allPnsChanges.size() << " routerRemovedItems "
<< routerRemovedItems.size() << " routerAddedItems " << routerAddedItems.size() << routerRemovedItems.size() << " routerAddedItems " << routerAddedItems.size()
<< " m_removedItems " << m_removedItems.size() << std::endl;*/ << " m_removedItems " << m_removedItems.size() << std::endl;*/
@ -1166,14 +1166,14 @@ void PCB_TUNING_PATTERN::EditPush( GENERATOR_TOOL* aTool, BOARD* aBoard,
m_removedItems.clear(); m_removedItems.clear();
const std::vector<GENERATOR_TOOL_PNS_PROXY::PNS_COMMIT>& pnsCommits = aTool->GetRouterCommits(); const std::vector<GENERATOR_PNS_CHANGES>& pnsCommits = aTool->GetRouterChanges();
for( const GENERATOR_TOOL_PNS_PROXY::PNS_COMMIT& pnsCommit : pnsCommits ) for( const GENERATOR_PNS_CHANGES& pnsCommit : pnsCommits )
{ {
const std::set<BOARD_ITEM*> routerRemovedItems = pnsCommit.removedItems; const std::set<BOARD_ITEM*> routerRemovedItems = pnsCommit.removedItems;
const std::set<BOARD_ITEM*> routerAddedItems = pnsCommit.addedItems; const std::set<BOARD_ITEM*> routerAddedItems = pnsCommit.addedItems;
//std::cout << "Push commits << " << pnsCommits.size() << " routerRemovedItems " //std::cout << "Push commits << " << allPnsChanges.size() << " routerRemovedItems "
// << routerRemovedItems.size() << " routerAddedItems " << routerAddedItems.size() // << routerRemovedItems.size() << " routerAddedItems " << routerAddedItems.size()
// << " m_removedItems " << m_removedItems.size() << std::endl; // << " m_removedItems " << m_removedItems.size() << std::endl;

View File

@ -46,13 +46,13 @@ public:
void Commit() override void Commit() override
{ // { //
m_commits.emplace_back(); m_changes.emplace_back();
} }
void ClearCommits() void ClearCommits()
{ {
m_commits.clear(); m_changes.clear();
m_commits.emplace_back(); m_changes.emplace_back();
} }
void AddItem( PNS::ITEM* aItem ) override void AddItem( PNS::ITEM* aItem ) override
@ -64,7 +64,7 @@ public:
aItem->SetParent( brdItem ); aItem->SetParent( brdItem );
brdItem->ClearFlags(); brdItem->ClearFlags();
m_commits.back().addedItems.emplace( brdItem ); m_changes.back().addedItems.emplace( brdItem );
} }
} }
@ -88,27 +88,26 @@ public:
if( parent ) if( parent )
{ {
m_commits.back().removedItems.emplace( parent ); m_changes.back().removedItems.emplace( parent );
} }
} }
std::vector<GENERATOR_TOOL_PNS_PROXY::PNS_COMMIT>& Commits() { return m_commits; }; std::vector<GENERATOR_PNS_CHANGES>& Changes() { return m_changes; };
private: private:
std::vector<GENERATOR_TOOL_PNS_PROXY::PNS_COMMIT> m_commits; std::vector<GENERATOR_PNS_CHANGES> m_changes;
}; };
void GENERATOR_TOOL_PNS_PROXY::ClearRouterCommits() void GENERATOR_TOOL_PNS_PROXY::ClearRouterChanges()
{ {
static_cast<PNS_KICAD_IFACE_GENERATOR*>( GetInterface() )->ClearCommits(); static_cast<PNS_KICAD_IFACE_GENERATOR*>( GetInterface() )->ClearCommits();
} }
const std::vector<GENERATOR_TOOL_PNS_PROXY::PNS_COMMIT>& const std::vector<GENERATOR_PNS_CHANGES>& GENERATOR_TOOL_PNS_PROXY::GetRouterChanges()
GENERATOR_TOOL_PNS_PROXY::GetRouterCommits()
{ {
return static_cast<PNS_KICAD_IFACE_GENERATOR*>( GetInterface() )->Commits(); return static_cast<PNS_KICAD_IFACE_GENERATOR*>( GetInterface() )->Changes();
} }

View File

@ -30,26 +30,27 @@
class BOARD_ITEM; class BOARD_ITEM;
struct GENERATOR_PNS_CHANGES
{
std::set<BOARD_ITEM*> addedItems;
std::set<BOARD_ITEM*> removedItems;
};
/** /**
* A proxy class to allow access to the PNS router from the generator tool. * A proxy class to allow access to the PNS router from the generator tool.
*/ */
class GENERATOR_TOOL_PNS_PROXY : public PNS::TOOL_BASE class GENERATOR_TOOL_PNS_PROXY : public PNS::TOOL_BASE
{ {
public: public:
static struct PNS_COMMIT
{
std::set<BOARD_ITEM*> addedItems;
std::set<BOARD_ITEM*> removedItems;
};
GENERATOR_TOOL_PNS_PROXY( const std::string& aToolName ); GENERATOR_TOOL_PNS_PROXY( const std::string& aToolName );
~GENERATOR_TOOL_PNS_PROXY(); ~GENERATOR_TOOL_PNS_PROXY();
/// @copydoc TOOL_INTERACTIVE::Reset() /// @copydoc TOOL_INTERACTIVE::Reset()
void Reset( RESET_REASON aReason ) override; void Reset( RESET_REASON aReason ) override;
void ClearRouterCommits(); void ClearRouterChanges();
const std::vector<GENERATOR_TOOL_PNS_PROXY::PNS_COMMIT>& GetRouterCommits(); const std::vector<GENERATOR_PNS_CHANGES>& GetRouterChanges();
}; };
#endif // GENERATOR_TOOL_PNS_PROXY_H #endif // GENERATOR_TOOL_PNS_PROXY_H