Remove duplicate headers in plot and associated code.
This commit is contained in:
parent
24a41559ca
commit
6427197962
|
@ -25,13 +25,10 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <eda_base_frame.h>
|
||||
#include <fill_type.h>
|
||||
#include <plotters_specific.h>
|
||||
#include "plotter_dxf.h"
|
||||
#include <macros.h>
|
||||
#include <string_utils.h>
|
||||
#include <convert_basic_shapes_to_polygon.h>
|
||||
#include <render_settings.h>
|
||||
#include <trigo.h>
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,13 +23,10 @@
|
|||
* @brief specialized plotter for GERBER files format
|
||||
*/
|
||||
|
||||
#include <eda_base_frame.h>
|
||||
#include <fill_type.h>
|
||||
#include <string_utils.h>
|
||||
#include <convert_basic_shapes_to_polygon.h>
|
||||
#include <macros.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <render_settings.h>
|
||||
#include <trigo.h>
|
||||
#include <wx/log.h>
|
||||
|
||||
|
|
|
@ -195,7 +195,6 @@
|
|||
|
||||
#include <cstdio>
|
||||
|
||||
#include <fill_type.h>
|
||||
#include <string_utils.h>
|
||||
#include <convert_basic_shapes_to_polygon.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
|
||||
#include <advanced_config.h>
|
||||
#include <macros.h>
|
||||
#include <render_settings.h>
|
||||
#include <trigo.h>
|
||||
|
||||
#include "plotters_pslike.h"
|
||||
|
|
|
@ -27,11 +27,9 @@
|
|||
* @brief KiCad: specialized plotter for PS files format
|
||||
*/
|
||||
|
||||
#include <eda_base_frame.h>
|
||||
#include <convert_basic_shapes_to_polygon.h>
|
||||
#include <macros.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <render_settings.h>
|
||||
#include <trigo.h>
|
||||
|
||||
#include "plotters_pslike.h"
|
||||
|
|
|
@ -92,7 +92,6 @@
|
|||
*/
|
||||
|
||||
#include <base64.h>
|
||||
#include <eda_base_frame.h>
|
||||
#include <eda_rect.h>
|
||||
#include <string_utils.h>
|
||||
#include <macros.h>
|
||||
|
@ -100,7 +99,6 @@
|
|||
|
||||
#include <cstdint>
|
||||
#include <wx/mstream.h>
|
||||
#include <render_settings.h>
|
||||
|
||||
#include "plotters_pslike.h"
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <math/box2.h>
|
||||
#include <plotter.h>
|
||||
|
||||
|
||||
|
@ -61,7 +59,7 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* Opens the DXF plot with a skeleton header.
|
||||
* Open the DXF plot with a skeleton header.
|
||||
*/
|
||||
virtual bool StartPlot() override;
|
||||
virtual bool EndPlot() override;
|
||||
|
|
|
@ -26,9 +26,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <math/box2.h>
|
||||
|
||||
#include <plotter.h>
|
||||
#include "gbr_plotter_apertures.h"
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
#include <math/box2.h>
|
||||
#include <plotter.h>
|
||||
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <math/box2.h>
|
||||
#include <plotter.h>
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
#include <eeschema_settings.h>
|
||||
#include <kiface_i.h>
|
||||
#include <locale_io.h>
|
||||
#include <plotters_specific.h>
|
||||
#include "../../common/plotters/plotter_hpgl.h"
|
||||
#include "../../common/plotters/plotter_dxf.h"
|
||||
#include "../../common/plotters/plotters_pslike.h"
|
||||
#include <reporter.h>
|
||||
#include <trace_helpers.h>
|
||||
#include <settings/settings_manager.h>
|
||||
|
@ -119,7 +121,6 @@ DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC( SCH_EDIT_FRAME* parent )
|
|||
}
|
||||
|
||||
|
||||
// Initialize the dialog options:
|
||||
void DIALOG_PLOT_SCHEMATIC::initDlg()
|
||||
{
|
||||
auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <sch_painter.h>
|
||||
#include <symbol_edit_frame.h>
|
||||
#include <locale_io.h>
|
||||
#include <plotters_specific.h>
|
||||
#include "../../common/plotters/plotters_pslike.h"
|
||||
|
||||
void SYMBOL_EDIT_FRAME::SVGPlotSymbol( const wxString& aFullFileName )
|
||||
{
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <plotter.h>
|
||||
#include <plotters_specific.h>
|
||||
#include <eda_item.h>
|
||||
#include <gr_text.h>
|
||||
|
@ -111,7 +110,6 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
|
|||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
wxASSERT( false );
|
||||
KI_FALLTHROUGH;
|
||||
|
@ -479,8 +477,7 @@ unsigned GENDRILL_WRITER_BASE::printToolSummary( OUTPUTFORMATTER& out, bool aSum
|
|||
if( !aSummaryNPTH && tool.m_Hole_NotPlated )
|
||||
continue;
|
||||
|
||||
// List the tool number assigned to each drill,
|
||||
// in mm then in inches.
|
||||
// List the tool number assigned to each drill in mm then in inches.
|
||||
int tool_number = ii+1;
|
||||
out.Print( 0, " T%d %2.3fmm %2.4f\" ", tool_number,
|
||||
diameter_in_mm( tool.m_Diameter ),
|
||||
|
|
|
@ -27,13 +27,9 @@
|
|||
* @brief Functions to create drill files in gerber X2 format.
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <plotter.h>
|
||||
#include <plotters_specific.h>
|
||||
#include "../../common/plotters/plotter_gerber.h"
|
||||
#include <string_utils.h>
|
||||
#include <locale_io.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <board.h>
|
||||
#include <footprint.h>
|
||||
#include <pcb_track.h>
|
||||
|
@ -206,16 +202,19 @@ int GERBER_WRITER::createDrillFile( wxString& aFullFilename, bool aIsNpth,
|
|||
|
||||
if( pad->GetProperty() == PAD_PROP::CASTELLATED )
|
||||
{
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CASTELLATEDDRILL );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CASTELLATEDDRILL );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Good practice of oblong pad holes (slots) is to use a specific aperture for
|
||||
// routing, not used in drill commands.
|
||||
if( hole_descr.m_Hole_Shape )
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_OBLONG_DRILL );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_OBLONG_DRILL );
|
||||
else
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_DRILL );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_DRILL );
|
||||
}
|
||||
|
||||
// Add object attribute: component reference to pads (mainly useful for users)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 Jean_Pierre Charras <jp.charras at wanadoo.fr>
|
||||
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
|
@ -27,12 +27,10 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#include <plotter.h>
|
||||
#include <plotters_specific.h>
|
||||
#include "../../common/plotters/plotter_gerber.h"
|
||||
#include <string_utils.h>
|
||||
#include <locale_io.h>
|
||||
#include <macros.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
|
||||
#include <board.h>
|
||||
#include <board_design_settings.h>
|
||||
|
@ -86,6 +84,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
// Add the standard X2 header, without FileFunction
|
||||
AddGerberX2Header( &plotter, m_pcb );
|
||||
plotter.SetViewport( m_offset, IU_PER_MILS/10, /* scale */ 1.0, /* mirror */false );
|
||||
|
||||
// has meaning only for gerber plotter. Must be called only after SetViewport
|
||||
plotter.SetGerberCoordinatesFormat( 6 );
|
||||
plotter.SetCreator( wxT( "PCBNEW" ) );
|
||||
|
@ -183,7 +182,8 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
|
||||
if( ( footprint->GetFlags() & checkFlag ) == 0 )
|
||||
{
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_COURTYARD );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_COURTYARD );
|
||||
|
||||
const SHAPE_POLY_SET& courtyard = footprint->GetPolyCourtyard( aLayer );
|
||||
|
||||
|
@ -195,13 +195,15 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
continue;
|
||||
|
||||
useFpPadsBbox = false;
|
||||
plotter.PLOTTER::PlotPoly( poly, FILL_TYPE::NO_FILL, line_thickness, &gbr_metadata );
|
||||
plotter.PLOTTER::PlotPoly( poly, FILL_TYPE::NO_FILL, line_thickness,
|
||||
&gbr_metadata );
|
||||
}
|
||||
}
|
||||
|
||||
if( useFpPadsBbox )
|
||||
{
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_FOOTPRINT );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_FOOTPRINT );
|
||||
|
||||
// bbox of fp pads, pos 0, rot 0, non flipped
|
||||
EDA_RECT bbox = footprint->GetFpPadsLocalBbox();
|
||||
|
@ -309,7 +311,6 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
plotter.EndPlot();
|
||||
|
||||
return cmp_count;
|
||||
|
@ -318,8 +319,8 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
|
||||
double PLACEFILE_GERBER_WRITER::mapRotationAngle( double aAngle )
|
||||
{
|
||||
// convert a kicad footprint orientation to gerber rotation, depending on the layer
|
||||
// Currently, same notation as kicad
|
||||
// Convert a KiCad footprint orientation to gerber rotation, depending on the layer
|
||||
// Currently, same notation as KiCad.
|
||||
return aAngle;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <bitset> // for bitset, operator&, __bi...
|
||||
#include <math.h> // for abs
|
||||
#include <stddef.h> // for NULL, size_t
|
||||
#include <vector> // for vector, __vector_base<>...
|
||||
|
||||
#include <geometry/seg.h> // for SEG
|
||||
#include <geometry/shape_circle.h>
|
||||
|
@ -36,14 +35,11 @@
|
|||
#include <macros.h>
|
||||
#include <math/util.h> // for KiROUND, Clamp
|
||||
#include <math/vector2d.h> // for VECTOR2I
|
||||
#include <plotter.h>
|
||||
#include <plotters_specific.h>
|
||||
#include "../common/plotters/plotter_gerber.h"
|
||||
#include <trigo.h>
|
||||
|
||||
#include <board_design_settings.h> // for BOARD_DESIGN_SETTINGS
|
||||
#include <core/typeinfo.h> // for dyn_cast, PCB_DIMENSION_T
|
||||
#include <outline_mode.h>
|
||||
#include <gal/color4d.h> // for COLOR4D, operator!=
|
||||
#include <gbr_metadata.h>
|
||||
#include <gbr_netlist_metadata.h> // for GBR_NETLIST_METADATA
|
||||
#include <layer_ids.h> // for LSET, IsCopperLayer
|
||||
|
@ -148,18 +144,21 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
break;
|
||||
|
||||
case PAD_ATTRIB::PTH : // Pad through hole, a hole is also expected
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_COMPONENTPAD );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_COMPONENTPAD );
|
||||
break;
|
||||
|
||||
case PAD_ATTRIB::CONN: // Connector pads, no solder paste but with solder mask.
|
||||
if( plotOnExternalCopperLayer )
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONNECTORPAD );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONNECTORPAD );
|
||||
break;
|
||||
|
||||
case PAD_ATTRIB::SMD: // SMD pads (on external copper layer only)
|
||||
// with solder paste and mask
|
||||
if( plotOnExternalCopperLayer )
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_SMDPAD_CUDEF );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_SMDPAD_CUDEF );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -169,28 +168,34 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
{
|
||||
case PAD_PROP::BGA: // Only applicable to outer layers
|
||||
if( plotOnExternalCopperLayer )
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_BGAPAD_CUDEF );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_BGAPAD_CUDEF );
|
||||
break;
|
||||
|
||||
case PAD_PROP::FIDUCIAL_GLBL:
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_FIDUCIAL_GLBL );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_FIDUCIAL_GLBL );
|
||||
break;
|
||||
|
||||
case PAD_PROP::FIDUCIAL_LOCAL:
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_FIDUCIAL_LOCAL );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_FIDUCIAL_LOCAL );
|
||||
break;
|
||||
|
||||
case PAD_PROP::TESTPOINT: // Only applicable to outer layers
|
||||
if( plotOnExternalCopperLayer )
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_TESTPOINT );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_TESTPOINT );
|
||||
break;
|
||||
|
||||
case PAD_PROP::HEATSINK:
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_HEATSINKPAD );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_HEATSINKPAD );
|
||||
break;
|
||||
|
||||
case PAD_PROP::CASTELLATED:
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CASTELLATEDPAD );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CASTELLATEDPAD );
|
||||
break;
|
||||
|
||||
case PAD_PROP::NONE:
|
||||
|
@ -240,7 +245,8 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
// (i.e. for a pad at pos 0,0, rot 0.0). Needed to use aperture macros,
|
||||
// to be able to create a pattern common to all trapezoid pads having the same shape
|
||||
wxPoint coord[4];
|
||||
// Order is lower left, lower right, upper right, upper left
|
||||
|
||||
// Order is lower left, lower right, upper right, upper left.
|
||||
wxSize half_size = aPad->GetSize()/2;
|
||||
wxSize trap_delta = aPad->GetDelta()/2;
|
||||
|
||||
|
@ -265,6 +271,7 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
aPad->GetOrientation(), aPlotMode, &gbr_metadata );
|
||||
break;
|
||||
}
|
||||
|
||||
KI_FALLTHROUGH;
|
||||
|
||||
default:
|
||||
|
@ -364,6 +371,7 @@ void BRDITEMS_PLOTTER::PlotBoardGraphicItems()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void BRDITEMS_PLOTTER::PlotFootprintTextItem( const FP_TEXT* aTextMod, const COLOR4D& aColor )
|
||||
{
|
||||
COLOR4D color = aColor;
|
||||
|
@ -766,7 +774,8 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( const ZONE* aZone, const SHAPE_POLY_SET&
|
|||
// be set as conductor
|
||||
if( aZone->GetNetname().IsEmpty() )
|
||||
{
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue