Update PSN logger to new NET_HANDLE architecture.

This commit is contained in:
Jeff Young 2023-08-23 14:06:24 +01:00
parent 0c37e3c443
commit 6166a96b8e
2 changed files with 14 additions and 17 deletions

View File

@ -289,7 +289,10 @@ const std::string ITEM::Format() const
{
std::stringstream ss;
ss << KindStr() << " ";
ss << "net " << Net() << " ";
if( Parent()->IsConnected() )
ss << "net " << static_cast<BOARD_CONNECTED_ITEM*>( Parent() )->GetNetCode() << " ";
ss << "layers " << m_layers.Start() << " " << m_layers.End();
return ss.str();
}

View File

@ -104,23 +104,17 @@ static std::shared_ptr<SHAPE> parseShape( SHAPE_TYPE expectedType, wxStringToken
bool parseCommonPnsProps( PNS::ITEM* aItem, const wxString& cmd, wxStringTokenizer& aTokens )
{
if( cmd == "net" )
{
if( aItem->Parent() && aItem->Parent()->GetBoard() )
if( cmd == "net" )
{
aItem->SetNet( aItem->Parent()->GetBoard()->FindNet( aTokens.GetNextToken() ) );
return true;
}
return false;
}
else if( cmd == "layers" )
{
int start = wxAtoi( aTokens.GetNextToken() );
int end = wxAtoi( aTokens.GetNextToken() );
aItem->SetLayers( LAYER_RANGE( start, end ) );
return true;
}
aItem->SetNet( m_board->FindNet( aTokens.GetNextToken() ) );
return true;
} else if ( cmd == "layers" )
{
int start = wxAtoi( aTokens.GetNextToken() );
int end = wxAtoi( aTokens.GetNextToken() );
aItem->SetLayers( LAYER_RANGE( start, end ));
return true;
}
return false;
}