From 570ea62b64dd95dfd3d5a3a851027fe3ba8e755c Mon Sep 17 00:00:00 2001 From: Michael Kavanagh Date: Sun, 29 Mar 2020 14:07:53 +0100 Subject: [PATCH] Fix discrepancy between ASCII and CSV fp pos files Fixes https://gitlab.com/kicad/code/kicad/issues/3897 --- pcbnew/exporters/export_footprints_placefile.cpp | 3 +++ pcbnew/exporters/gen_footprints_placefile.cpp | 4 ++-- pcbnew/pcb_edit_frame.h | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pcbnew/exporters/export_footprints_placefile.cpp b/pcbnew/exporters/export_footprints_placefile.cpp index 6778fc1ef7..2bd4be360a 100644 --- a/pcbnew/exporters/export_footprints_placefile.cpp +++ b/pcbnew/exporters/export_footprints_placefile.cpp @@ -186,6 +186,9 @@ std::string PLACE_FILE_EXPORTER::GenPositionData() LAYER_NUM layer = list[ii].m_Module->GetLayer(); wxASSERT( layer == F_Cu || layer == B_Cu ); + if( layer == B_Cu ) + footprint_pos.x = - footprint_pos.x; + wxString tmp = "\"" + list[ii].m_Reference; tmp << "\"" << csv_sep; tmp << "\"" << list[ii].m_Value; diff --git a/pcbnew/exporters/gen_footprints_placefile.cpp b/pcbnew/exporters/gen_footprints_placefile.cpp index f639cf325b..19138027e8 100644 --- a/pcbnew/exporters/gen_footprints_placefile.cpp +++ b/pcbnew/exporters/gen_footprints_placefile.cpp @@ -477,7 +477,7 @@ int PCB_EDITOR_CONTROL::GeneratePosFile( const TOOL_EVENT& aEvent ) int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM, - bool aForceSmdItems, bool aTopSide, bool BottomSide, bool aFormatCSV ) + bool aForceSmdItems, bool aTopSide, bool aBottomSide, bool aFormatCSV ) { FILE * file = NULL; @@ -491,7 +491,7 @@ int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName, std::string data; PLACE_FILE_EXPORTER exporter( GetBoard(), aUnitsMM, aForceSmdItems, - aTopSide, BottomSide, aFormatCSV ); + aTopSide, aBottomSide, aFormatCSV ); data = exporter.GenPositionData(); // if aFullFileName is empty, the file is not created, only the diff --git a/pcbnew/pcb_edit_frame.h b/pcbnew/pcb_edit_frame.h index 3726bf1735..f2cdc4995d 100644 --- a/pcbnew/pcb_edit_frame.h +++ b/pcbnew/pcb_edit_frame.h @@ -559,14 +559,14 @@ public: * @param aForceSmdItems = true to force all footprints with smd pads in list * = false to put only footprints with option "INSERT" in list * @param aTopSide true to list footprints on front (top) side, - * @param BottomSide true to list footprints on back (bottom) side, + * @param aBottomSide true to list footprints on back (bottom) side, * if aTopSide and aTopSide are true, list footprints on both sides * @param aFormatCSV = true to use a comma separated file (CSV) format; defautl = false * @return the number of footprints found on aSide side, * or -1 if the file could not be created */ int DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM, - bool aForceSmdItems, bool aTopSide, bool BottomSide, bool aFormatCSV = false ); + bool aForceSmdItems, bool aTopSide, bool aBottomSide, bool aFormatCSV = false ); /** * Function GenFootprintsReport