Altium schematic: import net label justification.

This commit is contained in:
Alex Shvartzkop 2023-07-04 10:27:43 +03:00
parent afe176abe2
commit 37772ac29e
3 changed files with 5 additions and 21 deletions

View File

@ -667,6 +667,9 @@ ASCH_NET_LABEL::ASCH_NET_LABEL( const std::map<wxString, wxString>& aProps )
location = VECTOR2I( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
justification = ReadEnum<ASCH_LABEL_JUSTIFICATION>( aProps, "JUSTIFICATION", 0, 8,
ASCH_LABEL_JUSTIFICATION::BOTTOM_LEFT );
orientation = ReadEnum<ASCH_RECORD_ORIENTATION>( aProps, "ORIENTATION", 0, 3,
ASCH_RECORD_ORIENTATION::RIGHTWARDS );
}

View File

@ -664,6 +664,7 @@ struct ASCH_NET_LABEL
VECTOR2I location;
ASCH_LABEL_JUSTIFICATION justification;
ASCH_RECORD_ORIENTATION orientation;
explicit ASCH_NET_LABEL( const std::map<wxString, wxString>& aProps );

View File

@ -2640,27 +2640,7 @@ void SCH_ALTIUM_PLUGIN::ParseNetLabel( const std::map<wxString, wxString>& aProp
SCH_SCREEN* screen = getCurrentScreen();
wxCHECK( screen, /* void */ );
switch( elem.orientation )
{
case ASCH_RECORD_ORIENTATION::RIGHTWARDS:
label->SetTextSpinStyle( TEXT_SPIN_STYLE::RIGHT );
break;
case ASCH_RECORD_ORIENTATION::UPWARDS:
label->SetTextSpinStyle( TEXT_SPIN_STYLE::UP );
break;
case ASCH_RECORD_ORIENTATION::LEFTWARDS:
label->SetTextSpinStyle( TEXT_SPIN_STYLE::LEFT );
break;
case ASCH_RECORD_ORIENTATION::DOWNWARDS:
label->SetTextSpinStyle( TEXT_SPIN_STYLE::BOTTOM );
break;
default:
break;
}
SetTextPositioning( label, elem.justification, elem.orientation );
label->SetFlags( IS_NEW );
screen->Append( label );