Altium schematic: support Line dash styles and colors.
Master commit: a2b7bf97b9
This commit is contained in:
parent
be991cfcd6
commit
951fd2d693
|
@ -331,13 +331,8 @@ ASCH_POLYLINE::ASCH_POLYLINE( const std::map<wxString, wxString>& aProps )
|
||||||
LineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
LineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
||||||
Color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 );
|
Color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 );
|
||||||
|
|
||||||
int linestyleVar = ALTIUM_PARSER::ReadInt( aProps, "LINESTYLEEXT", 0 );
|
auto lineStyleExt = ReadEnum( aProps, "LINESTYLEEXT", 0, 3, ASCH_POLYLINE_LINESTYLE::SOLID );
|
||||||
|
LineStyle = ReadEnum( aProps, "LINESTYLE", 0, 3, lineStyleExt ); // overwrite if present.
|
||||||
// overwrite if present.
|
|
||||||
linestyleVar = ALTIUM_PARSER::ReadInt( aProps, "LINESTYLE", linestyleVar );
|
|
||||||
LineStyle = linestyleVar >= 0 && linestyleVar <= 3 ?
|
|
||||||
static_cast<ASCH_POLYLINE_LINESTYLE>( linestyleVar ) :
|
|
||||||
ASCH_POLYLINE_LINESTYLE::SOLID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -447,7 +442,11 @@ ASCH_LINE::ASCH_LINE( const std::map<wxString, wxString>& aProps )
|
||||||
point2 = VECTOR2I( ReadKiCadUnitFrac( aProps, "CORNER.X" ),
|
point2 = VECTOR2I( ReadKiCadUnitFrac( aProps, "CORNER.X" ),
|
||||||
-ReadKiCadUnitFrac( aProps, "CORNER.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "CORNER.Y" ) );
|
||||||
|
|
||||||
lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
LineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
||||||
|
Color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 );
|
||||||
|
|
||||||
|
auto lineStyleExt = ReadEnum( aProps, "LINESTYLEEXT", 0, 3, ASCH_POLYLINE_LINESTYLE::SOLID );
|
||||||
|
LineStyle = ReadEnum( aProps, "LINESTYLE", 0, 3, lineStyleExt ); // overwrite if present.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -679,8 +678,6 @@ ASCH_BUS::ASCH_BUS( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::BUS );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::BUS );
|
||||||
|
|
||||||
indexinsheet = ALTIUM_PARSER::ReadInt( aProps, "INDEXINSHEET", 0 );
|
|
||||||
|
|
||||||
int locationcount = ALTIUM_PARSER::ReadInt( aProps, "LOCATIONCOUNT", 0 );
|
int locationcount = ALTIUM_PARSER::ReadInt( aProps, "LOCATIONCOUNT", 0 );
|
||||||
|
|
||||||
for( int i = 1; i <= locationcount; i++ )
|
for( int i = 1; i <= locationcount; i++ )
|
||||||
|
@ -698,8 +695,6 @@ ASCH_WIRE::ASCH_WIRE( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::WIRE );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::WIRE );
|
||||||
|
|
||||||
indexinsheet = ALTIUM_PARSER::ReadInt( aProps, "INDEXINSHEET", 0 );
|
|
||||||
|
|
||||||
int locationcount = ALTIUM_PARSER::ReadInt( aProps, "LOCATIONCOUNT", 0 );
|
int locationcount = ALTIUM_PARSER::ReadInt( aProps, "LOCATIONCOUNT", 0 );
|
||||||
|
|
||||||
for( int i = 1; i <= locationcount; i++ )
|
for( int i = 1; i <= locationcount; i++ )
|
||||||
|
|
|
@ -437,7 +437,10 @@ struct ASCH_LINE
|
||||||
VECTOR2I point1;
|
VECTOR2I point1;
|
||||||
VECTOR2I point2;
|
VECTOR2I point2;
|
||||||
|
|
||||||
int lineWidth;
|
int LineWidth;
|
||||||
|
int Color;
|
||||||
|
|
||||||
|
ASCH_POLYLINE_LINESTYLE LineStyle;
|
||||||
|
|
||||||
explicit ASCH_LINE( const std::map<wxString, wxString>& aProps );
|
explicit ASCH_LINE( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
|
@ -1743,7 +1743,10 @@ void SCH_ALTIUM_PLUGIN::ParseLine( const std::map<wxString, wxString>& aProperti
|
||||||
// close polygon
|
// close polygon
|
||||||
SCH_LINE* line = new SCH_LINE( elem.point1 + m_sheetOffset, SCH_LAYER_ID::LAYER_NOTES );
|
SCH_LINE* line = new SCH_LINE( elem.point1 + m_sheetOffset, SCH_LAYER_ID::LAYER_NOTES );
|
||||||
line->SetEndPoint( elem.point2 + m_sheetOffset );
|
line->SetEndPoint( elem.point2 + m_sheetOffset );
|
||||||
line->SetStroke( STROKE_PARAMS( elem.lineWidth, PLOT_DASH_TYPE::SOLID ) ); // TODO?
|
|
||||||
|
COLOR4D color = GetColorFromInt( elem.Color );
|
||||||
|
line->SetStroke( STROKE_PARAMS( elem.LineWidth, GetPlotDashType( elem.LineStyle ),
|
||||||
|
color == PUREBLUE ? COLOR4D::UNSPECIFIED : color ) );
|
||||||
|
|
||||||
line->SetFlags( IS_NEW );
|
line->SetFlags( IS_NEW );
|
||||||
screen->Append( line );
|
screen->Append( line );
|
||||||
|
@ -1773,7 +1776,9 @@ void SCH_ALTIUM_PLUGIN::ParseLine( const std::map<wxString, wxString>& aProperti
|
||||||
line->AddPoint( GetRelativePosition( elem.point1 + m_sheetOffset, symbol ) );
|
line->AddPoint( GetRelativePosition( elem.point1 + m_sheetOffset, symbol ) );
|
||||||
line->AddPoint( GetRelativePosition( elem.point2 + m_sheetOffset, symbol ) );
|
line->AddPoint( GetRelativePosition( elem.point2 + m_sheetOffset, symbol ) );
|
||||||
|
|
||||||
line->SetStroke( STROKE_PARAMS( elem.lineWidth, PLOT_DASH_TYPE::SOLID ) );
|
COLOR4D color = GetColorFromInt( elem.Color );
|
||||||
|
line->SetStroke( STROKE_PARAMS( elem.LineWidth, GetPlotDashType( elem.LineStyle ),
|
||||||
|
color == PUREBLUE ? COLOR4D::UNSPECIFIED : color ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue