diff --git a/eeschema/sch_plugins/altium/altium_parser_sch.cpp b/eeschema/sch_plugins/altium/altium_parser_sch.cpp index 7b072b6b61..23550b4706 100644 --- a/eeschema/sch_plugins/altium/altium_parser_sch.cpp +++ b/eeschema/sch_plugins/altium/altium_parser_sch.cpp @@ -518,4 +518,14 @@ ASCH_DESIGNATOR::ASCH_DESIGNATOR( const std::map& aPropertie location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ), -PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) ); +} + +ASCH_BUS_ENTRY::ASCH_BUS_ENTRY( const std::map& aProperties ) +{ + wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::BUS_ENTRY ); + + location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ), + -PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) ); + corner = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "CORNER.X" ), + -PropertiesReadKiCadUnitFrac( aProperties, "CORNER.Y" ) ); } \ No newline at end of file diff --git a/eeschema/sch_plugins/altium/altium_parser_sch.h b/eeschema/sch_plugins/altium/altium_parser_sch.h index a796381f32..8c8c112596 100644 --- a/eeschema/sch_plugins/altium/altium_parser_sch.h +++ b/eeschema/sch_plugins/altium/altium_parser_sch.h @@ -484,4 +484,13 @@ struct ASCH_DESIGNATOR explicit ASCH_DESIGNATOR( const std::map& aProperties ); }; + +struct ASCH_BUS_ENTRY +{ + wxPoint location; + wxPoint corner; + + explicit ASCH_BUS_ENTRY( const std::map& aProperties ); +}; + #endif //ALTIUM_PARSER_SCH_H \ No newline at end of file diff --git a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp index 310192b292..7eae1c6bb2 100644 --- a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp +++ b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp @@ -375,6 +375,7 @@ void SCH_ALTIUM_PLUGIN::Parse( const CFB::CompoundFileReader& aReader ) ParseDesignator( properties ); break; case ALTIUM_SCH_RECORD::BUS_ENTRY: + ParseBusEntry( properties ); break; case ALTIUM_SCH_RECORD::TEMPLATE: break; @@ -1354,3 +1355,17 @@ void SCH_ALTIUM_PLUGIN::ParseDesignator( const std::map& aPr text->SetTextAngle( elem.orientation * 90. ); text->SetText( elem.name ); // TODO: use variable } + + +void SCH_ALTIUM_PLUGIN::ParseBusEntry( const std::map& aProperties ) +{ + ASCH_BUS_ENTRY elem( aProperties ); + + SCH_BUS_WIRE_ENTRY* busWireEntry = new SCH_BUS_WIRE_ENTRY( elem.location + m_sheetOffset ); + + wxPoint vector = elem.corner - elem.location; + busWireEntry->SetSize( { vector.x, vector.y } ); + + busWireEntry->SetFlags( IS_NEW ); + m_currentSheet->GetScreen()->Append( busWireEntry ); +} diff --git a/eeschema/sch_plugins/altium/sch_altium_plugin.h b/eeschema/sch_plugins/altium/sch_altium_plugin.h index 151624908c..ae0da369f0 100644 --- a/eeschema/sch_plugins/altium/sch_altium_plugin.h +++ b/eeschema/sch_plugins/altium/sch_altium_plugin.h @@ -118,6 +118,7 @@ private: void ParseJunction( const std::map& aProperties ); void ParseSheet( const std::map& aProperties ); void ParseDesignator( const std::map& aProperties ); + void ParseBusEntry( const std::map& aProperties ); private: SCH_SHEET* m_rootSheet; ///< The root sheet of the schematic being loaded..