KiCad PCB EDA Suite
Loading...
Searching...
No Matches
IDF_DRILL_DATA Class Reference

A drilled hole. More...

#include <idf_common.h>

Public Member Functions

 IDF_DRILL_DATA ()
 Create an empty drill entry which can be populated by the read() function.
 
 IDF_DRILL_DATA (double aDrillDia, double aPosX, double aPosY, IDF3::KEY_PLATING aPlating, const std::string &aRefDes, const std::string &aHoleType, IDF3::KEY_OWNER aOwner)
 Create a drill entry with information compliant with the IDFv3 specifications.
 
bool Matches (double aDrillDia, double aPosX, double aPosY) const
 Return true if the given drill diameter and location matches the diameter and location of this IDF_DRILL_DATA object.
 
double GetDrillDia () const
 
double GetDrillXPos () const
 
double GetDrillYPos () const
 
IDF3::KEY_PLATING GetDrillPlating ()
 
const std::string & GetDrillRefDes ()
 
const std::string & GetDrillHoleType ()
 
IDF3::KEY_OWNER GetDrillOwner () const
 

Private Member Functions

bool read (std::istream &aBoardFile, IDF3::IDF_UNIT aBoardUnit, IDF3::FILE_STATE aBoardState, IDF3::IDF_VERSION aIdfVersion)
 Read a drill entry from an IDFv3 file.
 
void write (std::ostream &aBoardFile, IDF3::IDF_UNIT aBoardUnit)
 Write a single line representing a hole within a .DRILLED_HOLES section.
 

Private Attributes

double dia
 
double x
 
double y
 
IDF3::KEY_PLATING plating
 
IDF3::KEY_REFDES kref
 
IDF3::KEY_HOLETYPE khole
 
std::string refdes
 
std::string holetype
 
IDF3::KEY_OWNER owner
 

Friends

class IDF3_BOARD
 
class IDF3_COMPONENT
 

Detailed Description

A drilled hole.

Responsible for writing this information to a file in compliance with the IDFv3 specification.

Definition at line 311 of file idf_common.h.

Constructor & Destructor Documentation

◆ IDF_DRILL_DATA() [1/2]

IDF_DRILL_DATA::IDF_DRILL_DATA ( )

Create an empty drill entry which can be populated by the read() function.

Definition at line 320 of file idf_common.cpp.

References dia, khole, kref, IDF3::MTG, IDF3::NOREFDES, IDF3::NPTH, owner, plating, IDF3::UNOWNED, x, and y.

◆ IDF_DRILL_DATA() [2/2]

IDF_DRILL_DATA::IDF_DRILL_DATA ( double aDrillDia,
double aPosX,
double aPosY,
IDF3::KEY_PLATING aPlating,
const std::string & aRefDes,
const std::string & aHoleType,
IDF3::KEY_OWNER aOwner )

Create a drill entry with information compliant with the IDFv3 specifications.

Parameters
aDrillDiais the drill diameter.
aPosXis the X coordinate of the drill center.
aPosYis the Y coordinate of the drill center.
aPlatingis a plating flag, PTH or NPTH.
aRefDesis the component Reference Designator.
aHoleTypeis the type of hole.
aOwneris one of MCAD, ECAD, UNOWNED.

Definition at line 332 of file idf_common.cpp.

References IDF3::BOARD, dia, holetype, khole, kref, IDF3::MTG, IDF3::NOREFDES, IDF3::OTHER, owner, IDF3::PANEL, IDF3::PIN, plating, IDF3::REFDES, refdes, IDF3::TOOL, IDF3::VIA, x, and y.

Member Function Documentation

◆ GetDrillDia()

double IDF_DRILL_DATA::GetDrillDia ( ) const
Returns
the drill diameter in mm.

Definition at line 743 of file idf_common.cpp.

References dia.

◆ GetDrillHoleType()

const std::string & IDF_DRILL_DATA::GetDrillHoleType ( )
Returns
the classification of the hole; this may be one of PIN, VIA, MTG, TOOL, or a user-specified string.

Definition at line 781 of file idf_common.cpp.

References holetype, khole, IDF3::OTHER, IDF3::PIN, IDF3::TOOL, and IDF3::VIA.

◆ GetDrillOwner()

IDF3::KEY_OWNER IDF_DRILL_DATA::GetDrillOwner ( ) const
inline

Definition at line 379 of file idf_common.h.

References owner.

◆ GetDrillPlating()

IDF3::KEY_PLATING IDF_DRILL_DATA::GetDrillPlating ( )
Returns
the plating value (PTH, NPTH).

Definition at line 761 of file idf_common.cpp.

References plating.

◆ GetDrillRefDes()

const std::string & IDF_DRILL_DATA::GetDrillRefDes ( )
Returns
the reference designator of the hole; this may be a component reference designator, BOARD, or NOREFDES as per IDFv3.

Definition at line 767 of file idf_common.cpp.

References IDF3::BOARD, kref, IDF3::PANEL, IDF3::REFDES, and refdes.

Referenced by IDF3_BOARD::addCompDrill(), IDF3_BOARD::AddDrill(), and IDF3_COMPONENT::AddDrill().

◆ GetDrillXPos()

double IDF_DRILL_DATA::GetDrillXPos ( ) const
Returns
the drill's X position in mm.

Definition at line 749 of file idf_common.cpp.

References x.

◆ GetDrillYPos()

double IDF_DRILL_DATA::GetDrillYPos ( ) const
Returns
the drill's Y position in mm.

Definition at line 755 of file idf_common.cpp.

References y.

◆ Matches()

bool IDF_DRILL_DATA::Matches ( double aDrillDia,
double aPosX,
double aPosY ) const

