From 2663ad5340c2cdafb43f8f4c041b40ee69915d4e Mon Sep 17 00:00:00 2001
From: Jeff Young
Date: Sun, 10 Apr 2022 16:48:24 +0100
Subject: [PATCH] Implement Eagle text variables.
Also fixes two bugs:
1) subsequent text items that are marked >NAME or >VALUE will now get
imported as text items with ${REFERENCE} or ${VALUE} (instead of overwriting
the previous text item)
2) we no longer (accidentally) capitalize all text items.
Fixes https://gitlab.com/kicad/code/kicad/issues/11321
---
pcbnew/plugins/eagle/eagle_plugin.cpp | 102 +++++++++++-------
.../ANT-GPS-2X7MM.kicad_mod | 4 +-
.../ANT-GPS-2X8MM.kicad_mod | 4 +-
.../SparkFun-GPS.pretty/COPERNICUS.kicad_mod | 4 +-
.../EM-506_OUTLINE.kicad_mod | 4 +-
.../SparkFun-GPS.pretty/GP3906-TLP.kicad_mod | 4 +-
.../JST-6PIN-1MM.kicad_mod | 4 +-
.../MLOEX_GNSS_MOLDED.kicad_mod | 8 +-
.../MOLEX_GNSS_CHIP.kicad_mod | 6 +-
.../MOLEX_GNSS_CUBE.kicad_mod | 4 +-
.../lbr/SparkFun-GPS.pretty/NEO-M8P.kicad_mod | 4 +-
.../NEO-M9N_M8T_M8U_D9S.kicad_mod | 4 +-
.../lbr/SparkFun-GPS.pretty/SAM-M8Q.kicad_mod | 4 +-
.../lbr/SparkFun-GPS.pretty/TE_PUCK.kicad_mod | 4 +-
.../TITAN_X1_GPS.kicad_mod | 4 +-
.../UBLOX_ZED_F9R.kicad_mod | 4 +-
.../UBLOX_ZOE_M8-0-10.kicad_mod | 4 +-
.../VENUS638FLPX.kicad_mod | 4 +-
.../lbr/SparkFun-GPS.pretty/W3011.kicad_mod | 6 +-
.../lbr/SparkFun-GPS.pretty/W3062A.kicad_mod | 6 +-
.../lbr/SparkFun-GPS.pretty/ZED-F9P.kicad_mod | 4 +-
.../plugins/eagle/test_eagle_lbr_import.cpp | 5 +-
22 files changed, 111 insertions(+), 86 deletions(-)
diff --git a/pcbnew/plugins/eagle/eagle_plugin.cpp b/pcbnew/plugins/eagle/eagle_plugin.cpp
index 64aa271f8a..d1d7d68922 100644
--- a/pcbnew/plugins/eagle/eagle_plugin.cpp
+++ b/pcbnew/plugins/eagle/eagle_plugin.cpp
@@ -121,6 +121,24 @@ static wxString makeKey( const wxString& aFirst, const wxString& aSecond )
/// interpret special characters in Eagle text and converts them to KiCAD notation
static wxString interpret_text( const wxString& aText )
{
+ wxString token = aText.Upper();
+
+ if ( token == wxT( ">NAME" ) ) return wxT( "${REFERENCE}" );
+ else if( token == wxT( ">VALUE" ) ) return wxT( "${VALUE}" );
+ else if( token == wxT( ">PART" ) ) return wxT( "${REFERENCE}" );
+ else if( token == wxT( ">GATE" ) ) return wxT( "${UNIT}" );
+ else if( token == wxT( ">MODULE" ) ) return wxT( "${FOOTPRINT_NAME}" );
+ else if( token == wxT( ">SHEETNR" ) ) return wxT( "${#}" );
+ else if( token == wxT( ">SHEETS" ) ) return wxT( "${##}" );
+ else if( token == wxT( ">SHEET" ) ) return wxT( "${#}/${##}" );
+ else if( token == wxT( ">SHEETNR_TOTAL" ) ) return wxT( "${#}" );
+ else if( token == wxT( ">SHEETS_TOTAL" ) ) return wxT( "${##}" );
+ else if( token == wxT( ">SHEET_TOTAL" ) ) return wxT( "${#}/${##}" );
+ else if( token == wxT( ">ASSEMBLY_VARIANT" ) ) return wxT( "${ASSEMBLY_VARIANT}" );
+ else if( token == wxT( ">DRAWING_NAME" ) ) return wxT( "${TITLE}" );
+ else if( token == wxT( ">LAST_DATE_TIME" ) ) return wxT( "${ISSUE_DATE}" );
+ else if( token == wxT( ">PLOT_DATE_TIME" ) ) return wxT( "${CURRENT_DATE}" );
+
wxString text;
bool sectionOpen = false;
@@ -1079,10 +1097,10 @@ void EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLib, const wxString* aLibName )
wxString key = aLibName ? makeKey( *aLibName, pack_ref ) : pack_ref;
- FOOTPRINT* m = makeFootprint( package, pack_ref );
+ FOOTPRINT* footprint = makeFootprint( package, pack_ref );
// add the templating FOOTPRINT to the FOOTPRINT template factory "m_templates"
- std::pair r = m_templates.insert( {key, m} );
+ std::pair r = m_templates.insert( { key, footprint} );
if( !r.second /* && !( m_props && m_props->Value( "ignore_duplicates" ) ) */ )
{
@@ -1945,33 +1963,41 @@ void EAGLE_PLUGIN::packageText( FOOTPRINT* aFootprint, wxXmlNode* aTree ) const
return;
}
- FP_TEXT* txt;
+ FP_TEXT* textItem;
- if( t.text.MakeUpper() == wxT( ">NAME" ) )
- txt = &aFootprint->Reference();
- else if( t.text.MakeUpper() == wxT( ">VALUE" ) )
- txt = &aFootprint->Value();
+ if( t.text.Upper() == wxT( ">NAME" ) && aFootprint->GetReference().IsEmpty() )
+ {
+ textItem = &aFootprint->Reference();
+
+ textItem->SetText( wxT( "REF**" ) );
+ }
+ else if( t.text.Upper() == wxT( ">VALUE" ) && aFootprint->GetValue().IsEmpty() )
+ {
+ textItem = &aFootprint->Value();
+
+ textItem->SetText( aFootprint->GetFPID().GetLibItemName() );
+ }
else
{
// FIXME: graphical text items are rotated for some reason.
- txt = new FP_TEXT( aFootprint );
- aFootprint->Add( txt );
- }
+ textItem = new FP_TEXT( aFootprint );
+ aFootprint->Add( textItem );
- txt->SetText( t.text );
+ textItem->SetText( interpret_text( t.text ) );
+ }
VECTOR2I pos( kicad_x( t.x ), kicad_y( t.y ) );
- txt->SetTextPos( pos );
- txt->SetPos0( pos - aFootprint->GetPosition() );
+ textItem->SetTextPos( pos );
+ textItem->SetPos0( pos - aFootprint->GetPosition() );
- txt->SetLayer( layer );
+ textItem->SetLayer( layer );
double ratio = t.ratio ? *t.ratio : 8; // DTD says 8 is default
- int textThickness = KiROUND( t.size.ToPcbUnits() * ratio / 100 );
+ int textThickness = KiROUND( t.size.ToPcbUnits() * ratio / 100 );
- txt->SetTextThickness( textThickness );
- txt->SetTextSize( kicad_fontz( t.size, textThickness ) );
+ textItem->SetTextThickness( textThickness );
+ textItem->SetTextSize( kicad_fontz( t.size, textThickness ) );
int align = t.align ? *t.align : ETEXT::BOTTOM_LEFT; // bottom-left is eagle default
@@ -1981,13 +2007,13 @@ void EAGLE_PLUGIN::packageText( FOOTPRINT* aFootprint, wxXmlNode* aTree ) const
if( t.rot )
{
int sign = t.rot->mirror ? -1 : 1;
- txt->SetMirrored( t.rot->mirror );
+ textItem->SetMirrored( t.rot->mirror );
double degrees = t.rot->degrees;
if( degrees == 90 || t.rot->spin )
{
- txt->SetTextAngle( EDA_ANGLE( sign * degrees, DEGREES_T ) );
+ textItem->SetTextAngle( EDA_ANGLE( sign * degrees, DEGREES_T ) );
}
else if( degrees == 180 )
{
@@ -1996,55 +2022,55 @@ void EAGLE_PLUGIN::packageText( FOOTPRINT* aFootprint, wxXmlNode* aTree ) const
else if( degrees == 270 )
{
align = ETEXT::TOP_RIGHT;
- txt->SetTextAngle( EDA_ANGLE( sign * 90, DEGREES_T ) );
+ textItem->SetTextAngle( EDA_ANGLE( sign * 90, DEGREES_T ) );
}
}
switch( align )
{
case ETEXT::CENTER:
- txt->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
- txt->SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
+ textItem->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
+ textItem->SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
break;
case ETEXT::CENTER_LEFT:
- txt->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
- txt->SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
+ textItem->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
+ textItem->SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
break;
case ETEXT::CENTER_RIGHT:
- txt->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT );
- txt->SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
+ textItem->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT );
+ textItem->SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
break;
case ETEXT::TOP_CENTER:
- txt->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
- txt->SetVertJustify( GR_TEXT_V_ALIGN_TOP );
+ textItem->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
+ textItem->SetVertJustify( GR_TEXT_V_ALIGN_TOP );
break;
case ETEXT::TOP_LEFT:
- txt->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
- txt->SetVertJustify( GR_TEXT_V_ALIGN_TOP );
+ textItem->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
+ textItem->SetVertJustify( GR_TEXT_V_ALIGN_TOP );
break;
case ETEXT::TOP_RIGHT:
- txt->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT );
- txt->SetVertJustify( GR_TEXT_V_ALIGN_TOP );
+ textItem->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT );
+ textItem->SetVertJustify( GR_TEXT_V_ALIGN_TOP );
break;
case ETEXT::BOTTOM_CENTER:
- txt->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
- txt->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
+ textItem->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER );
+ textItem->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
break;
case ETEXT::BOTTOM_LEFT:
- txt->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
- txt->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
+ textItem->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT );
+ textItem->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
break;
case ETEXT::BOTTOM_RIGHT:
- txt->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT );
- txt->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
+ textItem->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT );
+ textItem->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM );
break;
}
}
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ANT-GPS-2X7MM.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ANT-GPS-2X7MM.kicad_mod
index 5f61165de1..08949288cf 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ANT-GPS-2X7MM.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ANT-GPS-2X7MM.kicad_mod
@@ -1,11 +1,11 @@
(footprint "ANT-GPS-2X7MM" (version 20220308) (generator pcbnew)
(layer "F.Cu")
(descr "GPS Chip Antenna - 7.0 x 2.0 x 0.8 mm
\n7.0 x 2.0 x 0.8 mm package
\nPackage used for Johanson 1575AT43A40 GPS Antenna
\nExample Datasheet
")
- (fp_text reference ">NAME" (at 0 -1.243) (layer "F.SilkS")
+ (fp_text reference "REF**" (at 0 -1.243) (layer "F.SilkS")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify bottom))
(tstamp 6c1406ea-2aa3-4f33-856a-3cac6407d7eb)
)
- (fp_text value ">VALUE" (at 0 1.243) (layer "F.Fab")
+ (fp_text value "ANT-GPS-2X7MM" (at 0 1.243) (layer "F.Fab")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify top))
(tstamp bf36aa30-45da-40ef-9edd-a28d102b610c)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ANT-GPS-2X8MM.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ANT-GPS-2X8MM.kicad_mod
index 3172749bf1..37acf71e12 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ANT-GPS-2X8MM.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ANT-GPS-2X8MM.kicad_mod
@@ -1,11 +1,11 @@
(footprint "ANT-GPS-2X8MM" (version 20220308) (generator pcbnew)
(layer "F.Cu")
(descr "GPS Chip Antenna - 2.0 x 8.0 x 1.5 mm
\n2.0 x 8.0 x 1.5 mm package
\nPackage used for Chant Sincere Co. 922D03E15X11113 GPS Antenna
\nExample Datasheet
")
- (fp_text reference ">NAME" (at 0 -1.243) (layer "F.SilkS")
+ (fp_text reference "REF**" (at 0 -1.243) (layer "F.SilkS")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify bottom))
(tstamp 1c3f99a3-672c-4c1e-949f-13435d987a5f)
)
- (fp_text value ">VALUE" (at 0 1.243) (layer "F.Fab")
+ (fp_text value "ANT-GPS-2X8MM" (at 0 1.243) (layer "F.Fab")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify top))
(tstamp 6ab0be29-c5da-4299-8358-a6d8203f46d3)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/COPERNICUS.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/COPERNICUS.kicad_mod
index 6160936eff..eafa5842a8 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/COPERNICUS.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/COPERNICUS.kicad_mod
@@ -1,11 +1,11 @@
(footprint "COPERNICUS" (version 20220308) (generator pcbnew)
(layer "F.Cu")
(descr "Trimble Copernicus and Copernicus II GPS Receiver
\nDatasheet
")
- (fp_text reference ">NAME" (at 0 -1) (layer "F.SilkS")
+ (fp_text reference "REF**" (at 0 -1) (layer "F.SilkS")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify bottom))
(tstamp d6c8194e-589d-4752-9f0d-2d52723f3b1b)
)
- (fp_text value ">VALUE" (at 0 1) (layer "F.Fab")
+ (fp_text value "COPERNICUS" (at 0 1) (layer "F.Fab")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify top))
(tstamp 24e0e6e2-af98-4b34-a0dd-fdf796720f34)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/EM-506_OUTLINE.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/EM-506_OUTLINE.kicad_mod
index aec646166c..7d1294b616 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/EM-506_OUTLINE.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/EM-506_OUTLINE.kicad_mod
@@ -1,11 +1,11 @@
(footprint "EM-506_OUTLINE" (version 20220308) (generator pcbnew)
(layer "F.Cu")
(descr "EM-406 and EM-506 module dimensions
\nThe EM-506 is a GPS receiver module with on-board voltage regulation and patch antenna built-in.
\n30 x 30 x 10.7 mm
\nProduct Link
")
- (fp_text reference ">NAME" (at 0.24 -0.24) (layer "F.SilkS")
+ (fp_text reference "REF**" (at 0.24 -0.24) (layer "F.SilkS")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify bottom))
(tstamp a328d818-f0f9-4063-af62-ce05f05c96b8)
)
- (fp_text value ">VALUE" (at 0 1.27) (layer "F.Fab")
+ (fp_text value "EM-506_OUTLINE" (at 0 1.27) (layer "F.Fab")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify top))
(tstamp e2c89449-6558-4246-8bf5-9ab8f1bd9773)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/GP3906-TLP.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/GP3906-TLP.kicad_mod
index 313880f9e6..f0636afd37 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/GP3906-TLP.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/GP3906-TLP.kicad_mod
@@ -1,11 +1,11 @@
(footprint "GP3906-TLP" (version 20220331) (generator pcbnew)
(layer "F.Cu")
(descr "GP3906-TLP PoT GPS Module
\nThe GP3906-TLP is a POT (Patch on Top) GPS module which is special designed for ultra low power consumption purpose environment. It is a GPS receiver providing a solution that high position and speed accuracy performances as well as high sensitivity and tracking capabilities in urban conditions. The GPS chipsets inside the module are designed by MediaTek Inc., which is the world's leading digital media solution provider and largest fab-less IC company in Taiwan. The module can support up to 66 channels. The GPS solution enables small form factor devices. They deliver major advancements in GPS performances, accuracy, integration, computing power and flexibility. They are designed to simplify the embedded system integration process.
\n\nFeatures:\n
- Based on MediaTek Single Chip Architecture (MT3339).
\n- ARM7 based application processor
\n- High sensitivity: -165dBm tracking
\n- L1 frequency, C/A code
\n- Channels: 66 acquisition, 22 simultaneous tracking
\n- Low power consumption: 26mA @ acquisition, 20mA @ tracking
\n- Cold/Warm/Hot start time: <35/<33/<1 seconds
\n- Maximum update rate up to 10Hz
\n- GPS data interface: TTL level serial port
\n- Support NMEA 0183 standard V3.01 and backward compliance
\n- Support SBAS – WAAS, EGNOS, GAGAN and MSAS
\n- Dimension:16mm x 16mm x 6.7mm
\n- RoHS compliant
\n- Advanced software features
\n- AlwaysLocate TM advanced location awareness technology
\n- EPO TM orbit prediction
\n- Supports logger function (LOCUS)
\nDatasheet
")
- (fp_text reference ">NAME" (at -7.62 -8.382) (layer "F.SilkS")
+ (fp_text reference "REF**" (at -7.62 -8.382) (layer "F.SilkS")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify left bottom))
(tstamp 17d210dd-e5fd-4175-b1c9-9cfddae4ea65)
)
- (fp_text value ">VALUE" (at -7.62 8.382) (layer "F.Fab")
+ (fp_text value "GP3906-TLP" (at -7.62 8.382) (layer "F.Fab")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify left top))
(tstamp 2b08b3bf-4fe1-4cee-84bd-1c2398b32a4d)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/JST-6PIN-1MM.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/JST-6PIN-1MM.kicad_mod
index 081dcd0f69..0ee290a982 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/JST-6PIN-1MM.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/JST-6PIN-1MM.kicad_mod
@@ -1,11 +1,11 @@
(footprint "JST-6PIN-1MM" (version 20220308) (generator pcbnew)
(layer "F.Cu")
(descr "6-Pin Vertical JST Connector
\n\nCommon interface for SparkFun GPS modules.
\nDatasheet
")
- (fp_text reference ">NAME" (at -4.659 -0.18 90) (layer "F.SilkS")
+ (fp_text reference "REF**" (at -4.659 -0.18 90) (layer "F.SilkS")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify bottom))
(tstamp 59a36a12-e2d8-4905-b005-1e4577d488a2)
)
- (fp_text value ">VALUE" (at 4.739 -0.18 90) (layer "F.Fab")
+ (fp_text value "JST-6PIN-1MM" (at 4.739 -0.18 90) (layer "F.Fab")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify top))
(tstamp a3af595a-c56d-4c72-a32b-919c99a06675)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MLOEX_GNSS_MOLDED.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MLOEX_GNSS_MOLDED.kicad_mod
index 09ad2decd0..2fd2313df3 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MLOEX_GNSS_MOLDED.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MLOEX_GNSS_MOLDED.kicad_mod
@@ -1,18 +1,18 @@
(footprint "MLOEX_GNSS_MOLDED" (version 20220308) (generator pcbnew)
(layer "F.Cu")
- (fp_text reference ">NAME" (at 0 -0.381) (layer "F.SilkS")
+ (fp_text reference "REF**" (at 0 -0.381) (layer "F.SilkS")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp bb8dd847-3200-400d-a0f0-e739c6f02d1c)
)
- (fp_text value ">VALUE" (at 0 0) (layer "F.Fab")
+ (fp_text value "MLOEX_GNSS_MOLDED" (at 0 0) (layer "F.Fab")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp 09737abe-d1bb-440e-953b-7612025ab13d)
)
- (fp_text user ">TNAME" (at -1.27 1.27) (layer "F.SilkS")
+ (fp_text user ">tName" (at -1.27 1.27) (layer "F.SilkS")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp 057cb804-7c98-4ec3-a7d5-e64114b95abe)
)
- (fp_text user ">TVALUE" (at -1.27 1.651) (layer "F.Fab")
+ (fp_text user ">tValue" (at -1.27 1.651) (layer "F.Fab")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp eec82342-98a4-48d0-9a4e-c46398ef4b2d)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MOLEX_GNSS_CHIP.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MOLEX_GNSS_CHIP.kicad_mod
index 03ed73aef7..2cf372a661 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MOLEX_GNSS_CHIP.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MOLEX_GNSS_CHIP.kicad_mod
@@ -1,14 +1,14 @@
(footprint "MOLEX_GNSS_CHIP" (version 20220308) (generator pcbnew)
(layer "F.Cu")
- (fp_text reference ">NAME" (at 0 -1.651) (layer "F.SilkS")
+ (fp_text reference "REF**" (at 0 -1.651) (layer "F.SilkS")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp 7f686d09-4451-4065-abd5-e1117a903ae4)
)
- (fp_text value ">VALUE" (at 0 -1.27) (layer "F.Fab")
+ (fp_text value "MOLEX_GNSS_CHIP" (at 0 -1.27) (layer "F.Fab")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp 63d1d323-bdfa-4015-96e3-0fff5a0bc9fa)
)
- (fp_text user "REVERSIBLE\nANTENNA" (at 0 0) (layer "F.Fab")
+ (fp_text user "Reversible\nAntenna" (at 0 0) (layer "F.Fab")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp c5f24d00-7977-41d3-9db9-1238666268f5)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MOLEX_GNSS_CUBE.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MOLEX_GNSS_CUBE.kicad_mod
index 6ad40a1c56..ac81d3bdb5 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MOLEX_GNSS_CUBE.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/MOLEX_GNSS_CUBE.kicad_mod
@@ -1,10 +1,10 @@
(footprint "MOLEX_GNSS_CUBE" (version 20220308) (generator pcbnew)
(layer "F.Cu")
- (fp_text reference ">NAME" (at 0 -2.54) (layer "F.SilkS")
+ (fp_text reference "REF**" (at 0 -2.54) (layer "F.SilkS")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)))
(tstamp 956e2264-ba1c-425e-aeac-f9910dee9176)
)
- (fp_text value ">VALUE" (at 0 -0.889) (layer "F.Fab")
+ (fp_text value "MOLEX_GNSS_CUBE" (at 0 -0.889) (layer "F.Fab")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)))
(tstamp 93bd0dd9-b5e0-459a-8b58-43df88932fd5)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/NEO-M8P.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/NEO-M8P.kicad_mod
index 6bc1fba061..ed90af2c70 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/NEO-M8P.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/NEO-M8P.kicad_mod
@@ -1,10 +1,10 @@
(footprint "NEO-M8P" (version 20220308) (generator pcbnew)
(layer "F.Cu")
- (fp_text reference ">NAME" (at -6.1 -8.5) (layer "F.SilkS")
+ (fp_text reference "REF**" (at -6.1 -8.5) (layer "F.SilkS")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)) (justify left bottom))
(tstamp 7b1d98c9-ebec-4839-8c2c-974afef9f2e1)
)
- (fp_text value ">VALUE" (at -6.1 9) (layer "F.Fab")
+ (fp_text value "NEO-M8P" (at -6.1 9) (layer "F.Fab")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)) (justify left bottom))
(tstamp 8d693841-9c5d-442a-a87f-bb53e43ffe5c)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/NEO-M9N_M8T_M8U_D9S.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/NEO-M9N_M8T_M8U_D9S.kicad_mod
index ec0ae52ae5..aa830b7b06 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/NEO-M9N_M8T_M8U_D9S.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/NEO-M9N_M8T_M8U_D9S.kicad_mod
@@ -1,11 +1,11 @@
(footprint "NEO-M9N_M8T_M8U_D9S" (version 20220308) (generator pcbnew)
(layer "F.Cu")
(descr "u-blox NEO-M9N/M8T/M8U/D9S Module
\n\nMechanical Specifications
\n\n- Overall: 12.2mm x 16.0mm
\n- Pad Pitch: 1.1mm
\n- Pad Width: .8mm
\n- Pad Length: .9mm
\n- Number of Pins: 24
\n\n\n\n\n\n\n
")
- (fp_text reference ">NAME" (at -6.1 -8.5) (layer "F.SilkS")
+ (fp_text reference "REF**" (at -6.1 -8.5) (layer "F.SilkS")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)) (justify left bottom))
(tstamp 696f0a31-7891-4389-a52b-5d646c65fb14)
)
- (fp_text value ">VALUE" (at -6.1 9) (layer "F.Fab")
+ (fp_text value "NEO-M9N_M8T_M8U_D9S" (at -6.1 9) (layer "F.Fab")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)) (justify left bottom))
(tstamp d4583788-7b45-4b41-aa1a-9ffbac086709)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/SAM-M8Q.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/SAM-M8Q.kicad_mod
index e912786646..1a72fcb3a0 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/SAM-M8Q.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/SAM-M8Q.kicad_mod
@@ -1,11 +1,11 @@
(footprint "SAM-M8Q" (version 20220308) (generator pcbnew)
(layer "F.Cu")
(descr "SAM-M8Q-0-10
\nPhyscial Characteristics\n\n- 15x15x6.3mm
\n- Module is a Chip Antenna/GPS Unit combined
\n\n
")
- (fp_text reference ">NAME" (at -7.75 -8.25) (layer "F.SilkS")
+ (fp_text reference "REF**" (at -7.75 -8.25) (layer "F.SilkS")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)) (justify left bottom))
(tstamp 862f4113-a97c-4e19-b737-89e520642e0b)
)
- (fp_text value ">VALUE" (at -7.75 8.75) (layer "F.Fab")
+ (fp_text value "SAM-M8Q" (at -7.75 8.75) (layer "F.Fab")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)) (justify left bottom))
(tstamp 655d5b44-c00a-4f59-9b17-b0d4d5359ca8)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/TE_PUCK.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/TE_PUCK.kicad_mod
index 4135ff17e5..3ede190ba4 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/TE_PUCK.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/TE_PUCK.kicad_mod
@@ -1,10 +1,10 @@
(footprint "TE_PUCK" (version 20220308) (generator pcbnew)
(layer "F.Cu")
- (fp_text reference ">NAME" (at 0 -0.635) (layer "F.SilkS")
+ (fp_text reference "REF**" (at 0 -0.635) (layer "F.SilkS")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)))
(tstamp 416238ba-0a06-41b1-a2ac-656eb16c4cb4)
)
- (fp_text value ">VALUE" (at 0 1.27) (layer "F.Fab")
+ (fp_text value "TE_PUCK" (at 0 1.27) (layer "F.Fab")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)))
(tstamp 79b11ed4-57a2-46b5-8336-ad3ec42f7607)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/TITAN_X1_GPS.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/TITAN_X1_GPS.kicad_mod
index d8b0c082d6..a828f6409b 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/TITAN_X1_GPS.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/TITAN_X1_GPS.kicad_mod
@@ -1,10 +1,10 @@
(footprint "TITAN_X1_GPS" (version 20220308) (generator pcbnew)
(layer "F.Cu")
- (fp_text reference ">NAME" (at -2.54 -1.27) (layer "F.SilkS")
+ (fp_text reference "REF**" (at -2.54 -1.27) (layer "F.SilkS")
(effects (font (size 0.6477 0.6477) (thickness 0.1143)) (justify left bottom))
(tstamp 96208de3-6b2a-4c49-97f2-a839b9fa6182)
)
- (fp_text value ">VALUE" (at -2.54 0) (layer "F.Fab")
+ (fp_text value "TITAN_X1_GPS" (at -2.54 0) (layer "F.Fab")
(effects (font (size 0.6477 0.6477) (thickness 0.1143)) (justify left bottom))
(tstamp c16278f6-3541-4475-b7c7-975101a759d5)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/UBLOX_ZED_F9R.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/UBLOX_ZED_F9R.kicad_mod
index 4d79b6edae..6cb2cda29a 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/UBLOX_ZED_F9R.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/UBLOX_ZED_F9R.kicad_mod
@@ -1,11 +1,11 @@
(footprint "UBLOX_ZED_F9R" (version 20220308) (generator pcbnew)
(layer "F.Cu")
(descr "u-blox ZED-F9K ADR
\nGPS Unit with Real Time Kinematics (RTK) and internal IMU = Automotive Dead Reckoning
\n\nMechanical Specification \n
\n\n- Physical Module: 22mm x 17mm
\n- Peripheral Pad Size: .8mm x 1.5mm
\n- Peripheral Pad Pitch: 1.1mm
\n- Total Peripheral Pins: 54
\n- Internal Pad Size: 1.1mm
\n- Internal Pad Pitch: 2.1mm
\n- Total Internal Pins: 48 (All Ground)
\n
")
- (fp_text reference ">NAME" (at -2.112 -9.38) (layer "F.SilkS")
+ (fp_text reference "REF**" (at -2.112 -9.38) (layer "F.SilkS")
(effects (font (size 0.70104 0.70104) (thickness 0.06096)) (justify left bottom))
(tstamp 94f17c01-fe6e-4660-b178-96c05ef49e38)
)
- (fp_text value ">VALUE" (at -2.112 10.62) (layer "F.Fab")
+ (fp_text value "UBLOX_ZED_F9R" (at -2.112 10.62) (layer "F.Fab")
(effects (font (size 0.70104 0.70104) (thickness 0.06096)) (justify left bottom))
(tstamp 564ab8dd-b699-49f7-9262-7336b334ff54)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/UBLOX_ZOE_M8-0-10.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/UBLOX_ZOE_M8-0-10.kicad_mod
index e9bcb35013..63462c73c5 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/UBLOX_ZOE_M8-0-10.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/UBLOX_ZOE_M8-0-10.kicad_mod
@@ -1,11 +1,11 @@
(footprint "UBLOX_ZOE_M8-0-10" (version 20220331) (generator pcbnew)
(layer "F.Cu")
(descr "UBLOX ZOE-M8Q-0-10
\nThe ZOE-M8G and ZOE-M8Q are u-blox’s super small, highly integrated GNSS SiP (System in Package) modules\nbased on the high performing u-blox M8 concurrent positioning engine. The ultra-miniature form factor integrates\na complete GNSS receiver including SAW filter, LNA and TCXO. The ZOE-M8Q is\nthe 3 V variant.
\n\nPhyical Characteristics
\n\n- LGA
\n- 51 Pins
\n- 4.5mm X 4.5mm X 1mm
\n- 51 Pins
\n
")
- (fp_text reference ">NAME" (at -2.246 -3.135) (layer "F.SilkS")
+ (fp_text reference "REF**" (at -2.246 -3.135) (layer "F.SilkS")
(effects (font (size 0.92 0.92) (thickness 0.08)) (justify left bottom))
(tstamp 6b9c0cf6-0afe-4392-bebe-5a3cf06ff9a6)
)
- (fp_text value ">VALUE" (at -2.373 3.865) (layer "F.Fab")
+ (fp_text value "UBLOX_ZOE_M8-0-10" (at -2.373 3.865) (layer "F.Fab")
(effects (font (size 0.92 0.92) (thickness 0.08)) (justify left bottom))
(tstamp 9ccdb9ca-d390-4c47-81bc-dca23d6b3429)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/VENUS638FLPX.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/VENUS638FLPX.kicad_mod
index 60d4493273..33ee170cb4 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/VENUS638FLPX.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/VENUS638FLPX.kicad_mod
@@ -1,11 +1,11 @@
(footprint "VENUS638FLPX" (version 20220308) (generator pcbnew)
(layer "F.Cu")
(descr "Skytraq Venus638FLPX GPS Receiver - 44-pin 10 x 10 mm QFN
\nVenus638FLPx is a high performance, low cost, single chip GPS receiver.
\nDatasheet
\nSparkFun Product Link
")
- (fp_text reference ">NAME" (at 0 -5.588) (layer "F.SilkS")
+ (fp_text reference "REF**" (at 0 -5.588) (layer "F.SilkS")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify bottom))
(tstamp 86d1b1c0-e7b7-4906-ba7b-ac91e2e3f576)
)
- (fp_text value ">VALUE" (at 0 5.588) (layer "F.Fab")
+ (fp_text value "VENUS638FLPX" (at 0 5.588) (layer "F.Fab")
(effects (font (size 0.48768 0.48768) (thickness 0.12192)) (justify top))
(tstamp 33449ea0-049c-4537-a8f5-27073b563ca2)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/W3011.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/W3011.kicad_mod
index 2c63715e7d..0e5a77dbfd 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/W3011.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/W3011.kicad_mod
@@ -1,14 +1,14 @@
(footprint "W3011" (version 20220308) (generator pcbnew)
(layer "F.Cu")
- (fp_text reference ">NAME" (at 0 -1.4) (layer "F.SilkS")
+ (fp_text reference "REF**" (at 0 -1.4) (layer "F.SilkS")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp 97f15326-9803-46cf-a615-c1bb2e10ff43)
)
- (fp_text value ">VALUE" (at 0 -1) (layer "F.Fab")
+ (fp_text value "W3011" (at 0 -1) (layer "F.Fab")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp ecfba060-db24-4802-8f43-11541d1ac7d0)
)
- (fp_text user "REVERSIBLE\nANTENNA" (at 0 0) (layer "F.Fab")
+ (fp_text user "Reversible\nAntenna" (at 0 0) (layer "F.Fab")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp 45a7d052-de66-4c45-ae44-df53b4d38d82)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/W3062A.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/W3062A.kicad_mod
index 3fa387dde3..713b09e4fb 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/W3062A.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/W3062A.kicad_mod
@@ -1,14 +1,14 @@
(footprint "W3062A" (version 20220308) (generator pcbnew)
(layer "F.Cu")
- (fp_text reference ">NAME" (at 0 -2) (layer "F.SilkS")
+ (fp_text reference "REF**" (at 0 -2) (layer "F.SilkS")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp e7f46d3f-b64e-439f-979c-8518bc4c1715)
)
- (fp_text value ">VALUE" (at 0 -1.4) (layer "F.Fab")
+ (fp_text value "W3062A" (at 0 -1.4) (layer "F.Fab")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp b7626292-8335-4208-b0a2-debf69b1e4c0)
)
- (fp_text user "REVERSIBLE\nANTENNA" (at 0 0) (layer "F.Fab")
+ (fp_text user "Reversible\nAntenna" (at 0 0) (layer "F.Fab")
(effects (font (size 0.184 0.184) (thickness 0.016)))
(tstamp b6ddbf3a-9012-4d9a-a7f6-306c7e06261a)
)
diff --git a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ZED-F9P.kicad_mod b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ZED-F9P.kicad_mod
index ff4202e590..22b16e90b1 100644
--- a/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ZED-F9P.kicad_mod
+++ b/qa/data/pcbnew/plugins/eagle/lbr/SparkFun-GPS.pretty/ZED-F9P.kicad_mod
@@ -1,10 +1,10 @@
(footprint "ZED-F9P" (version 20220308) (generator pcbnew)
(layer "F.Cu")
- (fp_text reference ">NAME" (at -11 -9) (layer "F.SilkS")
+ (fp_text reference "REF**" (at -11 -9) (layer "F.SilkS")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)) (justify left bottom))
(tstamp 88340cec-1f45-40fe-a5e7-3bba02edb061)
)
- (fp_text value ">VALUE" (at -11 9.5) (layer "F.Fab")
+ (fp_text value "ZED-F9P" (at -11 9.5) (layer "F.Fab")
(effects (font (size 0.46736 0.46736) (thickness 0.04064)) (justify left bottom))
(tstamp 566b2133-02b7-46dc-bd2b-7267a3373e3f)
)
diff --git a/qa/unittests/pcbnew/plugins/eagle/test_eagle_lbr_import.cpp b/qa/unittests/pcbnew/plugins/eagle/test_eagle_lbr_import.cpp
index e3d7dd32b0..0e73b3f341 100644
--- a/qa/unittests/pcbnew/plugins/eagle/test_eagle_lbr_import.cpp
+++ b/qa/unittests/pcbnew/plugins/eagle/test_eagle_lbr_import.cpp
@@ -92,9 +92,8 @@ BOOST_AUTO_TEST_CASE( EagleLbrLibImport )
false, nullptr );
BOOST_CHECK( eagleFp );
- // TODO: import does not replace variables
- //BOOST_CHECK_EQUAL( wxT( "REF**" ), eagleFp->GetReference() );
- //BOOST_CHECK_EQUAL( footprintName, eagleFp->GetValue() );
+ BOOST_CHECK_EQUAL( wxT( "REF**" ), eagleFp->GetReference() );
+ BOOST_CHECK_EQUAL( footprintName, eagleFp->GetValue() );
FOOTPRINT* kicadFp = kicadPlugin.FootprintLoad( kicadLibraryPath, footprintName,
true, nullptr );