65 return aMarkerDiameter / 10;
107 plotter = hpgl_plotter;
124 wxSize pageSizeIU = pageA4.GetSizeIU();
130 double Xscale = double( pageSizeIU.x - ( 2 * margin ) ) / bbbox.
GetWidth();
134 int ypagesize_for_board =
KiROUND( pageSizeIU.y * 0.6 );
135 double Yscale = double( ypagesize_for_board - margin ) / bbbox.
GetHeight();
137 scale = std::min( Xscale, Yscale );
145 offset.y =
KiROUND(
double( bbbox.
Centre().y ) - ( ypagesize_for_board / 2.0 ) /
scale );
150 bottom_limit = ( pageSizeIU.y - margin ) / std::min(
scale, 1.0 );
173 plotter = dxf_plotter;
188 if( !plotter->
OpenFile( aFullFileName ) )
202 switch( PtStruct->Type() )
223 int plotX, plotY, TextWidth;
243 double charScale = std::min( 1.0, 1.0 /
scale );
245 TextWidth =
KiROUND( ( charSize * charScale ) / 10.0 );
246 intervalle =
KiROUND( charSize * charScale ) + TextWidth;
249 plotX =
KiROUND( bbbox.
GetX() + textmarginaftersymbol * charScale );
253 wxString Text = wxT(
"Drill Map:" );
254 plotter->
Text( wxPoint( plotX, plotY ), COLOR4D::UNSPECIFIED, Text, 0,
255 wxSize(
KiROUND( charSize * charScale ),
KiROUND( charSize * charScale ) ),
261 int max_line_len = 0;
273 if( bottom_limit && ( plotY+intervalle > bottom_limit ) )
283 plot_diam = std::min( plot_diam,
KiROUND( charSize * charScale ) );
284 int x =
KiROUND( plotX - textmarginaftersymbol * charScale - plot_diam / 2.0 );
285 int y =
KiROUND( plotY + charSize * charScale );
288 plotter->
Marker( wxPoint( x, y ), plot_diam, ii );
299 sprintf( line,
"(1 hole)" );
301 sprintf( line,
"(1 slot)" );
305 sprintf( line,
"(%d holes + 1 slot)", tool.
m_TotalCount - 1 );
313 msg += wxT(
" (not plated)" );
315 plotter->
Text( wxPoint( plotX, y ), COLOR4D::UNSPECIFIED, msg, 0,
316 wxSize(
KiROUND( charSize * charScale ),
KiROUND( charSize * charScale ) ),
319 intervalle =
KiROUND( ( ( charSize * charScale ) + TextWidth ) * 1.2 );
321 if( intervalle < ( plot_diam + ( 1 *
IU_PER_MM /
scale ) + TextWidth ) )
326 int text_len = msg.Len() * ( ( charSize * charScale ) + TextWidth );
327 max_line_len = std::max( max_line_len, text_len + plot_diam );
341 static const char separator[] =
342 " =============================================================\n";
346 unsigned totalHoleCount;
351 out.
Print( 0,
"Drill report for %s\n",
TO_UTF8( brdFilename.GetFullName() ) );
355 out.
Print( 0,
"Copper Layer Stackup:\n" );
356 out.
Print( 0, separator );
360 int conventional_layer_num = 1;
362 for(
LSEQ seq = cu.
Seq(); seq; ++seq, ++conventional_layer_num )
364 out.
Print( 0,
" L%-2d: %-25s %s\n",
365 conventional_layer_num,
370 out.
Print( 0,
"\n\n" );
378 bool buildNPTHlist =
false;
381 for(
unsigned pair_ndx = 0; pair_ndx < hole_sets.size(); ++pair_ndx )
389 out.
Print( 0,
"Drill file '%s' contains\n",
392 out.
Print( 0,
" plated through holes:\n" );
393 out.
Print( 0, separator );
395 out.
Print( 0,
" Total plated holes count %u\n", totalHoleCount );
399 out.
Print( 0,
"Drill file '%s' contains\n",
402 out.
Print( 0,
" holes connecting layer pair: '%s and %s' (%s vias):\n",
405 pair.first ==
F_Cu || pair.second ==
B_Cu ?
"blind" :
"buried" );
407 out.
Print( 0, separator );
409 out.
Print( 0,
" Total plated holes count %u\n", totalHoleCount );
412 out.
Print( 0,
"\n\n" );
418 buildNPTHlist =
true;
424 out.
Print( 0,
"Not plated through holes are merged with plated holes\n" );
426 out.
Print( 0,
"Drill file '%s' contains\n",
430 out.
Print( 0,
" unplated through holes:\n" );
431 out.
Print( 0, separator );
433 out.
Print( 0,
" Total unplated holes count %u\n", totalHoleCount );
470 unsigned totalHoleCount = 0;
483 int tool_number = ii+1;
484 out.
Print( 0,
" T%d %2.3fmm %2.4f\" ", tool_number,
490 out.
Print( 0,
"(1 hole)\n" );
492 out.
Print( 0,
"(1 hole) (with 1 slot)\n" );
503 out.
Print( 0,
"\n" );
505 return totalHoleCount;
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
double diameter_in_inches(double ius)
unsigned printToolSummary(OUTPUTFORMATTER &aOut, bool aSummaryNPTH) const
Print m_toolListBuffer[] tools to aOut and returns total hole count.
virtual const wxString getDrillFileName(DRILL_LAYER_PAIR aPair, bool aNPTH, bool aMerge_PTH_NPTH) const
double diameter_in_mm(double ius)
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
virtual void SetCreator(const wxString &aCreator)
class PCB_DIM_LEADER, a leader dimension (graphic item)
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
virtual bool StartPlot()=0
This file is part of the common library.
static constexpr double IU_PER_MM
Mock up a conversion function.
const EDA_RECT GetBoardEdgesBoundingBox() const
Return the board bounding box calculated using exclusively the board edges (graphics on Edge....
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
class PCB_DIM_CENTER, a center point marking (graphic item)
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
int getMarkerBestPenSize(int aMarkerDiameter)
virtual void FlashPadOval(const wxPoint &aPadPos, const wxSize &aSize, double aPadOrient, OUTLINE_MODE aTraceMode, void *aData)=0
void SetRenderSettings(RENDER_SETTINGS *aSettings)
class PCB_TEXT, text on a layer
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
void PlotPcbText(const PCB_TEXT *aText)
int GetHPGLPenSpeed() const
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
void SetUnits(DXF_UNITS aUnit)
Set the units to use for plotting the DXF file.
std::vector< DRILL_LAYER_PAIR > getUniqueLayerPairs() const
Get unique layer pairs by examining the micro and blind_buried vias.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
const wxString & GetFileName() const
virtual void SetGerberCoordinatesFormat(int aResolution, bool aUseInches=false)
This file contains miscellaneous commonly used macros and functions.
Board plot function definition file.
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
PCB specific render settings.
std::vector< DRILL_TOOL > m_toolListBuffer
LSET is a set of PCB_LAYER_IDs.
bool GenDrillReportFile(const wxString &aFullFileName)
Create a plain text report file giving a list of drill values and drill count for through holes,...
void SetLayerSet(LSET aLayerMask)
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
PLOT_FORMAT
The set of supported output plot formats.
Describe the page size and margins of a paper page on which to eventually print or plot.
virtual void SetPenSpeed(int speed)
helper classes to handle hole info for drill files generators.
Handle hole which must be drilled (diameter, position and layers).
wxPoint GetOffset()
Return the plot offset (usually the position of the drill/place origin).
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > DRILL_LAYER_PAIR
Parameters and options when plotting/printing a board.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror)=0
Set the plot offset and scaling for the current plot.
class PCB_TARGET, a target (graphic item)
void buildHolesList(DRILL_LAYER_PAIR aLayerPair, bool aGenerateNPTH_list)
Create the list of holes and tools for a given board.
void Marker(const wxPoint &position, int diametre, unsigned aShapeId)
Draw a pattern shape number aShapeId, to coord position.
Plotting engines similar to ps (PostScript, Gerber, svg)
int GetHPGLPenNum() const
Base plotter engine class.
class PCB_MARKER, a marker used to show something
const std::string layerName(PCB_LAYER_ID aLayer) const
void PlotPcbShape(const PCB_SHAPE *aShape)
virtual void SetPenNumber(int number)
Handle the component boundary box.
bool genDrillMapFile(const wxString &aFullFileName, PLOT_FORMAT aFormat)
Plot a map of drill marks for holes.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
bool plotDrillMarks(PLOTTER *aPlotter)
Write the drill marks in HPGL, POSTSCRIPT or other supported formats/.
virtual void Text(const wxPoint &aPos, const COLOR4D &aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=nullptr)
Draw text with the plotter.
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
void SetDefaultPenWidth(int aWidth)
class PCB_SHAPE, a segment not on copper layers
static constexpr int Millimeter2iu(double mm)
std::vector< HOLE_INFO > m_holeListBuffer
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
const PAGE_INFO * m_pageInfo
PCB_LAYER_ID ToLAYER_ID(int aLayer)
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)