Return true if the given drill diameter and location matches the diameter and location of this IDF_DRILL_DATA object.

Parameters
aDrillDiais the drill diameter (mm).
aPosXis the X position (mm) of the drilled hole.
aPosYis the Y position (mm) of the drilled hole.
Returns
true if the diameter and position match this object.

Definition at line 389 of file idf_common.cpp.

References dia, IDF_POINT::Matches(), x, IDF_POINT::x, y, and IDF_POINT::y.

◆ read()

bool IDF_DRILL_DATA::read ( std::istream & aBoardFile,
IDF3::IDF_UNIT aBoardUnit,
IDF3::FILE_STATE aBoardState,
IDF3::IDF_VERSION aIdfVersion )
private

Read a drill entry from an IDFv3 file.

Parameters
aBoardFileis an open IDFv3 file; the file position must be within the DRILLED_HOLES section.
aBoardUnitis the board file's native unit (MM or THOU).
aBoardStateis the state value of the parser.
Returns
true if data was successfully read, otherwise false.
Exceptions
incase of an unrecoverable error.

Definition at line 406 of file idf_common.cpp.

References IDF3::BOARD, IDF3::CompareToken(), dia, IDF3::FetchIDFLine(), IDF3::GetIDFString(), holetype, IDF_MIN_DIA_MM, IDF_MIN_DIA_THOU, IDF_MIN_DIA_TNM, IDF_THOU_TO_MM, IDF_TNM_TO_MM, IDF3::IDF_V2, khole, kref, IDF3::MTG, IDF3::NOREFDES, IDF3::NPTH, IDF3::OTHER, owner, IDF3::PANEL, IDF3::ParseOwner(), IDF3::PIN, plating, IDF3::PTH, IDF3::REFDES, refdes, IDF3::TOOL, IDF3::UNIT_MM, IDF3::UNIT_THOU, IDF3::UNIT_TNM, IDF3::UNOWNED, IDF3::VIA, x, and y.

Referenced by IDF3_COMPONENT, and IDF3_BOARD::readBrdDrills().

◆ write()

void IDF_DRILL_DATA::write ( std::ostream & aBoardFile,
IDF3::IDF_UNIT aBoardUnit )
private

Write a single line representing a hole within a .DRILLED_HOLES section.

Parameters
aBoardFileis an open BOARD file
aBoardUnitis the native unit of the output file
Exceptions
incase of an unrecoverable error.

Definition at line 690 of file idf_common.cpp.

References IDF3::BOARD, dia, IDF3::ECAD, holetype, IDF_THOU_TO_MM, khole, kref, IDF3::MCAD, IDF3::OTHER, owner, IDF3::PANEL, IDF3::PIN, plating, IDF3::PTH, IDF3::REFDES, refdes, IDF3::TOOL, IDF3::UNIT_MM, IDF3::VIA, x, and y.

Referenced by IDF3_COMPONENT.

Friends And Related Symbol Documentation

◆ IDF3_BOARD

friend class IDF3_BOARD
friend

Definition at line 385 of file idf_common.h.

References IDF3_BOARD.

Referenced by IDF3_BOARD.

◆ IDF3_COMPONENT

friend class IDF3_COMPONENT
friend

Definition at line 386 of file idf_common.h.

References IDF3_COMPONENT, read(), and write().

Referenced by IDF3_COMPONENT.

Member Data Documentation

◆ dia

double IDF_DRILL_DATA::dia
private

Definition at line 410 of file idf_common.h.

Referenced by GetDrillDia(), IDF_DRILL_DATA(), IDF_DRILL_DATA(), Matches(), read(), and write().

◆ holetype

std::string IDF_DRILL_DATA::holetype
private

Definition at line 417 of file idf_common.h.

Referenced by GetDrillHoleType(), IDF_DRILL_DATA(), read(), and write().

◆ khole

IDF3::KEY_HOLETYPE IDF_DRILL_DATA::khole
private

Definition at line 415 of file idf_common.h.

Referenced by GetDrillHoleType(), IDF_DRILL_DATA(), IDF_DRILL_DATA(), read(), and write().

◆ kref

IDF3::KEY_REFDES IDF_DRILL_DATA::kref
private

Definition at line 414 of file idf_common.h.

Referenced by GetDrillRefDes(), IDF_DRILL_DATA(), IDF_DRILL_DATA(), read(), and write().

◆ owner

IDF3::KEY_OWNER IDF_DRILL_DATA::owner
private

Definition at line 418 of file idf_common.h.

Referenced by GetDrillOwner(), IDF_DRILL_DATA(), IDF_DRILL_DATA(), read(), and write().

◆ plating

IDF3::KEY_PLATING IDF_DRILL_DATA::plating
private

Definition at line 413 of file idf_common.h.

Referenced by GetDrillPlating(), IDF_DRILL_DATA(), IDF_DRILL_DATA(), read(), and write().

◆ refdes

std::string IDF_DRILL_DATA::refdes
private

Definition at line 416 of file idf_common.h.

Referenced by GetDrillRefDes(), IDF_DRILL_DATA(), read(), and write().

◆ x

double IDF_DRILL_DATA::x
private

Definition at line 411 of file idf_common.h.

Referenced by GetDrillXPos(), IDF_DRILL_DATA(), IDF_DRILL_DATA(), Matches(), read(), and write().

◆ y

double IDF_DRILL_DATA::y
private

Definition at line 412 of file idf_common.h.

Referenced by GetDrillYPos(), IDF_DRILL_DATA(), IDF_DRILL_DATA(), Matches(), read(), and write().


The documentation for this class was generated from the following files: