Browse Source

altium: parse symbol description, remove dependency on legacy plugin

6.0.7
Thomas Pointhuber 5 years ago
parent
commit
0d3d3e0d7c
  1. 9
      eeschema/sch_plugins/altium/altium_parser_sch.cpp
  2. 7
      eeschema/sch_plugins/altium/altium_parser_sch.h
  3. 6
      eeschema/sch_plugins/altium/sch_altium_plugin.cpp

9
eeschema/sch_plugins/altium/altium_parser_sch.cpp

@ -73,11 +73,18 @@ ASCH_COMPONENT::ASCH_COMPONENT( const std::map<wxString, wxString>& aProperties
currentpartid =
ALTIUM_PARSER::PropertiesReadInt( aProperties, "CURRENTPARTID", ALTIUM_COMPONENT_NONE );
libreference = ALTIUM_PARSER::PropertiesReadString( aProperties, "LIBREFERENCE", "" );
sourcelibraryname = ALTIUM_PARSER::PropertiesReadString( aProperties, "SOURCELIBRARYNAME", "" );
componentdescription =
ALTIUM_PARSER::PropertiesReadString( aProperties, "COMPONENTDESCRIPTION", "" );
orientation = ALTIUM_PARSER::PropertiesReadInt( aProperties, "ORIENTATION", 0 );
isMirrored = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISMIRRORED", false );
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
partcount = ALTIUM_PARSER::PropertiesReadInt( aProperties, "PARTCOUNT", 0 );
displaymodecount = ALTIUM_PARSER::PropertiesReadInt( aProperties, "DISPLAYMODECOUNT", 0 );
displaymode = ALTIUM_PARSER::PropertiesReadInt( aProperties, "DISPLAYMODE", 0 );
}

7
eeschema/sch_plugins/altium/altium_parser_sch.h

@ -98,10 +98,17 @@ struct ASCH_COMPONENT
{
int currentpartid;
wxString libreference;
wxString sourcelibraryname;
wxString componentdescription;
int orientation;
bool isMirrored;
wxPoint location;
int partcount;
int displaymodecount;
int displaymode;
explicit ASCH_COMPONENT( const std::map<wxString, wxString>& aProperties );
};

6
eeschema/sch_plugins/altium/sch_altium_plugin.cpp

@ -27,7 +27,6 @@
#include <plugins/altium/altium_parser.h>
#include <plugins/altium/altium_parser_utils.h>
#include <sch_plugins/altium/sch_altium_plugin.h>
#include <sch_plugins/legacy/sch_legacy_plugin.h>
#include <schematic.h>
@ -175,8 +174,6 @@ SCH_SHEET* SCH_ALTIUM_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchem
wxCHECK_MSG( libTable, NULL, "Could not load symbol lib table." );
m_pi.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
m_properties = std::make_unique<PROPERTIES>();
( *m_properties )[SCH_LEGACY_PLUGIN::PropBuffering] = "";
/// @note No check is being done here to see if the existing symbol library exists so this
/// will overwrite the existing one.
@ -200,7 +197,7 @@ SCH_SHEET* SCH_ALTIUM_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchem
libTable->Format( &formatter, 0 );
}
// Relaod the symbol library table.
// Reload the symbol library table.
m_schematic->Prj().SetElem( PROJECT::ELEM_SYMBOL_LIB_TABLE, NULL );
m_schematic->Prj().SchSymbolLibTable();
}
@ -454,6 +451,7 @@ void SCH_ALTIUM_PLUGIN::ParseComponent( int index, const std::map<wxString, wxSt
LIB_PART* kpart = new LIB_PART( wxEmptyString );
kpart->SetName( elem.libreference );
kpart->SetDescription( elem.componentdescription );
kpart->SetLibId( libId );
m_symbols.insert( { index, kpart } );

Loading…
Cancel
Save