Reduce line-breaks and increase SNR.
This commit is contained in:
parent
dd31a5383b
commit
531f5480a7
|
@ -193,22 +193,21 @@ int32_t ALTIUM_PARSER::ConvertToKicadUnit( const double aValue )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ALTIUM_PARSER::PropertiesReadInt( const std::map<wxString, wxString>& aProperties,
|
int ALTIUM_PARSER::ReadInt( const std::map<wxString, wxString>& aProps, const wxString& aKey,
|
||||||
const wxString& aKey, int aDefault )
|
int aDefault )
|
||||||
{
|
{
|
||||||
const std::map<wxString, wxString>::const_iterator& value = aProperties.find( aKey );
|
const std::map<wxString, wxString>::const_iterator& value = aProps.find( aKey );
|
||||||
return value == aProperties.end() ? aDefault : wxAtoi( value->second );
|
return value == aProps.end() ? aDefault : wxAtoi( value->second );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
double ALTIUM_PARSER::PropertiesReadDouble( const std::map<wxString, wxString>& aProperties,
|
double ALTIUM_PARSER::ReadDouble( const std::map<wxString, wxString>& aProps, const wxString& aKey,
|
||||||
const wxString& aKey, double aDefault )
|
double aDefault )
|
||||||
{
|
{
|
||||||
const std::map<wxString, wxString>::const_iterator& value = aProperties.find( aKey );
|
const std::map<wxString, wxString>::const_iterator& value = aProps.find( aKey );
|
||||||
if( value == aProperties.end() )
|
|
||||||
{
|
if( value == aProps.end() )
|
||||||
return aDefault;
|
return aDefault;
|
||||||
}
|
|
||||||
|
|
||||||
// Locale independent str -> double conversation
|
// Locale independent str -> double conversation
|
||||||
std::istringstream istr( (const char*) value->second.mb_str() );
|
std::istringstream istr( (const char*) value->second.mb_str() );
|
||||||
|
@ -220,21 +219,22 @@ double ALTIUM_PARSER::PropertiesReadDouble( const std::map<wxString, wxString>&
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ALTIUM_PARSER::PropertiesReadBool( const std::map<wxString, wxString>& aProperties,
|
bool ALTIUM_PARSER::ReadBool( const std::map<wxString, wxString>& aProps, const wxString& aKey,
|
||||||
const wxString& aKey, bool aDefault )
|
bool aDefault )
|
||||||
{
|
{
|
||||||
const std::map<wxString, wxString>::const_iterator& value = aProperties.find( aKey );
|
const std::map<wxString, wxString>::const_iterator& value = aProps.find( aKey );
|
||||||
if( value == aProperties.end() )
|
|
||||||
|
if( value == aProps.end() )
|
||||||
return aDefault;
|
return aDefault;
|
||||||
else
|
else
|
||||||
return value->second == "T" || value->second == "TRUE";
|
return value->second == "T" || value->second == "TRUE";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t ALTIUM_PARSER::PropertiesReadKicadUnit( const std::map<wxString, wxString>& aProperties,
|
int32_t ALTIUM_PARSER::ReadKicadUnit( const std::map<wxString, wxString>& aProps,
|
||||||
const wxString& aKey, const wxString& aDefault )
|
const wxString& aKey, const wxString& aDefault )
|
||||||
{
|
{
|
||||||
const wxString& value = PropertiesReadString( aProperties, aKey, aDefault );
|
const wxString& value = ReadString( aProps, aKey, aDefault );
|
||||||
|
|
||||||
wxString prefix;
|
wxString prefix;
|
||||||
|
|
||||||
|
@ -256,17 +256,17 @@ int32_t ALTIUM_PARSER::PropertiesReadKicadUnit( const std::map<wxString, wxStrin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxString ALTIUM_PARSER::PropertiesReadString( const std::map<wxString, wxString>& aProperties,
|
wxString ALTIUM_PARSER::ReadString( const std::map<wxString, wxString>& aProps,
|
||||||
const wxString& aKey, const wxString& aDefault )
|
const wxString& aKey, const wxString& aDefault )
|
||||||
{
|
{
|
||||||
const auto& utf8Value = aProperties.find( wxString( "%UTF8%" ) + aKey );
|
const auto& utf8Value = aProps.find( wxString( "%UTF8%" ) + aKey );
|
||||||
|
|
||||||
if( utf8Value != aProperties.end() )
|
if( utf8Value != aProps.end() )
|
||||||
return utf8Value->second;
|
return utf8Value->second;
|
||||||
|
|
||||||
const auto& value = aProperties.find( aKey );
|
const auto& value = aProps.find( aKey );
|
||||||
|
|
||||||
if( value != aProperties.end() )
|
if( value != aProps.end() )
|
||||||
return value->second;
|
return value->second;
|
||||||
|
|
||||||
return aDefault;
|
return aDefault;
|
||||||
|
|
|
@ -139,20 +139,20 @@ public:
|
||||||
|
|
||||||
static int32_t ConvertToKicadUnit( const double aValue );
|
static int32_t ConvertToKicadUnit( const double aValue );
|
||||||
|
|
||||||
static int PropertiesReadInt( const std::map<wxString, wxString>& aProperties,
|
static int ReadInt( const std::map<wxString, wxString>& aProps,
|
||||||
const wxString& aKey, int aDefault );
|
const wxString& aKey, int aDefault );
|
||||||
|
|
||||||
static double PropertiesReadDouble( const std::map<wxString, wxString>& aProperties,
|
static double ReadDouble( const std::map<wxString, wxString>& aProps,
|
||||||
const wxString& aKey, double aDefault );
|
const wxString& aKey, double aDefault );
|
||||||
|
|
||||||
static bool PropertiesReadBool( const std::map<wxString, wxString>& aProperties,
|
static bool ReadBool( const std::map<wxString, wxString>& aProps,
|
||||||
const wxString& aKey, bool aDefault );
|
const wxString& aKey, bool aDefault );
|
||||||
|
|
||||||
static int32_t PropertiesReadKicadUnit( const std::map<wxString, wxString>& aProperties,
|
static int32_t ReadKicadUnit( const std::map<wxString, wxString>& aProps,
|
||||||
const wxString& aKey, const wxString& aDefault );
|
const wxString& aKey, const wxString& aDefault );
|
||||||
|
|
||||||
static wxString PropertiesReadString( const std::map<wxString, wxString>& aProperties,
|
static wxString ReadString( const std::map<wxString, wxString>& aProps,
|
||||||
const wxString& aKey, const wxString& aDefault );
|
const wxString& aKey, const wxString& aDefault );
|
||||||
|
|
||||||
void Skip( size_t aLength )
|
void Skip( size_t aLength )
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,9 +34,9 @@
|
||||||
#include "sch_plugins/altium/altium_parser_sch.h"
|
#include "sch_plugins/altium/altium_parser_sch.h"
|
||||||
|
|
||||||
|
|
||||||
ALTIUM_SCH_RECORD PropertiesReadRecord( const std::map<wxString, wxString>& aProperties )
|
ALTIUM_SCH_RECORD ReadRecord( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
int recordId = ALTIUM_PARSER::PropertiesReadInt( aProperties, "RECORD", 0 );
|
int recordId = ALTIUM_PARSER::ReadInt( aProps, "RECORD", 0 );
|
||||||
return static_cast<ALTIUM_SCH_RECORD>( recordId );
|
return static_cast<ALTIUM_SCH_RECORD>( recordId );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,44 +47,42 @@ constexpr int Altium2KiCadUnit( const int val, const int frac )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PropertiesReadKiCadUnitFrac( const std::map<wxString, wxString>& aProperties,
|
int ReadKiCadUnitFrac( const std::map<wxString, wxString>& aProps, const wxString& aKey )
|
||||||
const wxString& aKey )
|
|
||||||
{
|
{
|
||||||
// a unit is stored using two fields, denoting the size in mils and a fraction size
|
// a unit is stored using two fields, denoting the size in mils and a fraction size
|
||||||
int key = ALTIUM_PARSER::PropertiesReadInt( aProperties, aKey, 0 );
|
int key = ALTIUM_PARSER::ReadInt( aProps, aKey, 0 );
|
||||||
int keyFrac = ALTIUM_PARSER::PropertiesReadInt( aProperties, aKey + "_FRAC", 0 );
|
int keyFrac = ALTIUM_PARSER::ReadInt( aProps, aKey + "_FRAC", 0 );
|
||||||
return Altium2KiCadUnit( key, keyFrac );
|
return Altium2KiCadUnit( key, keyFrac );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PropertiesReadKiCadUnitFrac1( const std::map<wxString, wxString>& aProperties,
|
int ReadKiCadUnitFrac1( const std::map<wxString, wxString>& aProps, const wxString& aKey )
|
||||||
const wxString& aKey )
|
|
||||||
{
|
{
|
||||||
// a unit is stored using two fields, denoting the size in mils and a fraction size
|
// a unit is stored using two fields, denoting the size in mils and a fraction size
|
||||||
// Dunno why Altium invents different units for the same purpose
|
// Dunno why Altium invents different units for the same purpose
|
||||||
int key = ALTIUM_PARSER::PropertiesReadInt( aProperties, aKey, 0 );
|
int key = ALTIUM_PARSER::ReadInt( aProps, aKey, 0 );
|
||||||
int keyFrac = ALTIUM_PARSER::PropertiesReadInt( aProperties, aKey + "_FRAC1", 0 );
|
int keyFrac = ALTIUM_PARSER::ReadInt( aProps, aKey + "_FRAC1", 0 );
|
||||||
return Altium2KiCadUnit( key * 10, keyFrac );
|
return Altium2KiCadUnit( key * 10, keyFrac );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PropertiesReadOwnerIndex( const std::map<wxString, wxString>& aProperties )
|
int ReadOwnerIndex( const std::map<wxString, wxString>& aProperties )
|
||||||
{
|
{
|
||||||
return ALTIUM_PARSER::PropertiesReadInt( aProperties, "OWNERINDEX", ALTIUM_COMPONENT_NONE );
|
return ALTIUM_PARSER::ReadInt( aProperties, "OWNERINDEX", ALTIUM_COMPONENT_NONE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PropertiesReadOwnerPartId( const std::map<wxString, wxString>& aProperties )
|
int ReadOwnerPartId( const std::map<wxString, wxString>& aProperties )
|
||||||
{
|
{
|
||||||
return ALTIUM_PARSER::PropertiesReadInt( aProperties, "OWNERPARTID", ALTIUM_COMPONENT_NONE );
|
return ALTIUM_PARSER::ReadInt( aProperties, "OWNERPARTID", ALTIUM_COMPONENT_NONE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T PropertiesReadEnum( const std::map<wxString, wxString>& aProperties, const wxString& aKey,
|
T ReadEnum( const std::map<wxString, wxString>& aProps, const wxString& aKey, int aLower,
|
||||||
int aLower, int aUpper, T aDefault )
|
int aUpper, T aDefault )
|
||||||
{
|
{
|
||||||
int value = ALTIUM_PARSER::PropertiesReadInt( aProperties, aKey, static_cast<int>( aDefault ) );
|
int value = ALTIUM_PARSER::ReadInt( aProps, aKey, static_cast<int>( aDefault ));
|
||||||
|
|
||||||
if( value < aLower || value > aUpper )
|
if( value < aLower || value > aUpper )
|
||||||
return aDefault;
|
return aDefault;
|
||||||
|
@ -101,79 +99,75 @@ ASCH_STORAGE_FILE::ASCH_STORAGE_FILE( ALTIUM_PARSER& aReader )
|
||||||
data = aReader.ReadVector( dataSize );
|
data = aReader.ReadVector( dataSize );
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Storage stream was not parsed correctly" );
|
THROW_IO_ERROR( "Storage stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_SYMBOL::ASCH_SYMBOL( const std::map<wxString, wxString>& aProperties )
|
ASCH_SYMBOL::ASCH_SYMBOL( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::COMPONENT );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::COMPONENT );
|
||||||
|
|
||||||
currentpartid = ALTIUM_PARSER::PropertiesReadInt( aProperties, "CURRENTPARTID",
|
currentpartid = ALTIUM_PARSER::ReadInt( aProps, "CURRENTPARTID", ALTIUM_COMPONENT_NONE );
|
||||||
ALTIUM_COMPONENT_NONE );
|
libreference = ALTIUM_PARSER::ReadString( aProps, "LIBREFERENCE", "" );
|
||||||
libreference = ALTIUM_PARSER::PropertiesReadString( aProperties, "LIBREFERENCE", "" );
|
sourcelibraryname = ALTIUM_PARSER::ReadString( aProps, "SOURCELIBRARYNAME", "" );
|
||||||
sourcelibraryname = ALTIUM_PARSER::PropertiesReadString( aProperties, "SOURCELIBRARYNAME", "" );
|
componentdescription = ALTIUM_PARSER::ReadString( aProps, "COMPONENTDESCRIPTION", "" );
|
||||||
componentdescription = ALTIUM_PARSER::PropertiesReadString( aProperties, "COMPONENTDESCRIPTION",
|
|
||||||
"" );
|
|
||||||
|
|
||||||
orientation = ALTIUM_PARSER::PropertiesReadInt( aProperties, "ORIENTATION", 0 );
|
orientation = ALTIUM_PARSER::ReadInt( aProps, "ORIENTATION", 0 );
|
||||||
isMirrored = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISMIRRORED", false );
|
isMirrored = ALTIUM_PARSER::ReadBool( aProps, "ISMIRRORED", false );
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
|
|
||||||
partcount = ALTIUM_PARSER::PropertiesReadInt( aProperties, "PARTCOUNT", 0 );
|
partcount = ALTIUM_PARSER::ReadInt( aProps, "PARTCOUNT", 0 );
|
||||||
displaymodecount = ALTIUM_PARSER::PropertiesReadInt( aProperties, "DISPLAYMODECOUNT", 0 );
|
displaymodecount = ALTIUM_PARSER::ReadInt( aProps, "DISPLAYMODECOUNT", 0 );
|
||||||
displaymode = ALTIUM_PARSER::PropertiesReadInt( aProperties, "DISPLAYMODE", 0 );
|
displaymode = ALTIUM_PARSER::ReadInt( aProps, "DISPLAYMODE", 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_PIN::ASCH_PIN( const std::map<wxString, wxString>& aProperties )
|
ASCH_PIN::ASCH_PIN( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::PIN );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::PIN );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
ownerpartdisplaymode = ALTIUM_PARSER::PropertiesReadInt( aProperties, "OWNERPARTDISPLAYMODE", 0 );
|
ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 );
|
||||||
|
|
||||||
name = ALTIUM_PARSER::PropertiesReadString( aProperties, "NAME", "" );
|
name = ALTIUM_PARSER::ReadString( aProps, "NAME", "" );
|
||||||
text = ALTIUM_PARSER::PropertiesReadString( aProperties, "TEXT", "" );
|
text = ALTIUM_PARSER::ReadString( aProps, "TEXT", "" );
|
||||||
designator = ALTIUM_PARSER::PropertiesReadString( aProperties, "DESIGNATOR", "" );
|
designator = ALTIUM_PARSER::ReadString( aProps, "DESIGNATOR", "" );
|
||||||
|
|
||||||
int symbolOuterInt = ALTIUM_PARSER::PropertiesReadInt( aProperties, "SYMBOL_OUTER", 0 );
|
int symbolOuterInt = ALTIUM_PARSER::ReadInt( aProps, "SYMBOL_OUTER", 0 );
|
||||||
symbolOuter = static_cast<ASCH_PIN_SYMBOL_OUTER>( symbolOuterInt );
|
symbolOuter = static_cast<ASCH_PIN_SYMBOL_OUTER>( symbolOuterInt );
|
||||||
|
|
||||||
int symbolInnerInt = ALTIUM_PARSER::PropertiesReadInt( aProperties, "SYMBOL_INNER", 0 );
|
int symbolInnerInt = ALTIUM_PARSER::ReadInt( aProps, "SYMBOL_INNER", 0 );
|
||||||
symbolInner = static_cast<ASCH_PIN_SYMBOL_INNER>( symbolInnerInt );
|
symbolInner = static_cast<ASCH_PIN_SYMBOL_INNER>( symbolInnerInt );
|
||||||
|
|
||||||
int symbolOuterEdgeInt = ALTIUM_PARSER::PropertiesReadInt( aProperties, "SYMBOL_OUTEREDGE", 0 );
|
int symbolOuterEdgeInt = ALTIUM_PARSER::ReadInt( aProps, "SYMBOL_OUTEREDGE", 0 );
|
||||||
symbolOuterEdge = ( symbolOuterEdgeInt == 0 || symbolOuterEdgeInt == 1
|
symbolOuterEdge = ( symbolOuterEdgeInt == 0 || symbolOuterEdgeInt == 1
|
||||||
|| symbolOuterEdgeInt == 4 || symbolOuterEdgeInt == 17 ) ?
|
|| symbolOuterEdgeInt == 4 || symbolOuterEdgeInt == 17 ) ?
|
||||||
static_cast<ASCH_PIN_SYMBOL_OUTEREDGE>( symbolOuterEdgeInt ) :
|
static_cast<ASCH_PIN_SYMBOL_OUTEREDGE>( symbolOuterEdgeInt ) :
|
||||||
ASCH_PIN_SYMBOL_OUTEREDGE::NO_SYMBOL;
|
ASCH_PIN_SYMBOL_OUTEREDGE::NO_SYMBOL;
|
||||||
|
|
||||||
int symbolInnerEdgeInt = ALTIUM_PARSER::PropertiesReadInt( aProperties, "SYMBOL_INNEREDGE", 0 );
|
int symbolInnerEdgeInt = ALTIUM_PARSER::ReadInt( aProps, "SYMBOL_INNEREDGE", 0 );
|
||||||
symbolInnerEdge = ( symbolInnerEdgeInt == 0 || symbolInnerEdgeInt == 3 ) ?
|
symbolInnerEdge = ( symbolInnerEdgeInt == 0 || symbolInnerEdgeInt == 3 ) ?
|
||||||
static_cast<ASCH_PIN_SYMBOL_INNEREDGE>( symbolInnerEdgeInt ) :
|
static_cast<ASCH_PIN_SYMBOL_INNEREDGE>( symbolInnerEdgeInt ) :
|
||||||
ASCH_PIN_SYMBOL_INNEREDGE::NO_SYMBOL;
|
ASCH_PIN_SYMBOL_INNEREDGE::NO_SYMBOL;
|
||||||
electrical = PropertiesReadEnum<ASCH_PIN_ELECTRICAL>(
|
electrical = ReadEnum<ASCH_PIN_ELECTRICAL>( aProps, "ELECTRICAL", 0, 7,
|
||||||
aProperties, "ELECTRICAL", 0, 7, ASCH_PIN_ELECTRICAL::INPUT );
|
ASCH_PIN_ELECTRICAL::INPUT );
|
||||||
|
|
||||||
int pinconglomerate = ALTIUM_PARSER::PropertiesReadInt( aProperties, "PINCONGLOMERATE", 0 );
|
int pinconglomerate = ALTIUM_PARSER::ReadInt( aProps, "PINCONGLOMERATE", 0 );
|
||||||
|
|
||||||
orientation = static_cast<ASCH_RECORD_ORIENTATION>( pinconglomerate & 0x03 );
|
orientation = static_cast<ASCH_RECORD_ORIENTATION>( pinconglomerate & 0x03 );
|
||||||
showPinName = ( pinconglomerate & 0x08 ) != 0;
|
showPinName = ( pinconglomerate & 0x08 ) != 0;
|
||||||
showDesignator = ( pinconglomerate & 0x10 ) != 0;
|
showDesignator = ( pinconglomerate & 0x10 ) != 0;
|
||||||
|
|
||||||
int x = ALTIUM_PARSER::PropertiesReadInt( aProperties, "LOCATION.X", 0 );
|
int x = ALTIUM_PARSER::ReadInt( aProps, "LOCATION.X", 0 );
|
||||||
int xfrac = ALTIUM_PARSER::PropertiesReadInt( aProperties, "LOCATION.X_FRAC", 0 );
|
int xfrac = ALTIUM_PARSER::ReadInt( aProps, "LOCATION.X_FRAC", 0 );
|
||||||
int y = ALTIUM_PARSER::PropertiesReadInt( aProperties, "LOCATION.Y", 0 );
|
int y = ALTIUM_PARSER::ReadInt( aProps, "LOCATION.Y", 0 );
|
||||||
int yfrac = ALTIUM_PARSER::PropertiesReadInt( aProperties, "LOCATION.Y_FRAC", 0 );
|
int yfrac = ALTIUM_PARSER::ReadInt( aProps, "LOCATION.Y_FRAC", 0 );
|
||||||
location = wxPoint( Altium2KiCadUnit( x, xfrac ), -Altium2KiCadUnit( y, yfrac ) );
|
location = wxPoint( Altium2KiCadUnit( x, xfrac ), -Altium2KiCadUnit( y, yfrac ) );
|
||||||
|
|
||||||
int p = ALTIUM_PARSER::PropertiesReadInt( aProperties, "PINLENGTH", 0 );
|
int p = ALTIUM_PARSER::ReadInt( aProps, "PINLENGTH", 0 );
|
||||||
int pfrac = ALTIUM_PARSER::PropertiesReadInt( aProperties, "PINLENGTH_FRAC", 0 );
|
int pfrac = ALTIUM_PARSER::ReadInt( aProps, "PINLENGTH_FRAC", 0 );
|
||||||
pinlength = Altium2KiCadUnit( p, pfrac );
|
pinlength = Altium2KiCadUnit( p, pfrac );
|
||||||
|
|
||||||
// this code calculates the location as required by KiCad without rounding error attached
|
// this code calculates the location as required by KiCad without rounding error attached
|
||||||
|
@ -204,416 +198,403 @@ ASCH_PIN::ASCH_PIN( const std::map<wxString, wxString>& aProperties )
|
||||||
wxLogWarning( "Pin has unexpected orientation" );
|
wxLogWarning( "Pin has unexpected orientation" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
kicadLocation = wxPoint(
|
|
||||||
Altium2KiCadUnit( kicadX, kicadXfrac ), -Altium2KiCadUnit( kicadY, kicadYfrac ) );
|
kicadLocation = wxPoint( Altium2KiCadUnit( kicadX, kicadXfrac ),
|
||||||
|
-Altium2KiCadUnit( kicadY, kicadYfrac ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_LABEL::ASCH_LABEL( const std::map<wxString, wxString>& aProperties )
|
ASCH_LABEL::ASCH_LABEL( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::LABEL );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::LABEL );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
|
|
||||||
text = ALTIUM_PARSER::PropertiesReadString( aProperties, "TEXT", "" );
|
text = ALTIUM_PARSER::ReadString( aProps, "TEXT", "" );
|
||||||
|
|
||||||
fontId = ALTIUM_PARSER::PropertiesReadInt( aProperties, "FONTID", 0 );
|
fontId = ALTIUM_PARSER::ReadInt( aProps, "FONTID", 0 );
|
||||||
isMirrored = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISMIRRORED", false );
|
isMirrored = ALTIUM_PARSER::ReadBool( aProps, "ISMIRRORED", false );
|
||||||
|
|
||||||
justification = PropertiesReadEnum<ASCH_LABEL_JUSTIFICATION>(
|
justification = ReadEnum<ASCH_LABEL_JUSTIFICATION>( aProps, "JUSTIFICATION", 0, 8,
|
||||||
aProperties, "JUSTIFICATION", 0, 8, ASCH_LABEL_JUSTIFICATION::BOTTOM_LEFT );
|
ASCH_LABEL_JUSTIFICATION::BOTTOM_LEFT );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_TEXT_FRAME::ASCH_TEXT_FRAME( const std::map<wxString, wxString>& aProperties )
|
ASCH_TEXT_FRAME::ASCH_TEXT_FRAME( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::NOTE
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::NOTE
|
||||||
|| PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::TEXT_FRAME );
|
|| ReadRecord( aProps ) == ALTIUM_SCH_RECORD::TEXT_FRAME );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
size = wxSize( PropertiesReadKiCadUnitFrac( aProperties, "CORNER.X" ) - location.x,
|
size = wxSize( ReadKiCadUnitFrac( aProps, "CORNER.X" ) - location.x,
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "CORNER.Y" ) - location.y );
|
-ReadKiCadUnitFrac( aProps, "CORNER.Y" ) - location.y );
|
||||||
|
|
||||||
text = ALTIUM_PARSER::PropertiesReadString( aProperties, "TEXT", "" );
|
text = ALTIUM_PARSER::ReadString( aProps, "TEXT", "" );
|
||||||
text.Replace( "~1", "\n", true );
|
text.Replace( "~1", "\n", true );
|
||||||
|
|
||||||
fontId = ALTIUM_PARSER::PropertiesReadInt( aProperties, "FONTID", 0 );
|
fontId = ALTIUM_PARSER::ReadInt( aProps, "FONTID", 0 );
|
||||||
isWordWrapped = ALTIUM_PARSER::PropertiesReadBool( aProperties, "WORDWRAP", false );
|
isWordWrapped = ALTIUM_PARSER::ReadBool( aProps, "WORDWRAP", false );
|
||||||
border = ALTIUM_PARSER::PropertiesReadBool( aProperties, "SHOWBORDER", false );
|
border = ALTIUM_PARSER::ReadBool( aProps, "SHOWBORDER", false );
|
||||||
textMargin = PropertiesReadKiCadUnitFrac( aProperties, "TEXTMARGIN" );
|
textMargin = ReadKiCadUnitFrac( aProps, "TEXTMARGIN" );
|
||||||
areaColor = ALTIUM_PARSER::PropertiesReadInt( aProperties, "AREACOLOR", 0 );
|
areaColor = ALTIUM_PARSER::ReadInt( aProps, "AREACOLOR", 0 );
|
||||||
|
|
||||||
alignment = PropertiesReadEnum<ASCH_TEXT_FRAME_ALIGNMENT>(
|
alignment = ReadEnum<ASCH_TEXT_FRAME_ALIGNMENT>( aProps, "ALIGNMENT", 1, 3,
|
||||||
aProperties, "ALIGNMENT", 1, 3, ASCH_TEXT_FRAME_ALIGNMENT::LEFT );
|
ASCH_TEXT_FRAME_ALIGNMENT::LEFT );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_NOTE::ASCH_NOTE( const std::map<wxString, wxString>& aProperties ) :
|
ASCH_NOTE::ASCH_NOTE( const std::map<wxString, wxString>& aProperties ) :
|
||||||
ASCH_TEXT_FRAME( aProperties )
|
ASCH_TEXT_FRAME( aProperties )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::NOTE );
|
wxASSERT( ReadRecord( aProperties ) == ALTIUM_SCH_RECORD::NOTE );
|
||||||
|
|
||||||
author = ALTIUM_PARSER::PropertiesReadString( aProperties, "AUTHOR", "" );
|
author = ALTIUM_PARSER::ReadString( aProperties, "AUTHOR", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_BEZIER::ASCH_BEZIER( const std::map<wxString, wxString>& aProperties )
|
ASCH_BEZIER::ASCH_BEZIER( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::BEZIER );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::BEZIER );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
ownerpartdisplaymode = ALTIUM_PARSER::PropertiesReadInt( aProperties, "OWNERPARTDISPLAYMODE", 0 );
|
ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 );
|
||||||
|
|
||||||
int locationCount = ALTIUM_PARSER::PropertiesReadInt( aProperties, "LOCATIONCOUNT", 0 );
|
int locationCount = ALTIUM_PARSER::ReadInt( aProps, "LOCATIONCOUNT", 0 );
|
||||||
|
|
||||||
for( int i = 1; i <= locationCount; i++ )
|
for( int i = 1; i <= locationCount; i++ )
|
||||||
{
|
{
|
||||||
const wxString si = std::to_string( i );
|
const wxString si = std::to_string( i );
|
||||||
points.emplace_back( PropertiesReadKiCadUnitFrac( aProperties, "X" + si ),
|
points.emplace_back( ReadKiCadUnitFrac( aProps, "X" + si ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "Y" + si ) );
|
-ReadKiCadUnitFrac( aProps, "Y" + si ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
lineWidth = PropertiesReadKiCadUnitFrac( aProperties, "LINEWIDTH" );
|
lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_POLYLINE::ASCH_POLYLINE( const std::map<wxString, wxString>& aProperties )
|
ASCH_POLYLINE::ASCH_POLYLINE( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::POLYLINE );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::POLYLINE );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
ownerpartdisplaymode = ALTIUM_PARSER::PropertiesReadInt( aProperties, "OWNERPARTDISPLAYMODE", 0 );
|
ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 );
|
||||||
|
|
||||||
int locationCount = ALTIUM_PARSER::PropertiesReadInt( aProperties, "LOCATIONCOUNT", 0 );
|
int locationCount = ALTIUM_PARSER::ReadInt( aProps, "LOCATIONCOUNT", 0 );
|
||||||
|
|
||||||
for( int i = 1; i <= locationCount; i++ )
|
for( int i = 1; i <= locationCount; i++ )
|
||||||
{
|
{
|
||||||
const wxString si = std::to_string( i );
|
const wxString si = std::to_string( i );
|
||||||
points.emplace_back( PropertiesReadKiCadUnitFrac( aProperties, "X" + si ),
|
points.emplace_back( ReadKiCadUnitFrac( aProps, "X" + si ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "Y" + si ) );
|
-ReadKiCadUnitFrac( aProps, "Y" + si ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
lineWidth = PropertiesReadKiCadUnitFrac( aProperties, "LINEWIDTH" );
|
lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
||||||
|
|
||||||
int linestyleVar = ALTIUM_PARSER::PropertiesReadInt( aProperties, "LINESTYLEEXT", 0 );
|
int linestyleVar = ALTIUM_PARSER::ReadInt( aProps, "LINESTYLEEXT", 0 );
|
||||||
linestyleVar = ALTIUM_PARSER::PropertiesReadInt(
|
linestyleVar = ALTIUM_PARSER::ReadInt( aProps, "LINESTYLE", linestyleVar ); // overwrite if present
|
||||||
aProperties, "LINESTYLE", linestyleVar ); // overwrite if present
|
linestyle = linestyleVar >= 0 && linestyleVar <= 3 ?
|
||||||
linestyle = linestyleVar >= 0 && linestyleVar <= 3 ?
|
static_cast<ASCH_POLYLINE_LINESTYLE>( linestyleVar ) :
|
||||||
static_cast<ASCH_POLYLINE_LINESTYLE>( linestyleVar ) :
|
ASCH_POLYLINE_LINESTYLE::SOLID;
|
||||||
ASCH_POLYLINE_LINESTYLE::SOLID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_POLYGON::ASCH_POLYGON( const std::map<wxString, wxString>& aProperties )
|
ASCH_POLYGON::ASCH_POLYGON( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::POLYGON );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::POLYGON );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
ownerpartdisplaymode = ALTIUM_PARSER::PropertiesReadInt( aProperties, "OWNERPARTDISPLAYMODE", 0 );
|
ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 );
|
||||||
|
|
||||||
int locationCount = ALTIUM_PARSER::PropertiesReadInt( aProperties, "LOCATIONCOUNT", 0 );
|
int locationCount = ALTIUM_PARSER::ReadInt( aProps, "LOCATIONCOUNT", 0 );
|
||||||
|
|
||||||
for( int i = 1; i <= locationCount; i++ )
|
for( int i = 1; i <= locationCount; i++ )
|
||||||
{
|
{
|
||||||
const wxString si = std::to_string( i );
|
const wxString si = std::to_string( i );
|
||||||
points.emplace_back( PropertiesReadKiCadUnitFrac( aProperties, "X" + si ),
|
points.emplace_back( ReadKiCadUnitFrac( aProps, "X" + si ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "Y" + si ) );
|
-ReadKiCadUnitFrac( aProps, "Y" + si ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
lineWidth = PropertiesReadKiCadUnitFrac( aProperties, "LINEWIDTH" );
|
lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
||||||
isSolid = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISSOLID", false );
|
isSolid = ALTIUM_PARSER::ReadBool( aProps, "ISSOLID", false );
|
||||||
|
|
||||||
color = ALTIUM_PARSER::PropertiesReadInt( aProperties, "COLOR", 0 );
|
color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 );
|
||||||
areacolor = ALTIUM_PARSER::PropertiesReadInt( aProperties, "AREACOLOR", 0 );
|
areacolor = ALTIUM_PARSER::ReadInt( aProps, "AREACOLOR", 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_ROUND_RECTANGLE::ASCH_ROUND_RECTANGLE( const std::map<wxString, wxString>& aProperties )
|
ASCH_ROUND_RECTANGLE::ASCH_ROUND_RECTANGLE( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::ROUND_RECTANGLE );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::ROUND_RECTANGLE );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
ownerpartdisplaymode = ALTIUM_PARSER::PropertiesReadInt( aProperties, "OWNERPARTDISPLAYMODE", 0 );
|
ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 );
|
||||||
|
|
||||||
bottomLeft = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
bottomLeft = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
topRight = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "CORNER.X" ),
|
topRight = wxPoint( ReadKiCadUnitFrac( aProps, "CORNER.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "CORNER.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "CORNER.Y" ) );
|
||||||
|
|
||||||
topRight = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "CORNERXRADIUS" ),
|
topRight = wxPoint( ReadKiCadUnitFrac( aProps, "CORNERXRADIUS" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "CORNERYRADIUS" ) );
|
-ReadKiCadUnitFrac( aProps, "CORNERYRADIUS" ) );
|
||||||
|
|
||||||
lineWidth = PropertiesReadKiCadUnitFrac( aProperties, "LINEWIDTH" );
|
lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
||||||
isSolid = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISSOLID", false );
|
isSolid = ALTIUM_PARSER::ReadBool( aProps, "ISSOLID", false );
|
||||||
isTransparent = ALTIUM_PARSER::PropertiesReadBool( aProperties, "TRANSPARENT", false );
|
isTransparent = ALTIUM_PARSER::ReadBool( aProps, "TRANSPARENT", false );
|
||||||
|
|
||||||
color = ALTIUM_PARSER::PropertiesReadInt( aProperties, "COLOR", 0 );
|
color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 );
|
||||||
areacolor = ALTIUM_PARSER::PropertiesReadInt( aProperties, "AREACOLOR", 0 );
|
areacolor = ALTIUM_PARSER::ReadInt( aProps, "AREACOLOR", 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_ARC::ASCH_ARC( const std::map<wxString, wxString>& aProperties )
|
ASCH_ARC::ASCH_ARC( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::ARC );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::ARC );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
ownerpartdisplaymode = ALTIUM_PARSER::PropertiesReadInt( aProperties, "OWNERPARTDISPLAYMODE", 0 );
|
ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 );
|
||||||
|
|
||||||
center = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
center = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
radius = PropertiesReadKiCadUnitFrac( aProperties, "RADIUS" );
|
radius = ReadKiCadUnitFrac( aProps, "RADIUS" );
|
||||||
|
|
||||||
startAngle = ALTIUM_PARSER::PropertiesReadDouble( aProperties, "STARTANGLE", 0 );
|
startAngle = ALTIUM_PARSER::ReadDouble( aProps, "STARTANGLE", 0 );
|
||||||
endAngle = ALTIUM_PARSER::PropertiesReadDouble( aProperties, "ENDANGLE", 0 );
|
endAngle = ALTIUM_PARSER::ReadDouble( aProps, "ENDANGLE", 0 );
|
||||||
|
|
||||||
lineWidth = PropertiesReadKiCadUnitFrac( aProperties, "LINEWIDTH" );
|
lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_LINE::ASCH_LINE( const std::map<wxString, wxString>& aProperties )
|
ASCH_LINE::ASCH_LINE( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::LINE );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::LINE );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
ownerpartdisplaymode = ALTIUM_PARSER::PropertiesReadInt( aProperties, "OWNERPARTDISPLAYMODE", 0 );
|
ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 );
|
||||||
|
|
||||||
point1 = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
point1 = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
point2 = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "CORNER.X" ),
|
point2 = wxPoint( ReadKiCadUnitFrac( aProps, "CORNER.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "CORNER.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "CORNER.Y" ) );
|
||||||
|
|
||||||
lineWidth = PropertiesReadKiCadUnitFrac( aProperties, "LINEWIDTH" );
|
lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_RECTANGLE::ASCH_RECTANGLE( const std::map<wxString, wxString>& aProperties )
|
ASCH_RECTANGLE::ASCH_RECTANGLE( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::RECTANGLE );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::RECTANGLE );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
ownerpartdisplaymode = ALTIUM_PARSER::PropertiesReadInt( aProperties, "OWNERPARTDISPLAYMODE", 0 );
|
ownerpartdisplaymode = ALTIUM_PARSER::ReadInt( aProps, "OWNERPARTDISPLAYMODE", 0 );
|
||||||
|
|
||||||
bottomLeft = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
bottomLeft = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
topRight = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "CORNER.X" ),
|
topRight = wxPoint( ReadKiCadUnitFrac( aProps, "CORNER.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "CORNER.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "CORNER.Y" ) );
|
||||||
|
|
||||||
lineWidth = PropertiesReadKiCadUnitFrac( aProperties, "LINEWIDTH" );
|
lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
||||||
isSolid = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISSOLID", false );
|
isSolid = ALTIUM_PARSER::ReadBool( aProps, "ISSOLID", false );
|
||||||
isTransparent = ALTIUM_PARSER::PropertiesReadBool( aProperties, "TRANSPARENT", false );
|
isTransparent = ALTIUM_PARSER::ReadBool( aProps, "TRANSPARENT", false );
|
||||||
|
|
||||||
color = ALTIUM_PARSER::PropertiesReadInt( aProperties, "COLOR", 0 );
|
color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 );
|
||||||
areacolor = ALTIUM_PARSER::PropertiesReadInt( aProperties, "AREACOLOR", 0 );
|
areacolor = ALTIUM_PARSER::ReadInt( aProps, "AREACOLOR", 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_SHEET_SYMBOL::ASCH_SHEET_SYMBOL( const std::map<wxString, wxString>& aProperties )
|
ASCH_SHEET_SYMBOL::ASCH_SHEET_SYMBOL( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::SHEET_SYMBOL );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::SHEET_SYMBOL );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
size = wxSize( PropertiesReadKiCadUnitFrac( aProperties, "XSIZE" ),
|
size = wxSize( ReadKiCadUnitFrac( aProps, "XSIZE" ),
|
||||||
PropertiesReadKiCadUnitFrac( aProperties, "YSIZE" ) );
|
ReadKiCadUnitFrac( aProps, "YSIZE" ) );
|
||||||
|
|
||||||
isSolid = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISSOLID", false );
|
isSolid = ALTIUM_PARSER::ReadBool( aProps, "ISSOLID", false );
|
||||||
|
|
||||||
color = ALTIUM_PARSER::PropertiesReadInt( aProperties, "COLOR", 0 );
|
color = ALTIUM_PARSER::ReadInt( aProps, "COLOR", 0 );
|
||||||
areacolor = ALTIUM_PARSER::PropertiesReadInt( aProperties, "AREACOLOR", 0 );
|
areacolor = ALTIUM_PARSER::ReadInt( aProps, "AREACOLOR", 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_SHEET_ENTRY::ASCH_SHEET_ENTRY( const std::map<wxString, wxString>& aProperties )
|
ASCH_SHEET_ENTRY::ASCH_SHEET_ENTRY( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::SHEET_ENTRY );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::SHEET_ENTRY );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
|
|
||||||
// some magic, because it stores those infos in a different unit??
|
// some magic, because it stores those infos in a different unit??
|
||||||
distanceFromTop = PropertiesReadKiCadUnitFrac1( aProperties, "DISTANCEFROMTOP" );
|
distanceFromTop = ReadKiCadUnitFrac1( aProps, "DISTANCEFROMTOP" );
|
||||||
|
|
||||||
side = PropertiesReadEnum<ASCH_SHEET_ENTRY_SIDE>(
|
side = ReadEnum<ASCH_SHEET_ENTRY_SIDE>( aProps, "SIDE", 0, 3, ASCH_SHEET_ENTRY_SIDE::LEFT );
|
||||||
aProperties, "SIDE", 0, 3, ASCH_SHEET_ENTRY_SIDE::LEFT );
|
|
||||||
|
|
||||||
name = ALTIUM_PARSER::PropertiesReadString( aProperties, "NAME", "" );
|
name = ALTIUM_PARSER::ReadString( aProps, "NAME", "" );
|
||||||
|
|
||||||
iotype = PropertiesReadEnum<ASCH_PORT_IOTYPE>(
|
iotype = ReadEnum<ASCH_PORT_IOTYPE>( aProps, "IOTYPE", 0, 3, ASCH_PORT_IOTYPE::UNSPECIFIED );
|
||||||
aProperties, "IOTYPE", 0, 3, ASCH_PORT_IOTYPE::UNSPECIFIED );
|
style = ReadEnum<ASCH_PORT_STYLE>( aProps, "STYLE", 0, 7, ASCH_PORT_STYLE::NONE_HORIZONTAL );
|
||||||
style = PropertiesReadEnum<ASCH_PORT_STYLE>(
|
|
||||||
aProperties, "STYLE", 0, 7, ASCH_PORT_STYLE::NONE_HORIZONTAL );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_POWER_PORT::ASCH_POWER_PORT( const std::map<wxString, wxString>& aProperties )
|
ASCH_POWER_PORT::ASCH_POWER_PORT( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::POWER_PORT );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::POWER_PORT );
|
||||||
|
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
|
|
||||||
orientation = PropertiesReadEnum<ASCH_RECORD_ORIENTATION>(
|
orientation = ReadEnum<ASCH_RECORD_ORIENTATION>( aProps, "ORIENTATION", 0, 3,
|
||||||
aProperties, "ORIENTATION", 0, 3, ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
||||||
|
|
||||||
text = ALTIUM_PARSER::PropertiesReadString( aProperties, "TEXT", "" );
|
text = ALTIUM_PARSER::ReadString( aProps, "TEXT", "" );
|
||||||
showNetName = ALTIUM_PARSER::PropertiesReadBool( aProperties, "SHOWNETNAME", true );
|
showNetName = ALTIUM_PARSER::ReadBool( aProps, "SHOWNETNAME", true );
|
||||||
|
|
||||||
style = PropertiesReadEnum<ASCH_POWER_PORT_STYLE>(
|
style = ReadEnum<ASCH_POWER_PORT_STYLE>( aProps, "STYLE", 0, 10,
|
||||||
aProperties, "STYLE", 0, 10, ASCH_POWER_PORT_STYLE::CIRCLE );
|
ASCH_POWER_PORT_STYLE::CIRCLE );
|
||||||
}
|
}
|
||||||
|
|
||||||
ASCH_PORT::ASCH_PORT( const std::map<wxString, wxString>& aProperties )
|
ASCH_PORT::ASCH_PORT( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::PORT );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::PORT );
|
||||||
|
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
|
|
||||||
name = ALTIUM_PARSER::PropertiesReadString( aProperties, "NAME", "" );
|
name = ALTIUM_PARSER::ReadString( aProps, "NAME", "" );
|
||||||
harnessType = ALTIUM_PARSER::PropertiesReadString( aProperties, "HARNESSTYPE", "" );
|
harnessType = ALTIUM_PARSER::ReadString( aProps, "HARNESSTYPE", "" );
|
||||||
|
|
||||||
width = PropertiesReadKiCadUnitFrac( aProperties, "WIDTH" );
|
width = ReadKiCadUnitFrac( aProps, "WIDTH" );
|
||||||
height = PropertiesReadKiCadUnitFrac( aProperties, "HEIGHT" );
|
height = ReadKiCadUnitFrac( aProps, "HEIGHT" );
|
||||||
|
|
||||||
iotype = PropertiesReadEnum<ASCH_PORT_IOTYPE>(
|
iotype = ReadEnum<ASCH_PORT_IOTYPE>( aProps, "IOTYPE", 0, 3, ASCH_PORT_IOTYPE::UNSPECIFIED );
|
||||||
aProperties, "IOTYPE", 0, 3, ASCH_PORT_IOTYPE::UNSPECIFIED );
|
style = ReadEnum<ASCH_PORT_STYLE>( aProps, "STYLE", 0, 7, ASCH_PORT_STYLE::NONE_HORIZONTAL );
|
||||||
style = PropertiesReadEnum<ASCH_PORT_STYLE>(
|
|
||||||
aProperties, "STYLE", 0, 7, ASCH_PORT_STYLE::NONE_HORIZONTAL );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_NO_ERC::ASCH_NO_ERC( const std::map<wxString, wxString>& aProperties )
|
ASCH_NO_ERC::ASCH_NO_ERC( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::NO_ERC );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::NO_ERC );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
|
|
||||||
isActive = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISACTIVE", true );
|
isActive = ALTIUM_PARSER::ReadBool( aProps, "ISACTIVE", true );
|
||||||
supressAll = ALTIUM_PARSER::PropertiesReadInt( aProperties, "SUPPRESSALL", true );
|
supressAll = ALTIUM_PARSER::ReadInt( aProps, "SUPPRESSALL", true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_NET_LABEL::ASCH_NET_LABEL( const std::map<wxString, wxString>& aProperties )
|
ASCH_NET_LABEL::ASCH_NET_LABEL( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::NET_LABEL );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::NET_LABEL );
|
||||||
|
|
||||||
text = ALTIUM_PARSER::PropertiesReadString( aProperties, "TEXT", "" );
|
text = ALTIUM_PARSER::ReadString( aProps, "TEXT", "" );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
|
|
||||||
orientation = PropertiesReadEnum<ASCH_RECORD_ORIENTATION>(
|
orientation = ReadEnum<ASCH_RECORD_ORIENTATION>( aProps, "ORIENTATION", 0, 3,
|
||||||
aProperties, "ORIENTATION", 0, 3, ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_BUS::ASCH_BUS( const std::map<wxString, wxString>& aProperties )
|
ASCH_BUS::ASCH_BUS( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::BUS );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::BUS );
|
||||||
|
|
||||||
indexinsheet = ALTIUM_PARSER::PropertiesReadInt( aProperties, "INDEXINSHEET", 0 );
|
indexinsheet = ALTIUM_PARSER::ReadInt( aProps, "INDEXINSHEET", 0 );
|
||||||
|
|
||||||
int locationcount = ALTIUM_PARSER::PropertiesReadInt( aProperties, "LOCATIONCOUNT", 0 );
|
int locationcount = ALTIUM_PARSER::ReadInt( aProps, "LOCATIONCOUNT", 0 );
|
||||||
|
|
||||||
for( int i = 1; i <= locationcount; i++ )
|
for( int i = 1; i <= locationcount; i++ )
|
||||||
{
|
{
|
||||||
const wxString si = std::to_string( i );
|
const wxString si = std::to_string( i );
|
||||||
points.emplace_back( PropertiesReadKiCadUnitFrac( aProperties, "X" + si ),
|
points.emplace_back( ReadKiCadUnitFrac( aProps, "X" + si ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "Y" + si ) );
|
-ReadKiCadUnitFrac( aProps, "Y" + si ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
lineWidth = PropertiesReadKiCadUnitFrac( aProperties, "LINEWIDTH" );
|
lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_WIRE::ASCH_WIRE( const std::map<wxString, wxString>& aProperties )
|
ASCH_WIRE::ASCH_WIRE( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::WIRE );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::WIRE );
|
||||||
|
|
||||||
/*std::cout << "-----------------------------------" << std::endl;
|
indexinsheet = ALTIUM_PARSER::ReadInt( aProps, "INDEXINSHEET", 0 );
|
||||||
// debug
|
|
||||||
for( auto& property : aProperties )
|
|
||||||
{
|
|
||||||
std::cout << " * '" << property.first << "' = '" << property.second << "'"
|
|
||||||
<< std::endl;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
indexinsheet = ALTIUM_PARSER::PropertiesReadInt( aProperties, "INDEXINSHEET", 0 );
|
int locationcount = ALTIUM_PARSER::ReadInt( aProps, "LOCATIONCOUNT", 0 );
|
||||||
|
|
||||||
int locationcount = ALTIUM_PARSER::PropertiesReadInt( aProperties, "LOCATIONCOUNT", 0 );
|
|
||||||
|
|
||||||
for( int i = 1; i <= locationcount; i++ )
|
for( int i = 1; i <= locationcount; i++ )
|
||||||
{
|
{
|
||||||
const wxString si = std::to_string( i );
|
const wxString si = std::to_string( i );
|
||||||
points.emplace_back( PropertiesReadKiCadUnitFrac( aProperties, "X" + si ),
|
points.emplace_back( ReadKiCadUnitFrac( aProps, "X" + si ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "Y" + si ) );
|
-ReadKiCadUnitFrac( aProps, "Y" + si ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
lineWidth = PropertiesReadKiCadUnitFrac( aProperties, "LINEWIDTH" );
|
lineWidth = ReadKiCadUnitFrac( aProps, "LINEWIDTH" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_JUNCTION::ASCH_JUNCTION( const std::map<wxString, wxString>& aProperties )
|
ASCH_JUNCTION::ASCH_JUNCTION( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::JUNCTION );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::JUNCTION );
|
||||||
|
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_IMAGE::ASCH_IMAGE( const std::map<wxString, wxString>& aProperties )
|
ASCH_IMAGE::ASCH_IMAGE( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::IMAGE );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::IMAGE );
|
||||||
|
|
||||||
indexinsheet = ALTIUM_PARSER::PropertiesReadInt( aProperties, "INDEXINSHEET", 0 );
|
indexinsheet = ALTIUM_PARSER::ReadInt( aProps, "INDEXINSHEET", 0 );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
|
|
||||||
filename = ALTIUM_PARSER::PropertiesReadString( aProperties, "FILENAME", "" );
|
filename = ALTIUM_PARSER::ReadString( aProps, "FILENAME", "" );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
corner = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "CORNER.X" ),
|
corner = wxPoint( ReadKiCadUnitFrac( aProps, "CORNER.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "CORNER.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "CORNER.Y" ) );
|
||||||
|
|
||||||
embedimage = ALTIUM_PARSER::PropertiesReadBool( aProperties, "EMBEDIMAGE", false );
|
embedimage = ALTIUM_PARSER::ReadBool( aProps, "EMBEDIMAGE", false );
|
||||||
keepaspect = ALTIUM_PARSER::PropertiesReadBool( aProperties, "KEEPASPECT", false );
|
keepaspect = ALTIUM_PARSER::ReadBool( aProps, "KEEPASPECT", false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_SHEET_FONT::ASCH_SHEET_FONT( const std::map<wxString, wxString>& aProperties, int aId )
|
ASCH_SHEET_FONT::ASCH_SHEET_FONT( const std::map<wxString, wxString>& aProps, int aId )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::SHEET );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::SHEET );
|
||||||
|
|
||||||
const wxString sid = std::to_string( aId );
|
const wxString sid = std::to_string( aId );
|
||||||
|
|
||||||
fontname = ALTIUM_PARSER::PropertiesReadString( aProperties, "FONTNAME" + sid, "" );
|
fontname = ALTIUM_PARSER::ReadString( aProps, "FONTNAME" + sid, "" );
|
||||||
|
|
||||||
size = PropertiesReadKiCadUnitFrac( aProperties, "SIZE" + sid );
|
size = ReadKiCadUnitFrac( aProps, "SIZE" + sid );
|
||||||
rotation = ALTIUM_PARSER::PropertiesReadInt( aProperties, "ROTATION" + sid, 0 );
|
rotation = ALTIUM_PARSER::ReadInt( aProps, "ROTATION" + sid, 0 );
|
||||||
|
|
||||||
italic = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ITALIC" + sid, false );
|
italic = ALTIUM_PARSER::ReadBool( aProps, "ITALIC" + sid, false );
|
||||||
bold = ALTIUM_PARSER::PropertiesReadBool( aProperties, "BOLD" + sid, false );
|
bold = ALTIUM_PARSER::ReadBool( aProps, "BOLD" + sid, false );
|
||||||
underline = ALTIUM_PARSER::PropertiesReadBool( aProperties, "UNDERLINE" + sid, false );
|
underline = ALTIUM_PARSER::ReadBool( aProps, "UNDERLINE" + sid, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPoint ASchSheetGetSize( ASCH_SHEET_SIZE aSheetSize )
|
wxPoint ASchSheetGetSize( ASCH_SHEET_SIZE aSheetSize )
|
||||||
|
@ -644,126 +625,124 @@ wxPoint ASchSheetGetSize( ASCH_SHEET_SIZE aSheetSize )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_SHEET::ASCH_SHEET( const std::map<wxString, wxString>& aProperties )
|
ASCH_SHEET::ASCH_SHEET( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::SHEET );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::SHEET );
|
||||||
|
|
||||||
int fontidcount = ALTIUM_PARSER::PropertiesReadInt( aProperties, "FONTIDCOUNT", 0 );
|
int fontidcount = ALTIUM_PARSER::ReadInt( aProps, "FONTIDCOUNT", 0 );
|
||||||
|
|
||||||
for( int i = 1; i <= fontidcount; i++ )
|
for( int i = 1; i <= fontidcount; i++ )
|
||||||
fonts.emplace_back( aProperties, i );
|
fonts.emplace_back( aProps, i );
|
||||||
|
|
||||||
sheetSize = PropertiesReadEnum<ASCH_SHEET_SIZE>(
|
sheetSize = ReadEnum<ASCH_SHEET_SIZE>( aProps, "SHEETSTYLE", 0, 17, ASCH_SHEET_SIZE::A4 );
|
||||||
aProperties, "SHEETSTYLE", 0, 17, ASCH_SHEET_SIZE::A4 );
|
sheetOrientation = ReadEnum<ASCH_SHEET_WORKSPACEORIENTATION>(
|
||||||
sheetOrientation = PropertiesReadEnum<ASCH_SHEET_WORKSPACEORIENTATION>(
|
aProps, "WORKSPACEORIENTATION", 0, 1, ASCH_SHEET_WORKSPACEORIENTATION::LANDSCAPE );
|
||||||
aProperties, "WORKSPACEORIENTATION", 0, 1, ASCH_SHEET_WORKSPACEORIENTATION::LANDSCAPE );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_SHEET_NAME::ASCH_SHEET_NAME( const std::map<wxString, wxString>& aProperties )
|
ASCH_SHEET_NAME::ASCH_SHEET_NAME( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::SHEET_NAME );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::SHEET_NAME );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
|
|
||||||
text = ALTIUM_PARSER::PropertiesReadString( aProperties, "TEXT", "" );
|
text = ALTIUM_PARSER::ReadString( aProps, "TEXT", "" );
|
||||||
|
|
||||||
orientation = PropertiesReadEnum<ASCH_RECORD_ORIENTATION>(
|
orientation = ReadEnum<ASCH_RECORD_ORIENTATION>( aProps, "ORIENTATION", 0, 3,
|
||||||
aProperties, "ORIENTATION", 0, 3, ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
|
|
||||||
isHidden = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISHIDDEN", false );
|
isHidden = ALTIUM_PARSER::ReadBool( aProps, "ISHIDDEN", false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_FILE_NAME::ASCH_FILE_NAME( const std::map<wxString, wxString>& aProperties )
|
ASCH_FILE_NAME::ASCH_FILE_NAME( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::FILE_NAME );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::FILE_NAME );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
|
|
||||||
text = ALTIUM_PARSER::PropertiesReadString( aProperties, "TEXT", "" );
|
text = ALTIUM_PARSER::ReadString( aProps, "TEXT", "" );
|
||||||
|
|
||||||
orientation = PropertiesReadEnum<ASCH_RECORD_ORIENTATION>(
|
orientation = ReadEnum<ASCH_RECORD_ORIENTATION>( aProps, "ORIENTATION", 0, 3,
|
||||||
aProperties, "ORIENTATION", 0, 3, ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
|
|
||||||
isHidden = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISHIDDEN", false );
|
isHidden = ALTIUM_PARSER::ReadBool( aProps, "ISHIDDEN", false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_DESIGNATOR::ASCH_DESIGNATOR( const std::map<wxString, wxString>& aProperties )
|
ASCH_DESIGNATOR::ASCH_DESIGNATOR( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::DESIGNATOR );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::DESIGNATOR );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
|
|
||||||
name = ALTIUM_PARSER::PropertiesReadString( aProperties, "NAME", "" );
|
name = ALTIUM_PARSER::ReadString( aProps, "NAME", "" );
|
||||||
text = ALTIUM_PARSER::PropertiesReadString( aProperties, "TEXT", "" );
|
text = ALTIUM_PARSER::ReadString( aProps, "TEXT", "" );
|
||||||
|
|
||||||
orientation = PropertiesReadEnum<ASCH_RECORD_ORIENTATION>(
|
orientation = ReadEnum<ASCH_RECORD_ORIENTATION>( aProps, "ORIENTATION", 0, 3,
|
||||||
aProperties, "ORIENTATION", 0, 3, ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_IMPLEMENTATION::ASCH_IMPLEMENTATION( const std::map<wxString, wxString>& aProperties )
|
ASCH_IMPLEMENTATION::ASCH_IMPLEMENTATION( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::IMPLEMENTATION );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::IMPLEMENTATION );
|
||||||
|
|
||||||
ownerindex = ALTIUM_PARSER::PropertiesReadInt( aProperties, "OWNERINDEX", ALTIUM_COMPONENT_NONE );
|
ownerindex = ALTIUM_PARSER::ReadInt( aProps, "OWNERINDEX", ALTIUM_COMPONENT_NONE );
|
||||||
name = ALTIUM_PARSER::PropertiesReadString( aProperties, "MODELNAME", "" );
|
name = ALTIUM_PARSER::ReadString( aProps, "MODELNAME", "" );
|
||||||
type = ALTIUM_PARSER::PropertiesReadString( aProperties, "MODELTYPE", "" );
|
type = ALTIUM_PARSER::ReadString( aProps, "MODELTYPE", "" );
|
||||||
libname = ALTIUM_PARSER::PropertiesReadString( aProperties, "MODELDATAFILE0", "" );
|
libname = ALTIUM_PARSER::ReadString( aProps, "MODELDATAFILE0", "" );
|
||||||
isCurrent = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISCURRENT", false );
|
isCurrent = ALTIUM_PARSER::ReadBool( aProps, "ISCURRENT", false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_IMPLEMENTATION_LIST::ASCH_IMPLEMENTATION_LIST( const std::map<wxString,
|
ASCH_IMPLEMENTATION_LIST::ASCH_IMPLEMENTATION_LIST( const std::map<wxString, wxString>& aProps )
|
||||||
wxString>& aProperties )
|
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::IMPLEMENTATION_LIST );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::IMPLEMENTATION_LIST );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
}
|
}
|
||||||
|
|
||||||
ASCH_BUS_ENTRY::ASCH_BUS_ENTRY( const std::map<wxString, wxString>& aProperties )
|
ASCH_BUS_ENTRY::ASCH_BUS_ENTRY( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::BUS_ENTRY );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::BUS_ENTRY );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
corner = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "CORNER.X" ),
|
corner = wxPoint( ReadKiCadUnitFrac( aProps, "CORNER.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "CORNER.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "CORNER.Y" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ASCH_PARAMETER::ASCH_PARAMETER( const std::map<wxString, wxString>& aProperties )
|
ASCH_PARAMETER::ASCH_PARAMETER( const std::map<wxString, wxString>& aProps )
|
||||||
{
|
{
|
||||||
wxASSERT( PropertiesReadRecord( aProperties ) == ALTIUM_SCH_RECORD::PARAMETER );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::PARAMETER );
|
||||||
|
|
||||||
ownerindex = PropertiesReadOwnerIndex( aProperties );
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = PropertiesReadOwnerPartId( aProperties );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
|
|
||||||
location = wxPoint( PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.X" ),
|
location = wxPoint( ReadKiCadUnitFrac( aProps, "LOCATION.X" ),
|
||||||
-PropertiesReadKiCadUnitFrac( aProperties, "LOCATION.Y" ) );
|
-ReadKiCadUnitFrac( aProps, "LOCATION.Y" ) );
|
||||||
|
|
||||||
orientation = PropertiesReadEnum<ASCH_RECORD_ORIENTATION>(
|
orientation = ReadEnum<ASCH_RECORD_ORIENTATION>( aProps, "ORIENTATION", 0, 3,
|
||||||
aProperties, "ORIENTATION", 0, 3, ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
ASCH_RECORD_ORIENTATION::RIGHTWARDS );
|
||||||
|
|
||||||
name = ALTIUM_PARSER::PropertiesReadString( aProperties, "NAME", "" );
|
name = ALTIUM_PARSER::ReadString( aProps, "NAME", "" );
|
||||||
text = ALTIUM_PARSER::PropertiesReadString( aProperties, "TEXT", "" );
|
text = ALTIUM_PARSER::ReadString( aProps, "TEXT", "" );
|
||||||
|
|
||||||
isHidden = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISHIDDEN", false );
|
isHidden = ALTIUM_PARSER::ReadBool( aProps, "ISHIDDEN", false );
|
||||||
isMirrored = ALTIUM_PARSER::PropertiesReadBool( aProperties, "ISMIRRORED", false );
|
isMirrored = ALTIUM_PARSER::ReadBool( aProps, "ISMIRRORED", false );
|
||||||
isShowName = ALTIUM_PARSER::PropertiesReadBool( aProperties, "SHOWNAME", false );
|
isShowName = ALTIUM_PARSER::ReadBool( aProps, "SHOWNAME", false );
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ struct ASCH_SYMBOL
|
||||||
int displaymodecount;
|
int displaymodecount;
|
||||||
int displaymode;
|
int displaymode;
|
||||||
|
|
||||||
explicit ASCH_SYMBOL( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_SYMBOL( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ struct ASCH_PIN
|
||||||
bool showPinName;
|
bool showPinName;
|
||||||
bool showDesignator;
|
bool showDesignator;
|
||||||
|
|
||||||
explicit ASCH_PIN( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_PIN( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ struct ASCH_LABEL
|
||||||
|
|
||||||
ASCH_LABEL_JUSTIFICATION justification;
|
ASCH_LABEL_JUSTIFICATION justification;
|
||||||
|
|
||||||
explicit ASCH_LABEL( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_LABEL( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ struct ASCH_TEXT_FRAME
|
||||||
|
|
||||||
ASCH_TEXT_FRAME_ALIGNMENT alignment;
|
ASCH_TEXT_FRAME_ALIGNMENT alignment;
|
||||||
|
|
||||||
explicit ASCH_TEXT_FRAME( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_TEXT_FRAME( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ struct ASCH_BEZIER
|
||||||
|
|
||||||
int lineWidth;
|
int lineWidth;
|
||||||
|
|
||||||
explicit ASCH_BEZIER( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_BEZIER( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ struct ASCH_POLYLINE
|
||||||
|
|
||||||
ASCH_POLYLINE_LINESTYLE linestyle;
|
ASCH_POLYLINE_LINESTYLE linestyle;
|
||||||
|
|
||||||
explicit ASCH_POLYLINE( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_POLYLINE( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ struct ASCH_POLYGON
|
||||||
int color;
|
int color;
|
||||||
int areacolor;
|
int areacolor;
|
||||||
|
|
||||||
explicit ASCH_POLYGON( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_POLYGON( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ struct ASCH_ROUND_RECTANGLE
|
||||||
int color;
|
int color;
|
||||||
int areacolor;
|
int areacolor;
|
||||||
|
|
||||||
explicit ASCH_ROUND_RECTANGLE( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_ROUND_RECTANGLE( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -381,7 +381,7 @@ struct ASCH_ARC
|
||||||
|
|
||||||
int lineWidth;
|
int lineWidth;
|
||||||
|
|
||||||
explicit ASCH_ARC( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_ARC( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -396,7 +396,7 @@ struct ASCH_LINE
|
||||||
|
|
||||||
int lineWidth;
|
int lineWidth;
|
||||||
|
|
||||||
explicit ASCH_LINE( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_LINE( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ struct ASCH_RECTANGLE
|
||||||
int color;
|
int color;
|
||||||
int areacolor;
|
int areacolor;
|
||||||
|
|
||||||
explicit ASCH_RECTANGLE( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_RECTANGLE( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -430,7 +430,7 @@ struct ASCH_SHEET_SYMBOL
|
||||||
int color;
|
int color;
|
||||||
int areacolor;
|
int areacolor;
|
||||||
|
|
||||||
explicit ASCH_SHEET_SYMBOL( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_SHEET_SYMBOL( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -478,7 +478,7 @@ struct ASCH_SHEET_ENTRY
|
||||||
|
|
||||||
wxString name;
|
wxString name;
|
||||||
|
|
||||||
explicit ASCH_SHEET_ENTRY( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_SHEET_ENTRY( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -511,7 +511,7 @@ struct ASCH_POWER_PORT
|
||||||
ASCH_RECORD_ORIENTATION orientation;
|
ASCH_RECORD_ORIENTATION orientation;
|
||||||
ASCH_POWER_PORT_STYLE style;
|
ASCH_POWER_PORT_STYLE style;
|
||||||
|
|
||||||
explicit ASCH_POWER_PORT( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_POWER_PORT( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -529,7 +529,7 @@ struct ASCH_PORT
|
||||||
ASCH_PORT_IOTYPE iotype;
|
ASCH_PORT_IOTYPE iotype;
|
||||||
ASCH_PORT_STYLE style;
|
ASCH_PORT_STYLE style;
|
||||||
|
|
||||||
explicit ASCH_PORT( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_PORT( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -540,7 +540,7 @@ struct ASCH_NO_ERC
|
||||||
bool isActive;
|
bool isActive;
|
||||||
bool supressAll;
|
bool supressAll;
|
||||||
|
|
||||||
explicit ASCH_NO_ERC( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_NO_ERC( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -552,7 +552,7 @@ struct ASCH_NET_LABEL
|
||||||
|
|
||||||
ASCH_RECORD_ORIENTATION orientation;
|
ASCH_RECORD_ORIENTATION orientation;
|
||||||
|
|
||||||
explicit ASCH_NET_LABEL( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_NET_LABEL( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -563,7 +563,7 @@ struct ASCH_BUS
|
||||||
|
|
||||||
std::vector<wxPoint> points;
|
std::vector<wxPoint> points;
|
||||||
|
|
||||||
explicit ASCH_BUS( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_BUS( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -574,7 +574,7 @@ struct ASCH_WIRE
|
||||||
|
|
||||||
std::vector<wxPoint> points;
|
std::vector<wxPoint> points;
|
||||||
|
|
||||||
explicit ASCH_WIRE( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_WIRE( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -584,7 +584,7 @@ struct ASCH_JUNCTION
|
||||||
|
|
||||||
wxPoint location;
|
wxPoint location;
|
||||||
|
|
||||||
explicit ASCH_JUNCTION( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_JUNCTION( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -600,7 +600,7 @@ struct ASCH_IMAGE
|
||||||
bool embedimage;
|
bool embedimage;
|
||||||
bool keepaspect;
|
bool keepaspect;
|
||||||
|
|
||||||
explicit ASCH_IMAGE( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_IMAGE( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -615,7 +615,7 @@ struct ASCH_SHEET_FONT
|
||||||
bool bold;
|
bool bold;
|
||||||
bool underline;
|
bool underline;
|
||||||
|
|
||||||
explicit ASCH_SHEET_FONT( const std::map<wxString, wxString>& aProperties, int aId );
|
explicit ASCH_SHEET_FONT( const std::map<wxString, wxString>& aProps, int aId );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -660,7 +660,7 @@ struct ASCH_SHEET
|
||||||
ASCH_SHEET_SIZE sheetSize;
|
ASCH_SHEET_SIZE sheetSize;
|
||||||
ASCH_SHEET_WORKSPACEORIENTATION sheetOrientation;
|
ASCH_SHEET_WORKSPACEORIENTATION sheetOrientation;
|
||||||
|
|
||||||
explicit ASCH_SHEET( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_SHEET( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -676,7 +676,7 @@ struct ASCH_SHEET_NAME
|
||||||
|
|
||||||
bool isHidden;
|
bool isHidden;
|
||||||
|
|
||||||
explicit ASCH_SHEET_NAME( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_SHEET_NAME( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -692,7 +692,7 @@ struct ASCH_FILE_NAME
|
||||||
|
|
||||||
bool isHidden;
|
bool isHidden;
|
||||||
|
|
||||||
explicit ASCH_FILE_NAME( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_FILE_NAME( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -707,7 +707,7 @@ struct ASCH_DESIGNATOR
|
||||||
ASCH_RECORD_ORIENTATION orientation;
|
ASCH_RECORD_ORIENTATION orientation;
|
||||||
wxPoint location;
|
wxPoint location;
|
||||||
|
|
||||||
explicit ASCH_DESIGNATOR( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_DESIGNATOR( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -721,14 +721,14 @@ struct ASCH_IMPLEMENTATION
|
||||||
|
|
||||||
bool isCurrent;
|
bool isCurrent;
|
||||||
|
|
||||||
explicit ASCH_IMPLEMENTATION( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_IMPLEMENTATION( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct ASCH_IMPLEMENTATION_LIST
|
struct ASCH_IMPLEMENTATION_LIST
|
||||||
{
|
{
|
||||||
int ownerindex;
|
int ownerindex;
|
||||||
explicit ASCH_IMPLEMENTATION_LIST( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_IMPLEMENTATION_LIST( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -737,7 +737,7 @@ struct ASCH_BUS_ENTRY
|
||||||
wxPoint location;
|
wxPoint location;
|
||||||
wxPoint corner;
|
wxPoint corner;
|
||||||
|
|
||||||
explicit ASCH_BUS_ENTRY( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_BUS_ENTRY( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -756,7 +756,7 @@ struct ASCH_PARAMETER
|
||||||
bool isMirrored;
|
bool isMirrored;
|
||||||
bool isShowName;
|
bool isShowName;
|
||||||
|
|
||||||
explicit ASCH_PARAMETER( const std::map<wxString, wxString>& aProperties );
|
explicit ASCH_PARAMETER( const std::map<wxString, wxString>& aProps );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //ALTIUM_PARSER_SCH_H
|
#endif //ALTIUM_PARSER_SCH_H
|
||||||
|
|
|
@ -294,8 +294,8 @@ void SCH_ALTIUM_PLUGIN::ParseStorage( const CFB::CompoundFileReader& aReader )
|
||||||
ALTIUM_PARSER reader( aReader, file );
|
ALTIUM_PARSER reader( aReader, file );
|
||||||
|
|
||||||
std::map<wxString, wxString> properties = reader.ReadProperties();
|
std::map<wxString, wxString> properties = reader.ReadProperties();
|
||||||
wxString header = ALTIUM_PARSER::PropertiesReadString( properties, "HEADER", "" );
|
wxString header = ALTIUM_PARSER::ReadString( properties, "HEADER", "" );
|
||||||
int weight = ALTIUM_PARSER::PropertiesReadInt( properties, "WEIGHT", 0 );
|
int weight = ALTIUM_PARSER::ReadInt( properties, "WEIGHT", 0 );
|
||||||
|
|
||||||
if( weight < 0 )
|
if( weight < 0 )
|
||||||
THROW_IO_ERROR( "Storage weight is negative!" );
|
THROW_IO_ERROR( "Storage weight is negative!" );
|
||||||
|
@ -337,7 +337,7 @@ void SCH_ALTIUM_PLUGIN::ParseFileHeader( const CFB::CompoundFileReader& aReader
|
||||||
{
|
{
|
||||||
std::map<wxString, wxString> properties = reader.ReadProperties();
|
std::map<wxString, wxString> properties = reader.ReadProperties();
|
||||||
|
|
||||||
int recordId = ALTIUM_PARSER::PropertiesReadInt( properties, "RECORD", 0 );
|
int recordId = ALTIUM_PARSER::ReadInt( properties, "RECORD", 0 );
|
||||||
ALTIUM_SCH_RECORD record = static_cast<ALTIUM_SCH_RECORD>( recordId );
|
ALTIUM_SCH_RECORD record = static_cast<ALTIUM_SCH_RECORD>( recordId );
|
||||||
|
|
||||||
if( record != ALTIUM_SCH_RECORD::HEADER )
|
if( record != ALTIUM_SCH_RECORD::HEADER )
|
||||||
|
@ -355,7 +355,7 @@ void SCH_ALTIUM_PLUGIN::ParseFileHeader( const CFB::CompoundFileReader& aReader
|
||||||
{
|
{
|
||||||
std::map<wxString, wxString> properties = reader.ReadProperties();
|
std::map<wxString, wxString> properties = reader.ReadProperties();
|
||||||
|
|
||||||
int recordId = ALTIUM_PARSER::PropertiesReadInt( properties, "RECORD", 0 );
|
int recordId = ALTIUM_PARSER::ReadInt( properties, "RECORD", 0 );
|
||||||
ALTIUM_SCH_RECORD record = static_cast<ALTIUM_SCH_RECORD>( recordId );
|
ALTIUM_SCH_RECORD record = static_cast<ALTIUM_SCH_RECORD>( recordId );
|
||||||
|
|
||||||
// see: https://github.com/vadmium/python-altium/blob/master/format.md
|
// see: https://github.com/vadmium/python-altium/blob/master/format.md
|
||||||
|
|
|
@ -140,8 +140,8 @@ ALTIUM_LAYER altium_layer_from_name( const wxString& aName )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void altium_parse_polygons(
|
void altium_parse_polygons( std::map<wxString, wxString>& aProps,
|
||||||
std::map<wxString, wxString>& aProperties, std::vector<ALTIUM_VERTICE>& aVertices )
|
std::vector<ALTIUM_VERTICE>& aVertices )
|
||||||
{
|
{
|
||||||
for( size_t i = 0; i < std::numeric_limits<size_t>::max(); i++ )
|
for( size_t i = 0; i < std::numeric_limits<size_t>::max(); i++ )
|
||||||
{
|
{
|
||||||
|
@ -150,23 +150,17 @@ void altium_parse_polygons(
|
||||||
const wxString vxi = "VX" + si;
|
const wxString vxi = "VX" + si;
|
||||||
const wxString vyi = "VY" + si;
|
const wxString vyi = "VY" + si;
|
||||||
|
|
||||||
if( aProperties.find( vxi ) == aProperties.end()
|
if( aProps.find( vxi ) == aProps.end() || aProps.find( vyi ) == aProps.end() )
|
||||||
|| aProperties.find( vyi ) == aProperties.end() )
|
|
||||||
{
|
|
||||||
break; // it doesn't seem like we know beforehand how many vertices are inside a polygon
|
break; // it doesn't seem like we know beforehand how many vertices are inside a polygon
|
||||||
}
|
|
||||||
|
|
||||||
const bool isRound = ALTIUM_PARSER::PropertiesReadInt( aProperties, "KIND" + si, 0 ) != 0;
|
const bool isRound = ALTIUM_PARSER::ReadInt( aProps, "KIND" + si, 0 ) != 0;
|
||||||
const int32_t radius =
|
const int32_t radius = ALTIUM_PARSER::ReadKicadUnit( aProps, "R" + si, "0mil" );
|
||||||
ALTIUM_PARSER::PropertiesReadKicadUnit( aProperties, "R" + si, "0mil" );
|
const double sa = ALTIUM_PARSER::ReadDouble( aProps, "SA" + si, 0. );
|
||||||
const double sa = ALTIUM_PARSER::PropertiesReadDouble( aProperties, "SA" + si, 0. );
|
const double ea = ALTIUM_PARSER::ReadDouble( aProps, "EA" + si, 0. );
|
||||||
const double ea = ALTIUM_PARSER::PropertiesReadDouble( aProperties, "EA" + si, 0. );
|
const wxPoint vp = wxPoint( ALTIUM_PARSER::ReadKicadUnit( aProps, vxi, "0mil" ),
|
||||||
const wxPoint vp =
|
-ALTIUM_PARSER::ReadKicadUnit( aProps, vyi, "0mil" ) );
|
||||||
wxPoint( ALTIUM_PARSER::PropertiesReadKicadUnit( aProperties, vxi, "0mil" ),
|
const wxPoint cp = wxPoint( ALTIUM_PARSER::ReadKicadUnit( aProps, "CX" + si, "0mil" ),
|
||||||
-ALTIUM_PARSER::PropertiesReadKicadUnit( aProperties, vyi, "0mil" ) );
|
-ALTIUM_PARSER::ReadKicadUnit( aProps, "CY" + si, "0mil" ) );
|
||||||
const wxPoint cp =
|
|
||||||
wxPoint( ALTIUM_PARSER::PropertiesReadKicadUnit( aProperties, "CX" + si, "0mil" ),
|
|
||||||
-ALTIUM_PARSER::PropertiesReadKicadUnit( aProperties, "CY" + si, "0mil" ) );
|
|
||||||
|
|
||||||
aVertices.emplace_back( isRound, radius, sa, ea, vp, cp );
|
aVertices.emplace_back( isRound, radius, sa, ea, vp, cp );
|
||||||
}
|
}
|
||||||
|
@ -174,165 +168,139 @@ void altium_parse_polygons(
|
||||||
|
|
||||||
ABOARD6::ABOARD6( ALTIUM_PARSER& aReader )
|
ABOARD6::ABOARD6( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
std::map<wxString, wxString> props = aReader.ReadProperties();
|
||||||
if( properties.empty() )
|
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Board6 stream has no properties!" );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*for (auto & property : properties) {
|
if( props.empty() )
|
||||||
std::cout << " * '" << property.first << "' = '" << property.second << "'" << std::endl;
|
THROW_IO_ERROR( "Board6 stream has no props!" );
|
||||||
}*/
|
|
||||||
|
|
||||||
sheetpos = wxPoint( ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "SHEETX", "0mil" ),
|
sheetpos = wxPoint( ALTIUM_PARSER::ReadKicadUnit( props, "SHEETX", "0mil" ),
|
||||||
-ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "SHEETY", "0mil" ) );
|
-ALTIUM_PARSER::ReadKicadUnit( props, "SHEETY", "0mil" ) );
|
||||||
sheetsize = wxSize( ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "SHEETWIDTH", "0mil" ),
|
sheetsize = wxSize( ALTIUM_PARSER::ReadKicadUnit( props, "SHEETWIDTH", "0mil" ),
|
||||||
ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "SHEETHEIGHT", "0mil" ) );
|
ALTIUM_PARSER::ReadKicadUnit( props, "SHEETHEIGHT", "0mil" ) );
|
||||||
|
|
||||||
layercount = ALTIUM_PARSER::PropertiesReadInt( properties, "LAYERSETSCOUNT", 1 ) + 1;
|
layercount = ALTIUM_PARSER::ReadInt( props, "LAYERSETSCOUNT", 1 ) + 1;
|
||||||
|
|
||||||
for( size_t i = 1; i < std::numeric_limits<size_t>::max(); i++ )
|
for( size_t i = 1; i < std::numeric_limits<size_t>::max(); i++ )
|
||||||
{
|
{
|
||||||
const wxString layeri = "LAYER" + std::to_string( i );
|
const wxString layeri = "LAYER" + std::to_string( i );
|
||||||
const wxString layername = layeri + "NAME";
|
const wxString layername = layeri + "NAME";
|
||||||
|
|
||||||
auto layernameit = properties.find( layername );
|
auto layernameit = props.find( layername );
|
||||||
if( layernameit == properties.end() )
|
|
||||||
{
|
if( layernameit == props.end() )
|
||||||
break; // it doesn't seem like we know beforehand how many vertices are inside a polygon
|
break; // it doesn't seem like we know beforehand how many vertices are inside a polygon
|
||||||
}
|
|
||||||
|
|
||||||
ABOARD6_LAYER_STACKUP curlayer;
|
ABOARD6_LAYER_STACKUP l;
|
||||||
|
|
||||||
curlayer.name = ALTIUM_PARSER::PropertiesReadString( properties, layername, "" );
|
l.name = ALTIUM_PARSER::ReadString( props, layername, "" );
|
||||||
curlayer.nextId = ALTIUM_PARSER::PropertiesReadInt( properties, layeri + "NEXT", 0 );
|
l.nextId = ALTIUM_PARSER::ReadInt( props, layeri + "NEXT", 0 );
|
||||||
curlayer.prevId = ALTIUM_PARSER::PropertiesReadInt( properties, layeri + "PREV", 0 );
|
l.prevId = ALTIUM_PARSER::ReadInt( props, layeri + "PREV", 0 );
|
||||||
curlayer.copperthick =
|
l.copperthick = ALTIUM_PARSER::ReadKicadUnit( props, layeri + "COPTHICK", "1.4mil" );
|
||||||
ALTIUM_PARSER::PropertiesReadKicadUnit( properties, layeri + "COPTHICK", "1.4mil" );
|
|
||||||
|
|
||||||
curlayer.dielectricconst =
|
l.dielectricconst = ALTIUM_PARSER::ReadDouble( props, layeri + "DIELCONST", 0. );
|
||||||
ALTIUM_PARSER::PropertiesReadDouble( properties, layeri + "DIELCONST", 0. );
|
l.dielectricthick = ALTIUM_PARSER::ReadKicadUnit( props, layeri + "DIELHEIGHT", "60mil" );
|
||||||
curlayer.dielectricthick = ALTIUM_PARSER::PropertiesReadKicadUnit(
|
l.dielectricmaterial = ALTIUM_PARSER::ReadString( props, layeri + "DIELMATERIAL", "FR-4" );
|
||||||
properties, layeri + "DIELHEIGHT", "60mil" );
|
|
||||||
curlayer.dielectricmaterial =
|
|
||||||
ALTIUM_PARSER::PropertiesReadString( properties, layeri + "DIELMATERIAL", "FR-4" );
|
|
||||||
|
|
||||||
stackup.push_back( curlayer );
|
stackup.push_back( l );
|
||||||
}
|
}
|
||||||
|
|
||||||
altium_parse_polygons( properties, board_vertices );
|
altium_parse_polygons( props, board_vertices );
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Board6 stream was not parsed correctly!" );
|
THROW_IO_ERROR( "Board6 stream was not parsed correctly!" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ACLASS6::ACLASS6( ALTIUM_PARSER& aReader )
|
ACLASS6::ACLASS6( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
||||||
if( properties.empty() )
|
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Classes6 stream has no properties!" );
|
|
||||||
}
|
|
||||||
|
|
||||||
name = ALTIUM_PARSER::PropertiesReadString( properties, "NAME", "" );
|
if( properties.empty() )
|
||||||
uniqueid = ALTIUM_PARSER::PropertiesReadString( properties, "UNIQUEID", "" );
|
THROW_IO_ERROR( "Classes6 stream has no properties!" );
|
||||||
kind = static_cast<ALTIUM_CLASS_KIND>(
|
|
||||||
ALTIUM_PARSER::PropertiesReadInt( properties, "KIND", -1 ) );
|
name = ALTIUM_PARSER::ReadString( properties, "NAME", "" );
|
||||||
|
uniqueid = ALTIUM_PARSER::ReadString( properties, "UNIQUEID", "" );
|
||||||
|
kind = static_cast<ALTIUM_CLASS_KIND>( ALTIUM_PARSER::ReadInt( properties, "KIND", -1 ) );
|
||||||
|
|
||||||
for( size_t i = 0; i < std::numeric_limits<size_t>::max(); i++ )
|
for( size_t i = 0; i < std::numeric_limits<size_t>::max(); i++ )
|
||||||
{
|
{
|
||||||
auto mit = properties.find( "M" + std::to_string( i ) );
|
auto mit = properties.find( "M" + std::to_string( i ) );
|
||||||
|
|
||||||
if( mit == properties.end() )
|
if( mit == properties.end() )
|
||||||
{
|
|
||||||
break; // it doesn't seem like we know beforehand how many components are in the netclass
|
break; // it doesn't seem like we know beforehand how many components are in the netclass
|
||||||
}
|
|
||||||
names.push_back( mit->second );
|
names.push_back( mit->second );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Classes6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Classes6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ACOMPONENT6::ACOMPONENT6( ALTIUM_PARSER& aReader )
|
ACOMPONENT6::ACOMPONENT6( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
std::map<wxString, wxString> props = aReader.ReadProperties();
|
||||||
if( properties.empty() )
|
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Components6 stream has no properties" );
|
|
||||||
}
|
|
||||||
|
|
||||||
layer = altium_layer_from_name(
|
if( props.empty() )
|
||||||
ALTIUM_PARSER::PropertiesReadString( properties, "LAYER", "" ) );
|
THROW_IO_ERROR( "Components6 stream has no props" );
|
||||||
position = wxPoint( ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "X", "0mil" ),
|
|
||||||
-ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "Y", "0mil" ) );
|
|
||||||
rotation = ALTIUM_PARSER::PropertiesReadDouble( properties, "ROTATION", 0. );
|
|
||||||
locked = ALTIUM_PARSER::PropertiesReadBool( properties, "LOCKED", false );
|
|
||||||
nameon = ALTIUM_PARSER::PropertiesReadBool( properties, "NAMEON", true );
|
|
||||||
commenton = ALTIUM_PARSER::PropertiesReadBool( properties, "COMMENTON", false );
|
|
||||||
sourcedesignator = ALTIUM_PARSER::PropertiesReadString( properties, "SOURCEDESIGNATOR", "" );
|
|
||||||
sourcefootprintlibrary =
|
|
||||||
ALTIUM_PARSER::PropertiesReadString( properties, "SOURCEFOOTPRINTLIBRARY", "" );
|
|
||||||
pattern = ALTIUM_PARSER::PropertiesReadString( properties, "PATTERN", "" );
|
|
||||||
|
|
||||||
sourcecomponentlibrary =
|
layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( props, "LAYER", "" ) );
|
||||||
ALTIUM_PARSER::PropertiesReadString( properties, "SOURCECOMPONENTLIBRARY", "" );
|
position = wxPoint( ALTIUM_PARSER::ReadKicadUnit( props, "X", "0mil" ),
|
||||||
sourcelibreference =
|
-ALTIUM_PARSER::ReadKicadUnit( props, "Y", "0mil" ) );
|
||||||
ALTIUM_PARSER::PropertiesReadString( properties, "SOURCELIBREFERENCE", "" );
|
rotation = ALTIUM_PARSER::ReadDouble( props, "ROTATION", 0. );
|
||||||
|
locked = ALTIUM_PARSER::ReadBool( props, "LOCKED", false );
|
||||||
|
nameon = ALTIUM_PARSER::ReadBool( props, "NAMEON", true );
|
||||||
|
commenton = ALTIUM_PARSER::ReadBool( props, "COMMENTON", false );
|
||||||
|
sourcedesignator = ALTIUM_PARSER::ReadString( props, "SOURCEDESIGNATOR", "" );
|
||||||
|
sourcefootprintlibrary = ALTIUM_PARSER::ReadString( props, "SOURCEFOOTPRINTLIBRARY", "" );
|
||||||
|
pattern = ALTIUM_PARSER::ReadString( props, "PATTERN", "" );
|
||||||
|
|
||||||
|
sourcecomponentlibrary = ALTIUM_PARSER::ReadString( props, "SOURCECOMPONENTLIBRARY", "" );
|
||||||
|
sourcelibreference = ALTIUM_PARSER::ReadString( props, "SOURCELIBREFERENCE", "" );
|
||||||
|
|
||||||
nameautoposition = static_cast<ALTIUM_TEXT_POSITION>(
|
nameautoposition = static_cast<ALTIUM_TEXT_POSITION>(
|
||||||
ALTIUM_PARSER::PropertiesReadInt( properties, "NAMEAUTOPOSITION", 0 ) );
|
ALTIUM_PARSER::ReadInt( props, "NAMEAUTOPOSITION", 0 ) );
|
||||||
commentautoposition = static_cast<ALTIUM_TEXT_POSITION>(
|
commentautoposition = static_cast<ALTIUM_TEXT_POSITION>(
|
||||||
ALTIUM_PARSER::PropertiesReadInt( properties, "COMMENTAUTOPOSITION", 0 ) );
|
ALTIUM_PARSER::ReadInt( props, "COMMENTAUTOPOSITION", 0 ) );
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Components6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Components6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ADIMENSION6::ADIMENSION6( ALTIUM_PARSER& aReader )
|
ADIMENSION6::ADIMENSION6( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
aReader.Skip( 2 );
|
aReader.Skip( 2 );
|
||||||
|
|
||||||
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
std::map<wxString, wxString> props = aReader.ReadProperties();
|
||||||
if( properties.empty() )
|
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Dimensions6 stream has no properties" );
|
|
||||||
}
|
|
||||||
|
|
||||||
layer = altium_layer_from_name(
|
if( props.empty() )
|
||||||
ALTIUM_PARSER::PropertiesReadString( properties, "LAYER", "" ) );
|
THROW_IO_ERROR( "Dimensions6 stream has no props" );
|
||||||
kind = static_cast<ALTIUM_DIMENSION_KIND>(
|
|
||||||
ALTIUM_PARSER::PropertiesReadInt( properties, "DIMENSIONKIND", 0 ) );
|
|
||||||
|
|
||||||
textformat = ALTIUM_PARSER::PropertiesReadString( properties, "TEXTFORMAT", "" );
|
layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( props, "LAYER", "" ) );
|
||||||
|
kind = static_cast<ALTIUM_DIMENSION_KIND>( ALTIUM_PARSER::ReadInt( props, "DIMENSIONKIND", 0 ) );
|
||||||
|
|
||||||
height = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "HEIGHT", "0mil" );
|
textformat = ALTIUM_PARSER::ReadString( props, "TEXTFORMAT", "" );
|
||||||
angle = ALTIUM_PARSER::PropertiesReadDouble( properties, "ANGLE", 0. );
|
|
||||||
|
|
||||||
linewidth = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "LINEWIDTH", "10mil" );
|
height = ALTIUM_PARSER::ReadKicadUnit( props, "HEIGHT", "0mil" );
|
||||||
textheight = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "TEXTHEIGHT", "10mil" );
|
angle = ALTIUM_PARSER::ReadDouble( props, "ANGLE", 0. );
|
||||||
textlinewidth = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "TEXTLINEWIDTH", "6mil" );
|
|
||||||
textprecision = ALTIUM_PARSER::PropertiesReadInt( properties, "TEXTPRECISION", 2 );
|
|
||||||
textbold = ALTIUM_PARSER::PropertiesReadBool( properties, "TEXTLINEWIDTH", false );
|
|
||||||
textitalic = ALTIUM_PARSER::PropertiesReadBool( properties, "ITALIC", false );
|
|
||||||
|
|
||||||
arrowsize = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "ARROWSIZE", "60mil" );
|
linewidth = ALTIUM_PARSER::ReadKicadUnit( props, "LINEWIDTH", "10mil" );
|
||||||
|
textheight = ALTIUM_PARSER::ReadKicadUnit( props, "TEXTHEIGHT", "10mil" );
|
||||||
|
textlinewidth = ALTIUM_PARSER::ReadKicadUnit( props, "TEXTLINEWIDTH", "6mil" );
|
||||||
|
textprecision = ALTIUM_PARSER::ReadInt( props, "TEXTPRECISION", 2 );
|
||||||
|
textbold = ALTIUM_PARSER::ReadBool( props, "TEXTLINEWIDTH", false );
|
||||||
|
textitalic = ALTIUM_PARSER::ReadBool( props, "ITALIC", false );
|
||||||
|
|
||||||
xy1 = wxPoint( ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "X1", "0mil" ),
|
arrowsize = ALTIUM_PARSER::ReadKicadUnit( props, "ARROWSIZE", "60mil" );
|
||||||
-ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "Y1", "0mil" ) );
|
|
||||||
|
xy1 = wxPoint( ALTIUM_PARSER::ReadKicadUnit( props, "X1", "0mil" ),
|
||||||
|
-ALTIUM_PARSER::ReadKicadUnit( props, "Y1", "0mil" ) );
|
||||||
|
|
||||||
|
int refcount = ALTIUM_PARSER::ReadInt( props, "REFERENCES_COUNT", 0 );
|
||||||
|
|
||||||
int refcount = ALTIUM_PARSER::PropertiesReadInt( properties, "REFERENCES_COUNT", 0 );
|
|
||||||
for( int i = 0; i < refcount; i++ )
|
for( int i = 0; i < refcount; i++ )
|
||||||
{
|
{
|
||||||
const std::string refi = "REFERENCE" + std::to_string( i );
|
const std::string refi = "REFERENCE" + std::to_string( i ) + "POINT";
|
||||||
referencePoint.emplace_back(
|
referencePoint.emplace_back( ALTIUM_PARSER::ReadKicadUnit( props, refi + "X", "0mil" ),
|
||||||
ALTIUM_PARSER::PropertiesReadKicadUnit( properties, refi + "POINTX", "0mil" ),
|
-ALTIUM_PARSER::ReadKicadUnit( props, refi + "Y", "0mil" ) );
|
||||||
-ALTIUM_PARSER::PropertiesReadKicadUnit( properties, refi + "POINTY", "0mil" ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for( size_t i = 1; i < std::numeric_limits<size_t>::max(); i++ )
|
for( size_t i = 1; i < std::numeric_limits<size_t>::max(); i++ )
|
||||||
|
@ -341,143 +309,91 @@ ADIMENSION6::ADIMENSION6( ALTIUM_PARSER& aReader )
|
||||||
const std::string textix = texti + "X";
|
const std::string textix = texti + "X";
|
||||||
const std::string textiy = texti + "Y";
|
const std::string textiy = texti + "Y";
|
||||||
|
|
||||||
if( properties.find( textix ) == properties.end()
|
if( props.find( textix ) == props.end() || props.find( textiy ) == props.end() )
|
||||||
|| properties.find( textiy ) == properties.end() )
|
|
||||||
{
|
|
||||||
break; // it doesn't seem like we know beforehand how many vertices are inside a polygon
|
break; // it doesn't seem like we know beforehand how many vertices are inside a polygon
|
||||||
}
|
|
||||||
|
|
||||||
textPoint.emplace_back(
|
textPoint.emplace_back( ALTIUM_PARSER::ReadKicadUnit( props, textix, "0mil" ),
|
||||||
ALTIUM_PARSER::PropertiesReadKicadUnit( properties, textix, "0mil" ),
|
-ALTIUM_PARSER::ReadKicadUnit( props, textiy, "0mil" ) );
|
||||||
-ALTIUM_PARSER::PropertiesReadKicadUnit( properties, textiy, "0mil" ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString dimensionunit =
|
wxString dimensionunit = ALTIUM_PARSER::ReadString( props, "TEXTDIMENSIONUNIT", "Millimeters" );
|
||||||
ALTIUM_PARSER::PropertiesReadString( properties, "TEXTDIMENSIONUNIT", "Millimeters" );
|
|
||||||
if( dimensionunit == "Inches" )
|
if( dimensionunit == "Inches" ) textunit = ALTIUM_UNIT::INCHES;
|
||||||
{
|
else if( dimensionunit == "Mils" ) textunit = ALTIUM_UNIT::MILS;
|
||||||
textunit = ALTIUM_UNIT::INCHES;
|
else if( dimensionunit == "Millimeters" ) textunit = ALTIUM_UNIT::MILLIMETERS;
|
||||||
}
|
else if( dimensionunit == "Centimeters" ) textunit = ALTIUM_UNIT::CENTIMETER;
|
||||||
else if( dimensionunit == "Mils" )
|
else textunit = ALTIUM_UNIT::UNKNOWN;
|
||||||
{
|
|
||||||
textunit = ALTIUM_UNIT::MILS;
|
|
||||||
}
|
|
||||||
else if( dimensionunit == "Millimeters" )
|
|
||||||
{
|
|
||||||
textunit = ALTIUM_UNIT::MILLIMETERS;
|
|
||||||
}
|
|
||||||
else if( dimensionunit == "Centimeters" )
|
|
||||||
{
|
|
||||||
textunit = ALTIUM_UNIT::CENTIMETER;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
textunit = ALTIUM_UNIT::UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Dimensions6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Dimensions6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AMODEL::AMODEL( ALTIUM_PARSER& aReader )
|
AMODEL::AMODEL( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
||||||
|
|
||||||
if( properties.empty() )
|
if( properties.empty() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Classes6 stream has no properties!" );
|
THROW_IO_ERROR( "Classes6 stream has no properties!" );
|
||||||
}
|
|
||||||
|
|
||||||
name = ALTIUM_PARSER::PropertiesReadString( properties, "NAME", "" );
|
name = ALTIUM_PARSER::ReadString( properties, "NAME", "" );
|
||||||
id = ALTIUM_PARSER::PropertiesReadString( properties, "ID", "" );
|
id = ALTIUM_PARSER::ReadString( properties, "ID", "" );
|
||||||
isEmbedded = ALTIUM_PARSER::PropertiesReadBool( properties, "EMBED", false );
|
isEmbedded = ALTIUM_PARSER::ReadBool( properties, "EMBED", false );
|
||||||
|
|
||||||
rotation.x = ALTIUM_PARSER::PropertiesReadDouble( properties, "ROTX", 0. );
|
rotation.x = ALTIUM_PARSER::ReadDouble( properties, "ROTX", 0. );
|
||||||
rotation.y = ALTIUM_PARSER::PropertiesReadDouble( properties, "ROTY", 0. );
|
rotation.y = ALTIUM_PARSER::ReadDouble( properties, "ROTY", 0. );
|
||||||
rotation.z = ALTIUM_PARSER::PropertiesReadDouble( properties, "ROTZ", 0. );
|
rotation.z = ALTIUM_PARSER::ReadDouble( properties, "ROTZ", 0. );
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Classes6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Classes6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ANET6::ANET6( ALTIUM_PARSER& aReader )
|
ANET6::ANET6( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
||||||
if( properties.empty() )
|
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Nets6 stream has no properties" );
|
|
||||||
}
|
|
||||||
|
|
||||||
name = ALTIUM_PARSER::PropertiesReadString( properties, "NAME", "" );
|
if( properties.empty() )
|
||||||
|
THROW_IO_ERROR( "Nets6 stream has no properties" );
|
||||||
|
|
||||||
|
name = ALTIUM_PARSER::ReadString( properties, "NAME", "" );
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Nets6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Nets6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
APOLYGON6::APOLYGON6( ALTIUM_PARSER& aReader )
|
APOLYGON6::APOLYGON6( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
||||||
if( properties.empty() )
|
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Polygons6 stream has no properties" );
|
|
||||||
}
|
|
||||||
|
|
||||||
layer = altium_layer_from_name(
|
if( properties.empty() )
|
||||||
ALTIUM_PARSER::PropertiesReadString( properties, "LAYER", "" ) );
|
THROW_IO_ERROR( "Polygons6 stream has no properties" );
|
||||||
net = ALTIUM_PARSER::PropertiesReadInt( properties, "NET", ALTIUM_NET_UNCONNECTED );
|
|
||||||
locked = ALTIUM_PARSER::PropertiesReadBool( properties, "LOCKED", false );
|
layer = altium_layer_from_name( ALTIUM_PARSER::ReadString( properties, "LAYER", "" ) );
|
||||||
|
net = ALTIUM_PARSER::ReadInt( properties, "NET", ALTIUM_NET_UNCONNECTED );
|
||||||
|
locked = ALTIUM_PARSER::ReadBool( properties, "LOCKED", false );
|
||||||
|
|
||||||
// TODO: kind
|
// TODO: kind
|
||||||
|
|
||||||
gridsize = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "GRIDSIZE", "0mil" );
|
gridsize = ALTIUM_PARSER::ReadKicadUnit( properties, "GRIDSIZE", "0mil" );
|
||||||
trackwidth = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "TRACKWIDTH", "0mil" );
|
trackwidth = ALTIUM_PARSER::ReadKicadUnit( properties, "TRACKWIDTH", "0mil" );
|
||||||
minprimlength = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "MINPRIMLENGTH", "0mil" );
|
minprimlength = ALTIUM_PARSER::ReadKicadUnit( properties, "MINPRIMLENGTH", "0mil" );
|
||||||
useoctagons = ALTIUM_PARSER::PropertiesReadBool( properties, "USEOCTAGONS", false );
|
useoctagons = ALTIUM_PARSER::ReadBool( properties, "USEOCTAGONS", false );
|
||||||
|
|
||||||
pourindex = ALTIUM_PARSER::PropertiesReadInt( properties, "POURINDEX", 0 );
|
pourindex = ALTIUM_PARSER::ReadInt( properties, "POURINDEX", 0 );
|
||||||
|
|
||||||
wxString hatchstyleraw = ALTIUM_PARSER::PropertiesReadString( properties, "HATCHSTYLE", "" );
|
wxString hatchstyleraw = ALTIUM_PARSER::ReadString( properties, "HATCHSTYLE", "" );
|
||||||
|
|
||||||
if( hatchstyleraw == "Solid" )
|
if( hatchstyleraw == "Solid" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::SOLID;
|
||||||
{
|
else if( hatchstyleraw == "45Degree" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::DEGREE_45;
|
||||||
hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::SOLID;
|
else if( hatchstyleraw == "90Degree" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::DEGREE_90;
|
||||||
}
|
else if( hatchstyleraw == "Horizontal" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::HORIZONTAL;
|
||||||
else if( hatchstyleraw == "45Degree" )
|
else if( hatchstyleraw == "Vertical" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::VERTICAL;
|
||||||
{
|
else if( hatchstyleraw == "None" ) hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::NONE;
|
||||||
hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::DEGREE_45;
|
else hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::UNKNOWN;
|
||||||
}
|
|
||||||
else if( hatchstyleraw == "90Degree" )
|
|
||||||
{
|
|
||||||
hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::DEGREE_90;
|
|
||||||
}
|
|
||||||
else if( hatchstyleraw == "Horizontal" )
|
|
||||||
{
|
|
||||||
hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::HORIZONTAL;
|
|
||||||
}
|
|
||||||
else if( hatchstyleraw == "Vertical" )
|
|
||||||
{
|
|
||||||
hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::VERTICAL;
|
|
||||||
}
|
|
||||||
else if( hatchstyleraw == "None" )
|
|
||||||
{
|
|
||||||
hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::NONE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hatchstyle = ALTIUM_POLYGON_HATCHSTYLE::UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
altium_parse_polygons( properties, vertices );
|
altium_parse_polygons( properties, vertices );
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Polygons6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Polygons6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ARULE6::ARULE6( ALTIUM_PARSER& aReader )
|
ARULE6::ARULE6( ALTIUM_PARSER& aReader )
|
||||||
|
@ -492,23 +408,22 @@ ARULE6::ARULE6( ALTIUM_PARSER& aReader )
|
||||||
|
|
||||||
aReader.Skip( 2 );
|
aReader.Skip( 2 );
|
||||||
|
|
||||||
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
std::map<wxString, wxString> props = aReader.ReadProperties();
|
||||||
if( properties.empty() )
|
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Rules6 stream has no properties" );
|
|
||||||
}
|
|
||||||
|
|
||||||
name = ALTIUM_PARSER::PropertiesReadString( properties, "NAME", "" );
|
if( props.empty() )
|
||||||
priority = ALTIUM_PARSER::PropertiesReadInt( properties, "PRIORITY", 1 );
|
THROW_IO_ERROR( "Rules6 stream has no props" );
|
||||||
|
|
||||||
scope1expr = ALTIUM_PARSER::PropertiesReadString( properties, "SCOPE1EXPRESSION", "" );
|
name = ALTIUM_PARSER::ReadString( props, "NAME", "" );
|
||||||
scope2expr = ALTIUM_PARSER::PropertiesReadString( properties, "SCOPE2EXPRESSION", "" );
|
priority = ALTIUM_PARSER::ReadInt( props, "PRIORITY", 1 );
|
||||||
|
|
||||||
wxString rulekind = ALTIUM_PARSER::PropertiesReadString( properties, "RULEKIND", "" );
|
scope1expr = ALTIUM_PARSER::ReadString( props, "SCOPE1EXPRESSION", "" );
|
||||||
|
scope2expr = ALTIUM_PARSER::ReadString( props, "SCOPE2EXPRESSION", "" );
|
||||||
|
|
||||||
|
wxString rulekind = ALTIUM_PARSER::ReadString( props, "RULEKIND", "" );
|
||||||
if( rulekind == "Clearance" )
|
if( rulekind == "Clearance" )
|
||||||
{
|
{
|
||||||
kind = ALTIUM_RULE_KIND::CLEARANCE;
|
kind = ALTIUM_RULE_KIND::CLEARANCE;
|
||||||
clearanceGap = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "GAP", "10mil" );
|
clearanceGap = ALTIUM_PARSER::ReadKicadUnit( props, "GAP", "10mil" );
|
||||||
}
|
}
|
||||||
else if( rulekind == "DiffPairsRouting" )
|
else if( rulekind == "DiffPairsRouting" )
|
||||||
{
|
{
|
||||||
|
@ -537,29 +452,21 @@ ARULE6::ARULE6( ALTIUM_PARSER& aReader )
|
||||||
else if( rulekind == "PlaneClearance" )
|
else if( rulekind == "PlaneClearance" )
|
||||||
{
|
{
|
||||||
kind = ALTIUM_RULE_KIND::PLANE_CLEARANCE;
|
kind = ALTIUM_RULE_KIND::PLANE_CLEARANCE;
|
||||||
planeclearanceClearance =
|
planeclearanceClearance = ALTIUM_PARSER::ReadKicadUnit( props, "CLEARANCE", "10mil" );
|
||||||
ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "CLEARANCE", "10mil" );
|
|
||||||
}
|
}
|
||||||
else if( rulekind == "PolygonConnect" )
|
else if( rulekind == "PolygonConnect" )
|
||||||
{
|
{
|
||||||
kind = ALTIUM_RULE_KIND::POLYGON_CONNECT;
|
kind = ALTIUM_RULE_KIND::POLYGON_CONNECT;
|
||||||
polygonconnectAirgapwidth =
|
polygonconnectAirgapwidth = ALTIUM_PARSER::ReadKicadUnit( props, "AIRGAPWIDTH", "10mil" );
|
||||||
ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "AIRGAPWIDTH", "10mil" );
|
polygonconnectReliefconductorwidth = ALTIUM_PARSER::ReadKicadUnit( props, "RELIEFCONDUCTORWIDTH", "10mil" );
|
||||||
polygonconnectReliefconductorwidth = ALTIUM_PARSER::PropertiesReadKicadUnit(
|
polygonconnectReliefentries = ALTIUM_PARSER::ReadInt( props, "RELIEFENTRIES", 4 );
|
||||||
properties, "RELIEFCONDUCTORWIDTH", "10mil" );
|
|
||||||
polygonconnectReliefentries =
|
|
||||||
ALTIUM_PARSER::PropertiesReadInt( properties, "RELIEFENTRIES", 4 );
|
|
||||||
|
|
||||||
wxString style = ALTIUM_PARSER::PropertiesReadString( properties, "CONNECTSTYLE", "" );
|
wxString style = ALTIUM_PARSER::ReadString( props, "CONNECTSTYLE", "" );
|
||||||
|
|
||||||
if( style == "Direct" )
|
if( style == "Direct" ) polygonconnectStyle = ALTIUM_CONNECT_STYLE::DIRECT;
|
||||||
polygonconnectStyle = ALTIUM_CONNECT_STYLE::DIRECT;
|
else if( style == "Relief" ) polygonconnectStyle = ALTIUM_CONNECT_STYLE::RELIEF;
|
||||||
else if( style == "Relief" )
|
else if( style == "NoConnect" ) polygonconnectStyle = ALTIUM_CONNECT_STYLE::NONE;
|
||||||
polygonconnectStyle = ALTIUM_CONNECT_STYLE::RELIEF;
|
else polygonconnectStyle = ALTIUM_CONNECT_STYLE::UNKNOWN;
|
||||||
else if( style == "NoConnect" )
|
|
||||||
polygonconnectStyle = ALTIUM_CONNECT_STYLE::NONE;
|
|
||||||
else
|
|
||||||
polygonconnectStyle = ALTIUM_CONNECT_STYLE::UNKNOWN;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -567,9 +474,7 @@ ARULE6::ARULE6( ALTIUM_PARSER& aReader )
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Rules6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Rules6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AARC6::AARC6( ALTIUM_PARSER& aReader )
|
AARC6::AARC6( ALTIUM_PARSER& aReader )
|
||||||
|
@ -613,10 +518,9 @@ AARC6::AARC6( ALTIUM_PARSER& aReader )
|
||||||
ACOMPONENTBODY6::ACOMPONENTBODY6( ALTIUM_PARSER& aReader )
|
ACOMPONENTBODY6::ACOMPONENTBODY6( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
||||||
|
|
||||||
if( recordtype != ALTIUM_RECORD::MODEL )
|
if( recordtype != ALTIUM_RECORD::MODEL )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "ComponentsBodies6 stream has invalid recordtype" );
|
THROW_IO_ERROR( "ComponentsBodies6 stream has invalid recordtype" );
|
||||||
}
|
|
||||||
|
|
||||||
aReader.ReadAndSetSubrecordLength();
|
aReader.ReadAndSetSubrecordLength();
|
||||||
|
|
||||||
|
@ -625,33 +529,30 @@ ACOMPONENTBODY6::ACOMPONENTBODY6( ALTIUM_PARSER& aReader )
|
||||||
aReader.Skip( 9 );
|
aReader.Skip( 9 );
|
||||||
|
|
||||||
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
||||||
|
|
||||||
if( properties.empty() )
|
if( properties.empty() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "ComponentsBodies6 stream has no properties" );
|
THROW_IO_ERROR( "ComponentsBodies6 stream has no properties" );
|
||||||
}
|
|
||||||
|
|
||||||
modelName = ALTIUM_PARSER::PropertiesReadString( properties, "MODEL.NAME", "" );
|
modelName = ALTIUM_PARSER::ReadString( properties, "MODEL.NAME", "" );
|
||||||
modelId = ALTIUM_PARSER::PropertiesReadString( properties, "MODELID", "" );
|
modelId = ALTIUM_PARSER::ReadString( properties, "MODELID", "" );
|
||||||
modelIsEmbedded = ALTIUM_PARSER::PropertiesReadBool( properties, "MODEL.EMBED", false );
|
modelIsEmbedded = ALTIUM_PARSER::ReadBool( properties, "MODEL.EMBED", false );
|
||||||
|
|
||||||
modelPosition.x = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "MODEL.2D.X", "0mil" );
|
modelPosition.x = ALTIUM_PARSER::ReadKicadUnit( properties, "MODEL.2D.X", "0mil" );
|
||||||
modelPosition.y = -ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "MODEL.2D.Y", "0mil" );
|
modelPosition.y = -ALTIUM_PARSER::ReadKicadUnit( properties, "MODEL.2D.Y", "0mil" );
|
||||||
modelPosition.z = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "MODEL.3D.DZ", "0mil" );
|
modelPosition.z = ALTIUM_PARSER::ReadKicadUnit( properties, "MODEL.3D.DZ", "0mil" );
|
||||||
|
|
||||||
modelRotation.x = ALTIUM_PARSER::PropertiesReadDouble( properties, "MODEL.3D.ROTX", 0. );
|
modelRotation.x = ALTIUM_PARSER::ReadDouble( properties, "MODEL.3D.ROTX", 0. );
|
||||||
modelRotation.y = ALTIUM_PARSER::PropertiesReadDouble( properties, "MODEL.3D.ROTY", 0. );
|
modelRotation.y = ALTIUM_PARSER::ReadDouble( properties, "MODEL.3D.ROTY", 0. );
|
||||||
modelRotation.z = ALTIUM_PARSER::PropertiesReadDouble( properties, "MODEL.3D.ROTZ", 0. );
|
modelRotation.z = ALTIUM_PARSER::ReadDouble( properties, "MODEL.3D.ROTZ", 0. );
|
||||||
|
|
||||||
rotation = ALTIUM_PARSER::PropertiesReadDouble( properties, "MODEL.2D.ROTATION", 0. );
|
rotation = ALTIUM_PARSER::ReadDouble( properties, "MODEL.2D.ROTATION", 0. );
|
||||||
|
|
||||||
bodyOpacity = ALTIUM_PARSER::PropertiesReadDouble( properties, "BODYOPACITY3D", 1. );
|
bodyOpacity = ALTIUM_PARSER::ReadDouble( properties, "BODYOPACITY3D", 1. );
|
||||||
|
|
||||||
aReader.SkipSubrecord();
|
aReader.SkipSubrecord();
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Components6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Components6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
APAD6::APAD6( ALTIUM_PARSER& aReader )
|
APAD6::APAD6( ALTIUM_PARSER& aReader )
|
||||||
|
@ -797,10 +698,9 @@ APAD6::APAD6( ALTIUM_PARSER& aReader )
|
||||||
AVIA6::AVIA6( ALTIUM_PARSER& aReader )
|
AVIA6::AVIA6( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
||||||
|
|
||||||
if( recordtype != ALTIUM_RECORD::VIA )
|
if( recordtype != ALTIUM_RECORD::VIA )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Vias6 stream has invalid recordtype" );
|
THROW_IO_ERROR( "Vias6 stream has invalid recordtype" );
|
||||||
}
|
|
||||||
|
|
||||||
// Subrecord 1
|
// Subrecord 1
|
||||||
size_t subrecord1 = aReader.ReadAndSetSubrecordLength();
|
size_t subrecord1 = aReader.ReadAndSetSubrecordLength();
|
||||||
|
@ -838,18 +738,15 @@ AVIA6::AVIA6( ALTIUM_PARSER& aReader )
|
||||||
aReader.SkipSubrecord();
|
aReader.SkipSubrecord();
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Vias6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Vias6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ATRACK6::ATRACK6( ALTIUM_PARSER& aReader )
|
ATRACK6::ATRACK6( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
||||||
|
|
||||||
if( recordtype != ALTIUM_RECORD::TRACK )
|
if( recordtype != ALTIUM_RECORD::TRACK )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Tracks6 stream has invalid recordtype" );
|
THROW_IO_ERROR( "Tracks6 stream has invalid recordtype" );
|
||||||
}
|
|
||||||
|
|
||||||
// Subrecord 1
|
// Subrecord 1
|
||||||
aReader.ReadAndSetSubrecordLength();
|
aReader.ReadAndSetSubrecordLength();
|
||||||
|
@ -874,18 +771,15 @@ ATRACK6::ATRACK6( ALTIUM_PARSER& aReader )
|
||||||
aReader.SkipSubrecord();
|
aReader.SkipSubrecord();
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Tracks6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Tracks6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ATEXT6::ATEXT6( ALTIUM_PARSER& aReader )
|
ATEXT6::ATEXT6( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
||||||
|
|
||||||
if( recordtype != ALTIUM_RECORD::TEXT )
|
if( recordtype != ALTIUM_RECORD::TEXT )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Texts6 stream has invalid recordtype" );
|
THROW_IO_ERROR( "Texts6 stream has invalid recordtype" );
|
||||||
}
|
|
||||||
|
|
||||||
// Subrecord 1 - Properties
|
// Subrecord 1 - Properties
|
||||||
size_t subrecord1 = aReader.ReadAndSetSubrecordLength();
|
size_t subrecord1 = aReader.ReadAndSetSubrecordLength();
|
||||||
|
@ -914,9 +808,8 @@ ATEXT6::ATEXT6( ALTIUM_PARSER& aReader )
|
||||||
* https://gitlab.com/kicad/code/kicad/merge_requests/60#note_274913397
|
* https://gitlab.com/kicad/code/kicad/merge_requests/60#note_274913397
|
||||||
*/
|
*/
|
||||||
if( subrecord1 <= 230 )
|
if( subrecord1 <= 230 )
|
||||||
{
|
|
||||||
textposition = ALTIUM_TEXT_POSITION::LEFT_BOTTOM;
|
textposition = ALTIUM_TEXT_POSITION::LEFT_BOTTOM;
|
||||||
}
|
|
||||||
aReader.Skip( 27 );
|
aReader.Skip( 27 );
|
||||||
fonttype = static_cast<ALTIUM_TEXT_TYPE>( aReader.Read<uint8_t>() );
|
fonttype = static_cast<ALTIUM_TEXT_TYPE>( aReader.Read<uint8_t>() );
|
||||||
|
|
||||||
|
@ -933,18 +826,15 @@ ATEXT6::ATEXT6( ALTIUM_PARSER& aReader )
|
||||||
aReader.SkipSubrecord();
|
aReader.SkipSubrecord();
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Texts6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Texts6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AFILL6::AFILL6( ALTIUM_PARSER& aReader )
|
AFILL6::AFILL6( ALTIUM_PARSER& aReader )
|
||||||
{
|
{
|
||||||
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
||||||
|
|
||||||
if( recordtype != ALTIUM_RECORD::FILL )
|
if( recordtype != ALTIUM_RECORD::FILL )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Fills6 stream has invalid recordtype" );
|
THROW_IO_ERROR( "Fills6 stream has invalid recordtype" );
|
||||||
}
|
|
||||||
|
|
||||||
// Subrecord 1
|
// Subrecord 1
|
||||||
aReader.ReadAndSetSubrecordLength();
|
aReader.ReadAndSetSubrecordLength();
|
||||||
|
@ -968,18 +858,15 @@ AFILL6::AFILL6( ALTIUM_PARSER& aReader )
|
||||||
aReader.SkipSubrecord();
|
aReader.SkipSubrecord();
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Fills6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Fills6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
|
AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
|
||||||
{
|
{
|
||||||
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
ALTIUM_RECORD recordtype = static_cast<ALTIUM_RECORD>( aReader.Read<uint8_t>() );
|
||||||
|
|
||||||
if( recordtype != ALTIUM_RECORD::REGION )
|
if( recordtype != ALTIUM_RECORD::REGION )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Regions6 stream has invalid recordtype" );
|
THROW_IO_ERROR( "Regions6 stream has invalid recordtype" );
|
||||||
}
|
|
||||||
|
|
||||||
// Subrecord 1
|
// Subrecord 1
|
||||||
aReader.ReadAndSetSubrecordLength();
|
aReader.ReadAndSetSubrecordLength();
|
||||||
|
@ -1000,19 +887,18 @@ AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
|
||||||
aReader.Skip( 2 );
|
aReader.Skip( 2 );
|
||||||
|
|
||||||
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
std::map<wxString, wxString> properties = aReader.ReadProperties();
|
||||||
|
|
||||||
if( properties.empty() )
|
if( properties.empty() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Regions6 stream has empty properties" );
|
THROW_IO_ERROR( "Regions6 stream has empty properties" );
|
||||||
}
|
|
||||||
|
|
||||||
int pkind = ALTIUM_PARSER::PropertiesReadInt( properties, "KIND", 0 );
|
int pkind = ALTIUM_PARSER::ReadInt( properties, "KIND", 0 );
|
||||||
bool is_cutout = ALTIUM_PARSER::PropertiesReadBool( properties, "ISBOARDCUTOUT", false );
|
bool is_cutout = ALTIUM_PARSER::ReadBool( properties, "ISBOARDCUTOUT", false );
|
||||||
|
|
||||||
is_shapebased = ALTIUM_PARSER::PropertiesReadBool( properties, "ISSHAPEBASED", false );
|
is_shapebased = ALTIUM_PARSER::ReadBool( properties, "ISSHAPEBASED", false );
|
||||||
|
|
||||||
// TODO: this can differ from the other subpolyindex?!
|
// TODO: this can differ from the other subpolyindex?!
|
||||||
//subpolyindex = static_cast<uint16_t>(
|
//subpolyindex = static_cast<uint16_t>(
|
||||||
// ALTIUM_PARSER::PropertiesReadInt( properties, "SUBPOLYINDEX", ALTIUM_POLYGON_NONE ) );
|
// ALTIUM_PARSER::ReadInt( properties, "SUBPOLYINDEX", ALTIUM_POLYGON_NONE ) );
|
||||||
|
|
||||||
switch( pkind )
|
switch( pkind )
|
||||||
{
|
{
|
||||||
|
@ -1087,7 +973,5 @@ AREGION6::AREGION6( ALTIUM_PARSER& aReader, bool aExtendedVertices )
|
||||||
aReader.SkipSubrecord();
|
aReader.SkipSubrecord();
|
||||||
|
|
||||||
if( aReader.HasParsingError() )
|
if( aReader.HasParsingError() )
|
||||||
{
|
|
||||||
THROW_IO_ERROR( "Regions6 stream was not parsed correctly" );
|
THROW_IO_ERROR( "Regions6 stream was not parsed correctly" );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,7 @@ BOOST_AUTO_TEST_CASE( PropertiesReadKicadUnit )
|
||||||
{
|
{
|
||||||
std::map<wxString, wxString> properties = { { "TEST", c.input } };
|
std::map<wxString, wxString> properties = { { "TEST", c.input } };
|
||||||
|
|
||||||
int result = ALTIUM_PARSER::PropertiesReadKicadUnit( properties, "TEST", "0mil" );
|
int result = ALTIUM_PARSER::ReadKicadUnit( properties, "TEST", "0mil" );
|
||||||
|
|
||||||
// These are all valid
|
// These are all valid
|
||||||
BOOST_CHECK_EQUAL( result, c.exp_result );
|
BOOST_CHECK_EQUAL( result, c.exp_result );
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
#include <eeschema/sch_plugins/altium/altium_parser_sch.h>
|
#include <eeschema/sch_plugins/altium/altium_parser_sch.h>
|
||||||
|
|
||||||
// Function declarations of private methods to test
|
// Function declarations of private methods to test
|
||||||
int PropertiesReadKiCadUnitFrac( const std::map<wxString, wxString>& aProperties,
|
int ReadKiCadUnitFrac( const std::map<wxString, wxString>& aProps,
|
||||||
const wxString& aKey );
|
const wxString& aKey );
|
||||||
|
|
||||||
|
|
||||||
struct ALTIUM_PARSER_SCH_FIXTURE
|
struct ALTIUM_PARSER_SCH_FIXTURE
|
||||||
|
@ -95,7 +95,7 @@ BOOST_AUTO_TEST_CASE( PropertiesReadKiCadUnitFracConversation )
|
||||||
std::map<wxString, wxString> properties = { { "TEST", c.input },
|
std::map<wxString, wxString> properties = { { "TEST", c.input },
|
||||||
{ "TEST_FRAC", c.input_frac } };
|
{ "TEST_FRAC", c.input_frac } };
|
||||||
|
|
||||||
int result = PropertiesReadKiCadUnitFrac( properties, "TEST" );
|
int result = ReadKiCadUnitFrac( properties, "TEST" );
|
||||||
|
|
||||||
// These are all valid
|
// These are all valid
|
||||||
BOOST_CHECK_EQUAL( result, c.exp_result );
|
BOOST_CHECK_EQUAL( result, c.exp_result );
|
||||||
|
|
Loading…
Reference in New Issue