Record layer for starved thermal exclusions.
This commit is contained in:
parent
20791c99ac
commit
3501ad1b4d
|
@ -176,7 +176,7 @@ void DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer( ZONE* aZone, PCB_LAYER_I
|
|||
drce->SetItems( aZone, pad );
|
||||
drce->SetViolatingRule( constraint.GetParentRule() );
|
||||
|
||||
reportViolation( drce, pad->GetPosition(), UNDEFINED_LAYER );
|
||||
reportViolation( drce, pad->GetPosition(), aLayer );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -962,7 +962,7 @@ void PCB_EDIT_FRAME::RecordDRCExclusions()
|
|||
|
||||
for( PCB_MARKER* marker : GetBoard()->Markers() )
|
||||
{
|
||||
if( marker->GetSeverity() == RPT_SEVERITY_EXCLUSION )
|
||||
if( marker->IsExcluded() )
|
||||
bds.m_DrcExclusions.insert( marker->Serialize() );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,8 +94,6 @@ PCB_MARKER::~PCB_MARKER()
|
|||
|
||||
wxString PCB_MARKER::Serialize() const
|
||||
{
|
||||
wxString lastItem;
|
||||
|
||||
if( m_rcItem->GetErrorCode() == DRCE_COPPER_SLIVER )
|
||||
{
|
||||
return wxString::Format( wxT( "%s|%d|%d|%s|%s" ),
|
||||
|
@ -105,6 +103,16 @@ wxString PCB_MARKER::Serialize() const
|
|||
m_rcItem->GetMainItemID().AsString(),
|
||||
LayerName( m_layer ) );
|
||||
}
|
||||
else if( m_rcItem->GetErrorCode() == DRCE_STARVED_THERMAL )
|
||||
{
|
||||
return wxString::Format( wxT( "%s|%d|%d|%s|%s|%s" ),
|
||||
m_rcItem->GetSettingsKey(),
|
||||
m_Pos.x,
|
||||
m_Pos.y,
|
||||
m_rcItem->GetMainItemID().AsString(),
|
||||
m_rcItem->GetAuxItemID().AsString(),
|
||||
LayerName( m_layer ) );
|
||||
}
|
||||
else if( m_rcItem->GetErrorCode() == DRCE_UNRESOLVED_VARIABLE
|
||||
&& m_rcItem->GetParent()->GetMarkerType() == MARKER_DRAWING_SHEET )
|
||||
{
|
||||
|
@ -130,6 +138,18 @@ wxString PCB_MARKER::Serialize() const
|
|||
|
||||
PCB_MARKER* PCB_MARKER::Deserialize( const wxString& data )
|
||||
{
|
||||
auto getMarkerLayer =
|
||||
[]( const wxString& layerName ) -> int
|
||||
{
|
||||
for( int layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer )
|
||||
{
|
||||
if( LayerName( ToLAYER_ID( layer ) ) == layerName )
|
||||
return layer;
|
||||
}
|
||||
|
||||
return F_Cu;
|
||||
};
|
||||
|
||||
wxArrayString props = wxSplit( data, '|' );
|
||||
int markerLayer = F_Cu;
|
||||
VECTOR2I markerPos( (int) strtol( props[1].c_str(), nullptr, 10 ),
|
||||
|
@ -143,15 +163,15 @@ PCB_MARKER* PCB_MARKER::Deserialize( const wxString& data )
|
|||
if( drcItem->GetErrorCode() == DRCE_COPPER_SLIVER )
|
||||
{
|
||||
drcItem->SetItems( KIID( props[3] ) );
|
||||
markerLayer = getMarkerLayer( props[4] );
|
||||
}
|
||||
else if( drcItem->GetErrorCode() == DRCE_STARVED_THERMAL )
|
||||
{
|
||||
drcItem->SetItems( KIID( props[3] ), KIID( props[4] ) );
|
||||
|
||||
for( int layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer )
|
||||
{
|
||||
if( LayerName( ToLAYER_ID( layer ) ) == props[4] )
|
||||
{
|
||||
markerLayer = layer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Pre-7.0 versions didn't differentiate between layers
|
||||
if( props.size() == 6 )
|
||||
markerLayer = getMarkerLayer( props[5] );
|
||||
}
|
||||
else if( drcItem->GetErrorCode() == DRCE_UNRESOLVED_VARIABLE
|
||||
&& props[3].IsEmpty() && props[4].IsEmpty() )
|
||||
|
|
Loading…
Reference in New Issue