altium: add some more pin types, and reverse engineer symbol outer and symbol inner

This commit is contained in:
Thomas Pointhuber 2020-10-09 17:13:18 +02:00 committed by Jon Evans
parent 53d90431ea
commit 30ea1a274e
3 changed files with 63 additions and 4 deletions

View File

@ -74,8 +74,15 @@ ASCH_PIN::ASCH_PIN( const std::map<wxString, wxString>& aProperties )
text = ALTIUM_PARSER::PropertiesReadString( aProperties, "TEXT", "" ); text = ALTIUM_PARSER::PropertiesReadString( aProperties, "TEXT", "" );
designator = ALTIUM_PARSER::PropertiesReadString( aProperties, "DESIGNATOR", "" ); designator = ALTIUM_PARSER::PropertiesReadString( aProperties, "DESIGNATOR", "" );
int symbolOuterInt = ALTIUM_PARSER::PropertiesReadInt( aProperties, "SYMBOL_OUTER", 0 );
symbolOuter = static_cast<ASCH_PIN_SYMBOL_OUTER>( symbolOuterInt );
int symbolInnerInt = ALTIUM_PARSER::PropertiesReadInt( aProperties, "SYMBOL_INNER", 0 );
symbolInner = static_cast<ASCH_PIN_SYMBOL_INNER>( symbolInnerInt );
int symbolOuterEdgeInt = ALTIUM_PARSER::PropertiesReadInt( aProperties, "SYMBOL_OUTEREDGE", 0 ); int symbolOuterEdgeInt = ALTIUM_PARSER::PropertiesReadInt( aProperties, "SYMBOL_OUTEREDGE", 0 );
symbolOuterEdge = ( symbolOuterEdgeInt >= 0 && symbolOuterEdgeInt <= 1 ) ? symbolOuterEdge = ( symbolOuterEdgeInt == 0 || symbolOuterEdgeInt == 1
|| symbolOuterEdgeInt == 4 || symbolOuterEdgeInt == 17 ) ?
static_cast<ASCH_PIN_SYMBOL_OUTEREDGE>( symbolOuterEdgeInt ) : static_cast<ASCH_PIN_SYMBOL_OUTEREDGE>( symbolOuterEdgeInt ) :
ASCH_PIN_SYMBOL_OUTEREDGE::UNKNOWN; ASCH_PIN_SYMBOL_OUTEREDGE::UNKNOWN;

View File

@ -93,11 +93,44 @@ struct ASCH_COMPONENT
}; };
enum class ASCH_PIN_SYMBOL_OUTER
{
UNKNOWN = -1,
NO_SYMBOL = 0,
RIGHT_LEFT_SIGNAL_FLOW = 2,
ANALOG_SIGNAL_IN = 5,
NOT_LOGIC_CONNECTION = 6,
DIGITAL_SIGNAL_IN = 25,
LEFT_RIGHT_SIGNAL_FLOW = 33,
BIDI_SIGNAL_FLOW = 34
};
enum class ASCH_PIN_SYMBOL_INNER
{
UNKNOWN = -1,
NO_SYMBOL = 0,
POSPONED_OUTPUT = 8,
OPEN_COLLECTOR = 9,
HIZ = 10,
HIGH_CURRENT = 11,
PULSE = 12,
SCHMITT = 13,
OPEN_COLLECTOR_PULL_UP = 22,
OPEN_EMITTER = 23,
OPEN_EMITTER_PULL_UP = 24,
SHIFT_LEFT = 30,
OPEN_OUTPUT = 32
};
enum class ASCH_PIN_SYMBOL_OUTEREDGE enum class ASCH_PIN_SYMBOL_OUTEREDGE
{ {
UNKNOWN = -1, UNKNOWN = -1,
NO_SYMBOL = 0, NO_SYMBOL = 0,
NEGATED = 1, NEGATED = 1,
LOW_INPUT = 4,
LOW_OUTPUT = 17
}; };
@ -142,6 +175,9 @@ struct ASCH_PIN
wxString text; wxString text;
wxString designator; wxString designator;
ASCH_PIN_SYMBOL_OUTER symbolOuter;
ASCH_PIN_SYMBOL_INNER symbolInner;
ASCH_PIN_SYMBOL_OUTEREDGE symbolOuterEdge; ASCH_PIN_SYMBOL_OUTEREDGE symbolOuterEdge;
ASCH_PIN_SYMBOL_INNEREDGE symbolInnerEdge; ASCH_PIN_SYMBOL_INNEREDGE symbolInnerEdge;

View File

@ -555,6 +555,22 @@ void SCH_ALTIUM_PLUGIN::ParsePin( const std::map<wxString, wxString>& aPropertie
break; break;
} }
} }
else if( elem.symbolOuterEdge == ASCH_PIN_SYMBOL_OUTEREDGE::LOW_INPUT )
{
switch( elem.symbolInnerEdge )
{
case ASCH_PIN_SYMBOL_INNEREDGE::CLOCK:
pin->SetShape( GRAPHIC_PINSHAPE::CLOCK_LOW );
break;
default:
pin->SetShape( GRAPHIC_PINSHAPE::INPUT_LOW );
break;
}
}
else if( elem.symbolOuterEdge == ASCH_PIN_SYMBOL_OUTEREDGE::LOW_OUTPUT )
{
pin->SetShape( GRAPHIC_PINSHAPE::OUTPUT_LOW );
}
else else
{ {
switch( elem.symbolInnerEdge ) switch( elem.symbolInnerEdge )