30#define PNSLOGINFO PNS::DEBUG_DECORATOR::SRC_LOCATION_INFO( __FILE__, __FUNCTION__, __LINE__ )
57 m_router->Sizes().SetTrackWidth( 250000 );
70 std::vector<PNS::ITEM*> added, removed, heads;
71 m_router->GetUpdatedItems( removed, added, heads );
74 for(
auto item : removed )
79 for(
auto item : added )
98 int totalEvents = aLog->
Events().size();
100 for(
auto evt : aLog->
Events() )
102 if( eventIdx < aFrom || ( aTo >= 0 && eventIdx > aTo ) )
106 ITEM* ritem = item ?
m_router->GetWorld()->FindItemByParent( item ) :
nullptr;
112 case LOGGER::EVT_START_ROUTE:
117 auto msg =
wxString::Format(
"event [%d/%d]: route-start (%d, %d)", eventIdx, totalEvents, evt.p.x, evt.p.y );
126 case LOGGER::EVT_START_DRAG:
131 auto msg =
wxString::Format(
"event [%d/%d]: drag-start (%d, %d)", eventIdx, totalEvents, evt.p.x, evt.p.y );
136 bool rv =
m_router->StartDragging( evt.p, ritem, 0 );
140 case LOGGER::EVT_FIX:
145 bool rv =
m_router->FixRoute( evt.p, ritem );
146 printf(
" fix -> (%d, %d) ret %d\n", evt.p.x, evt.p.y, rv ? 1 : 0 );
150 case LOGGER::EVT_UNFIX:
155 printf(
" unfix\n" );
160 case LOGGER::EVT_MOVE:
165 auto msg =
wxString::Format(
"event [%d/%d]: move (%d, %d)", eventIdx, totalEvents, evt.p.x, evt.p.y );
170 bool ret =
m_router->Move( evt.p, ritem );
175 case LOGGER::EVT_TOGGLE_VIA:
179 auto msg =
wxString::Format(
"event [%d/%d]: toggle-via", eventIdx, totalEvents );
199 auto traces =
m_router->Placer()->Traces();
201 for(
const auto& t : traces.CItems() )
203 const LINE *l =
static_cast<LINE*
>(t.item);
204 const auto& sh = l->
CLine();
211 node =
m_router->Placer()->CurrentNode(
true );
215 node =
m_router->GetDragger()->CurrentNode();
224 if( ! added.empty() )
229 for(
auto t : added )
247 printf(
"Comparing %zu added/%zu removed items\n", cstate.m_addedItems.size(), cstate.m_removedIds.size() );
253 m_viewTracker( aViewTracker )
static REPORTER & GetInstance()
Base class for PNS router board items.
virtual ITEM * Clone() const =0
Return a deep copy of the item.
const LAYER_RANGE & Layers() const
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
const SHAPE_LINE_CHAIN & CLine() const
Keep the router "world" - i.e.
std::vector< ITEM * > ITEM_VECTOR
void GetUpdatedItems(ITEM_VECTOR &aRemoved, ITEM_VECTOR &aAdded)
Return the list of items removed and added in this branch with respect to the root branch.
Contain all persistent settings of the router, such as the mode, optimization effort,...
std::vector< EVENT_ENTRY > & Events()
const COMMIT_STATE & GetExpectedResult() const
BOARD_CONNECTED_ITEM * ItemById(const EVENT_ENTRY &evt)
PNS::ROUTING_SETTINGS * GetRoutingSettings() const
std::shared_ptr< BOARD > GetBoard() const
void DisplayItem(const PNS::ITEM *aItem, int aClearance, bool aEdit=false, bool aIsHeadTrace=false) override
PNS_LOG_PLAYER_KICAD_IFACE(PNS_LOG_VIEW_TRACKER *aViewTracker)
PNS_LOG_VIEW_TRACKER * m_viewTracker
void HideItem(PNS::ITEM *aItem) override
~PNS_LOG_PLAYER_KICAD_IFACE()
PNS_TEST_DEBUG_DECORATOR * m_debugDecorator
std::shared_ptr< BOARD > m_board
const PNS_LOG_FILE::COMMIT_STATE GetRouterUpdatedItems()
bool CompareResults(PNS_LOG_FILE *aLog)
std::unique_ptr< PNS::ROUTER > m_router
std::shared_ptr< PNS_LOG_VIEW_TRACKER > m_viewTracker
std::unique_ptr< PNS_LOG_PLAYER_KICAD_IFACE > m_iface
void ReplayLog(PNS_LOG_FILE *aLog, int aStartEventIndex=0, int aFrom=0, int aTo=-1)
void SetReporter(REPORTER *aReporter)
std::map< int, VIEW_ENTRIES > m_vitems
void DisplayItem(const PNS::ITEM *aItem)
void HideItem(PNS::ITEM *aItem)
std::vector< ENTRY > VIEW_ENTRIES
void SetStage(int aStage)
int GetStageCount() const
virtual void AddItem(const PNS::ITEM *aItem, const KIGFX::COLOR4D &aColor, int aOverrideWidth=0, const wxString &aName=wxT(""), const SRC_LOCATION_INFO &aSrcLoc=SRC_LOCATION_INFO()) override
virtual void Message(const wxString &msg, const SRC_LOCATION_INFO &aSrcLoc=SRC_LOCATION_INFO()) override
virtual void BeginGroup(const wxString &name, int aLevel=0, const SRC_LOCATION_INFO &aSrcLoc=SRC_LOCATION_INFO()) override
virtual void EndGroup(const SRC_LOCATION_INFO &aSrcLoc=SRC_LOCATION_INFO()) override
virtual void NewStage(const wxString &name, int iter, const SRC_LOCATION_INFO &aSrcLoc=SRC_LOCATION_INFO()) override
virtual void Clear() override
void SetCurrentStageStatus(bool stat)
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
Push and Shove diff pair dimensions (gap) settings dialog.
@ RM_Walkaround
Only walk around.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
std::set< KIID > m_removedIds
std::set< PNS::ITEM * > m_addedItems