Eeschema Eagle Import: Shift convertTextSize to common eagle parser.
This commit is contained in:
parent
433aa653fe
commit
a8fa64f158
|
@ -237,6 +237,30 @@ int parseAlignment(wxString alignment)
|
||||||
return DEFAULT_ALIGNMENT;
|
return DEFAULT_ALIGNMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// convert textsize method.
|
||||||
|
wxSize convertTextSize(ETEXT& etext ) {
|
||||||
|
|
||||||
|
wxSize textsize;
|
||||||
|
if(etext.font){
|
||||||
|
wxString font = etext.font.Get();
|
||||||
|
if(font == "vector")
|
||||||
|
{
|
||||||
|
textsize = wxSize( etext.size * EUNIT_TO_MIL, etext.size * EUNIT_TO_MIL );
|
||||||
|
}
|
||||||
|
else if ( font == "fixed")
|
||||||
|
{
|
||||||
|
textsize = wxSize( etext.size * EUNIT_TO_MIL, etext.size * EUNIT_TO_MIL*0.80 );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textsize = wxSize( etext.size * EUNIT_TO_MIL*0.85, etext.size * EUNIT_TO_MIL );
|
||||||
|
}
|
||||||
|
return textsize;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
EWIRE::EWIRE( wxXmlNode* aWire )
|
EWIRE::EWIRE( wxXmlNode* aWire )
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,9 +53,6 @@
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
// Eagle schematic internal units are millimeters
|
|
||||||
// Kicad schematic units are thousandths of an inch
|
|
||||||
constexpr double EUNIT_TO_MIL = 1000.0 / 25.4;
|
|
||||||
|
|
||||||
// Eagle schematic axes are aligned with x increasing left to right and Y increasing bottom to top
|
// Eagle schematic axes are aligned with x increasing left to right and Y increasing bottom to top
|
||||||
// Kicad schematic axes are aligned with x increasing left to rigth and Y increasing top to bottom.
|
// Kicad schematic axes are aligned with x increasing left to rigth and Y increasing top to bottom.
|
||||||
|
@ -1815,32 +1812,6 @@ LIB_TEXT* SCH_EAGLE_PLUGIN::loadSymboltext( std::unique_ptr< LIB_PART >& aPart,
|
||||||
return libtext.release();
|
return libtext.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert text method.
|
|
||||||
|
|
||||||
wxSize SCH_EAGLE_PLUGIN::convertTextSize(ETEXT& etext ) {
|
|
||||||
|
|
||||||
wxSize textsize;
|
|
||||||
if(etext.font){
|
|
||||||
wxString font = etext.font.Get();
|
|
||||||
if(font == "vector")
|
|
||||||
{
|
|
||||||
textsize = wxSize( etext.size * EUNIT_TO_MIL, etext.size * EUNIT_TO_MIL );
|
|
||||||
}
|
|
||||||
else if ( font == "fixed")
|
|
||||||
{
|
|
||||||
textsize = wxSize( etext.size * EUNIT_TO_MIL, etext.size * EUNIT_TO_MIL*0.80 );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
textsize = wxSize( etext.size * EUNIT_TO_MIL*0.85, etext.size * EUNIT_TO_MIL );
|
|
||||||
}
|
|
||||||
return textsize;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SCH_TEXT* SCH_EAGLE_PLUGIN::loadplaintext( wxXmlNode* aSchText )
|
SCH_TEXT* SCH_EAGLE_PLUGIN::loadplaintext( wxXmlNode* aSchText )
|
||||||
{
|
{
|
||||||
std::unique_ptr<SCH_TEXT> schtext( new SCH_TEXT() );
|
std::unique_ptr<SCH_TEXT> schtext( new SCH_TEXT() );
|
||||||
|
|
|
@ -142,7 +142,6 @@ private:
|
||||||
void moveLabels( SCH_ITEM* wire, wxPoint newendpoint);
|
void moveLabels( SCH_ITEM* wire, wxPoint newendpoint);
|
||||||
void addBusEntries();
|
void addBusEntries();
|
||||||
static wxString fixNetName( const wxString& aNetName );
|
static wxString fixNetName( const wxString& aNetName );
|
||||||
static wxSize convertTextSize(ETEXT& etext );
|
|
||||||
|
|
||||||
SCH_LAYER_ID kicadLayer( int aEagleLayer );
|
SCH_LAYER_ID kicadLayer( int aEagleLayer );
|
||||||
wxPoint findNearestLinePoint(wxPoint aPoint, const DLIST< SCH_LINE >& lines);
|
wxPoint findNearestLinePoint(wxPoint aPoint, const DLIST< SCH_LINE >& lines);
|
||||||
|
|
|
@ -41,6 +41,9 @@
|
||||||
#include <trigo.h>
|
#include <trigo.h>
|
||||||
#include <kicad_string.h>
|
#include <kicad_string.h>
|
||||||
|
|
||||||
|
// Eagle schematic internal units are millimeters
|
||||||
|
// Kicad schematic units are thousandths of an inch
|
||||||
|
constexpr double EUNIT_TO_MIL = 1000.0 / 25.4;
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
|
@ -607,6 +610,8 @@ struct ETEXT
|
||||||
ETEXT( wxXmlNode* aText );
|
ETEXT( wxXmlNode* aText );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Calculate text size based on font type and size;
|
||||||
|
wxSize convertTextSize(ETEXT& etext );
|
||||||
|
|
||||||
/// Eagle thru hol pad
|
/// Eagle thru hol pad
|
||||||
struct EPAD
|
struct EPAD
|
||||||
|
|
Loading…
Reference in New Issue