|
KiCad PCB EDA Suite
|
#include <idf_parser.h>
Public Member Functions | |
| IDF3_COMPONENT (IDF3_BOARD *aParent) | |
| Set the parent object and initializes other internal parameters to default values. | |
| ~IDF3_COMPONENT () | |
| void | SetParent (IDF3_BOARD *aParent) |
| Set the parent object. | |
| IDF3::CAD_TYPE | GetCadType (void) |
| IDF3::IDF_UNIT | GetUnit (void) |
| bool | SetRefDes (const std::string &aRefDes) |
| Set the Reference Designator (RefDes) of this component. | |
| const std::string & | GetRefDes (void) |
| Retrieve the Reference Designator (RefDes) of this component. | |
| IDF_DRILL_DATA * | AddDrill (double aDia, double aXpos, double aYpos, IDF3::KEY_PLATING aPlating, const std::string &aHoleType, IDF3::KEY_OWNER aOwner) |
| Add a drill entry to the component and returns its pointer. | |
| IDF_DRILL_DATA * | AddDrill (IDF_DRILL_DATA *aDrilledHole) |
| Add the given drill entry to the component and returns the pointer to indicate success. | |
| bool | DelDrill (double aDia, double aXpos, double aYpos) |
| Delete a drill entry based on its size and location. | |
| bool | DelDrill (IDF_DRILL_DATA *aDrill) |
| Delete a drill entry based on pointer. | |
| const std::list< IDF_DRILL_DATA * > * | GetDrills (void) |
| Return the internal list of drills. | |
| bool | AddOutlineData (IDF3_COMP_OUTLINE_DATA *aComponentOutline) |
| Add the given component outline data to this component. | |
| bool | DeleteOutlineData (IDF3_COMP_OUTLINE_DATA *aComponentOutline) |
| Remove outline data based on the pointer provided. | |
| bool | DeleteOutlineData (size_t aIndex) |
| Remove outline data based on the provided index. | |
| size_t | GetOutlinesSize (void) |
| const std::list< IDF3_COMP_OUTLINE_DATA * > * | GetOutlinesData (void) |
| bool | GetPosition (double &aXpos, double &aYpos, double &aAngle, IDF3::IDF_LAYER &aLayer) |
| Retrieve the internal position parameters and returns true if the position was previously set, otherwise false. | |
| bool | SetPosition (double aXpos, double aYpos, double aAngle, IDF3::IDF_LAYER aLayer) |
| Set the internal position parameters and returns true if the position was set, false if the position was previously set. | |
| IDF3::IDF_PLACEMENT | GetPlacement (void) |
| bool | SetPlacement (IDF3::IDF_PLACEMENT aPlacementValue) |
| Set the placement value of the component subject to ownership rules. | |
| const std::string & | GetError (void) |
Private Member Functions | |
| bool | writeDrillData (std::ostream &aBoardFile) |
| Write the internal drill data to an IDFv3 .DRILLED_HOLES section. | |
| bool | writePlaceData (std::ostream &aBoardFile) |
| Write the component placement data to an IDFv3 .PLACEMENT section. | |
| bool | checkOwnership (int aSourceLine, const char *aSourceFunc) |
Private Attributes | |
| std::list< IDF3_COMP_OUTLINE_DATA * > | components |
| std::list< IDF_DRILL_DATA * > | drills |
| double | xpos |
| double | ypos |
| double | angle |
| IDF3::IDF_PLACEMENT | placement |
| IDF3::IDF_LAYER | layer |
| bool | hasPosition |
| True after SetPosition is called once. | |
| std::string | refdes |
| Reference Description (MUST BE UNIQUE) | |
| IDF3_BOARD * | parent |
| std::string | errormsg |
Friends | |
| class | IDF3_BOARD |
Definition at line 197 of file idf_parser.h.
| IDF3_COMPONENT::IDF3_COMPONENT | ( | IDF3_BOARD * | aParent | ) |
Set the parent object and initializes other internal parameters to default values.
| aParent | is the owning IDF3_BOARD object. |
Definition at line 810 of file idf_parser.cpp.
References angle, hasPosition, IDF3_BOARD, layer, IDF3::LYR_INVALID, parent, placement, IDF3::PS_INVALID, xpos, and ypos.
| IDF3_COMPONENT::~IDF3_COMPONENT | ( | ) |
Definition at line 824 of file idf_parser.cpp.
References components, and drills.
| IDF_DRILL_DATA * IDF3_COMPONENT::AddDrill | ( | double | aDia, |
| double | aXpos, | ||
| double | aYpos, | ||
| IDF3::KEY_PLATING | aPlating, | ||
| const std::string & | aHoleType, | ||
| IDF3::KEY_OWNER | aOwner ) |
Add a drill entry to the component and returns its pointer.
| aDia | diameter of the drill (mm). |
| aXpos | X position of the drill (mm). |
| aYpos | Y position of the drill (mm). |
| aPlating | plating type (PTH, NPTH). |
| aHoleType | hole class (PIN, VIA, MTG, TOOL, etc). |
| aOwner | owning CAD system (ECAD, MCAD, UNOWNED). |
Definition at line 980 of file idf_parser.cpp.
| IDF_DRILL_DATA * IDF3_COMPONENT::AddDrill | ( | IDF_DRILL_DATA * | aDrilledHole | ) |
Add the given drill entry to the component and returns the pointer to indicate success.
A return value of NULL indicates that the item was not added and it is the user's responsibility to delete the object if necessary.
| aDrilledHole | pointer to a drill entry. |
Definition at line 1002 of file idf_parser.cpp.
References IDF3::CompareToken(), drills, ERROR_IDF, IDF_DRILL_DATA::GetDrillRefDes(), and refdes.
| bool IDF3_COMPONENT::AddOutlineData | ( | IDF3_COMP_OUTLINE_DATA * | aComponentOutline | ) |
Add the given component outline data to this component.
| aComponentOutline | is a pointer to the outline data to be added. |
Definition at line 1098 of file idf_parser.cpp.
References components, and errormsg.
|
private |
Definition at line 851 of file idf_parser.cpp.
References IDF3::CAD_ELEC, IDF3::CAD_MECH, errormsg, IDF3::GetPlacementString(), parent, placement, IDF3::PS_ECAD, IDF3::PS_INVALID, IDF3::PS_MCAD, IDF3::PS_PLACED, and IDF3::PS_UNPLACED.
Referenced by DelDrill(), DelDrill(), DeleteOutlineData(), DeleteOutlineData(), SetPlacement(), SetPosition(), and SetRefDes().
| bool IDF3_COMPONENT::DelDrill | ( | double | aDia, |
| double | aXpos, | ||
| double | aYpos ) |
Delete a drill entry based on its size and location.
This operation is subject to IDF ownership rules.
| aDia | diameter (mm) of the drilled hole to be deleted. |
| aXpos | X position (mm) of the hole to be deleted. |
| aYpos | X position (mm) of the hole to be deleted. |
| if | an ownership violation occurs. |
Definition at line 1028 of file idf_parser.cpp.
References checkOwnership(), drills, and errormsg.
| bool IDF3_COMPONENT::DelDrill | ( | IDF_DRILL_DATA * | aDrill | ) |
Delete a drill entry based on pointer.
This operation is subject to IDF ownership rules.
| aDrill | the pointer associated with the drill entry to be deleted. |
| if | an ownership violation occurs. |
Definition at line 1062 of file idf_parser.cpp.
References checkOwnership(), drills, and errormsg.
| bool IDF3_COMPONENT::DeleteOutlineData | ( | IDF3_COMP_OUTLINE_DATA * | aComponentOutline | ) |
Remove outline data based on the pointer provided.
| aComponentOutline | is a pointer to be deleted from the internal list. |
Definition at line 1117 of file idf_parser.cpp.
References checkOwnership(), components, and errormsg.
| bool IDF3_COMPONENT::DeleteOutlineData | ( | size_t | aIndex | ) |
Remove outline data based on the provided index.
| aIndex | is an index to the internal outline list. |
Definition at line 1164 of file idf_parser.cpp.
References checkOwnership(), components, and errormsg.
| IDF3::CAD_TYPE IDF3_COMPONENT::GetCadType | ( | void | ) |
Definition at line 927 of file idf_parser.cpp.
References IDF3::CAD_INVALID, and parent.
| const std::list< IDF_DRILL_DATA * > * IDF3_COMPONENT::GetDrills | ( | void | ) |
Return the internal list of drills.
To avoid IDF violations, the user should not alter these entries.
Definition at line 1093 of file idf_parser.cpp.
References drills.
|
inline |
Definition at line 376 of file idf_parser.h.
References errormsg.
| const std::list< IDF3_COMP_OUTLINE_DATA * > * IDF3_COMPONENT::GetOutlinesData | ( | void | ) |
Definition at line 1208 of file idf_parser.cpp.
References components.
| size_t IDF3_COMPONENT::GetOutlinesSize | ( | void | ) |
Definition at line 1202 of file idf_parser.cpp.
References components.
| IDF3::IDF_PLACEMENT IDF3_COMPONENT::GetPlacement | ( | void | ) |
Definition at line 1279 of file idf_parser.cpp.
References placement.
Referenced by IDF3_BOARD::checkComponentOwnership().
| bool IDF3_COMPONENT::GetPosition | ( | double & | aXpos, |
| double & | aYpos, | ||
| double & | aAngle, | ||
| IDF3::IDF_LAYER & | aLayer ) |
Retrieve the internal position parameters and returns true if the position was previously set, otherwise false.
Definition at line 1214 of file idf_parser.cpp.
References angle, errormsg, hasPosition, layer, IDF3::LYR_INVALID, xpos, and ypos.
| const std::string & IDF3_COMPONENT::GetRefDes | ( | void | ) |
Retrieve the Reference Designator (RefDes) of this component.
Definition at line 974 of file idf_parser.cpp.
References refdes.
Referenced by IDF3_BOARD::AddComponent(), and IDF3_BOARD::DelComponent().
| IDF3::IDF_UNIT IDF3_COMPONENT::GetUnit | ( | void | ) |
Definition at line 935 of file idf_parser.cpp.
References parent, and IDF3::UNIT_INVALID.
Referenced by writeDrillData().
| void IDF3_COMPONENT::SetParent | ( | IDF3_BOARD * | aParent | ) |
Set the parent object.
| aParent | is the owning IDF3_BOARD object. |
Definition at line 921 of file idf_parser.cpp.
References IDF3_BOARD, and parent.
| bool IDF3_COMPONENT::SetPlacement | ( | IDF3::IDF_PLACEMENT | aPlacementValue | ) |
Set the placement value of the component subject to ownership rules.
An exception is thrown if aPlacementValue is invalid or an ownership violation occurs.
Definition at line 1285 of file idf_parser.cpp.
References checkOwnership(), errormsg, placement, and IDF3::PS_INVALID.
Referenced by IDF3_COMP_OUTLINE_DATA::readPlaceData().
| bool IDF3_COMPONENT::SetPosition | ( | double | aXpos, |
| double | aYpos, | ||
| double | aAngle, | ||
| IDF3::IDF_LAYER | aLayer ) |
Set the internal position parameters and returns true if the position was set, false if the position was previously set.
This object does not allow modification of the position once it is set since this may adversely affect the relationship with its internal objects.
| aXpos | is the X position (mm) of the component. |
| aYpos | is the Y position (mm) of the component. |
| aAngle | is the rotation of the component (degrees). |
| aLayer | is the layer on which the component is places (TOP, BOTTOM). |
Definition at line 1236 of file idf_parser.cpp.
References angle, checkOwnership(), errormsg, IDF3::GetLayerString(), hasPosition, layer, IDF3::LYR_BOTTOM, IDF3::LYR_TOP, xpos, and ypos.
Referenced by IDF3_COMP_OUTLINE_DATA::readPlaceData().
| bool IDF3_COMPONENT::SetRefDes | ( | const std::string & | aRefDes | ) |
Set the Reference Designator (RefDes) of this component.
The RefDes is shared by all outlines associated with this component.
Definition at line 943 of file idf_parser.cpp.
References checkOwnership(), IDF3::CompareToken(), errormsg, and refdes.
Referenced by IDF3_COMP_OUTLINE_DATA::readPlaceData().
|
private |
Write the internal drill data to an IDFv3 .DRILLED_HOLES section.
| aBoardFile | is an IDFv3 file opened for writing. |
Definition at line 1308 of file idf_parser.cpp.
|
private |
Write the component placement data to an IDFv3 .PLACEMENT section.
| aBoardFile | is an IDFv3 file opened for writing. |
Definition at line 1326 of file idf_parser.cpp.
References angle, components, layer, placement, refdes, xpos, and ypos.
|
friend |
Definition at line 382 of file idf_parser.h.
References IDF3_BOARD.
Referenced by IDF3_BOARD, IDF3_COMPONENT(), and SetParent().
|
private |
Definition at line 409 of file idf_parser.h.
Referenced by GetPosition(), IDF3_COMPONENT(), SetPosition(), and writePlaceData().
|
private |
Definition at line 404 of file idf_parser.h.
Referenced by AddOutlineData(), DeleteOutlineData(), DeleteOutlineData(), GetOutlinesData(), GetOutlinesSize(), writePlaceData(), and ~IDF3_COMPONENT().
|
private |
Definition at line 405 of file idf_parser.h.
Referenced by AddDrill(), AddDrill(), DelDrill(), DelDrill(), GetDrills(), writeDrillData(), and ~IDF3_COMPONENT().
|
private |
Definition at line 415 of file idf_parser.h.
Referenced by AddOutlineData(), checkOwnership(), DelDrill(), DelDrill(), DeleteOutlineData(), DeleteOutlineData(), GetError(), GetPosition(), SetPlacement(), SetPosition(), and SetRefDes().
|
private |
True after SetPosition is called once.
Definition at line 412 of file idf_parser.h.
Referenced by GetPosition(), IDF3_COMPONENT(), and SetPosition().
|
private |
Definition at line 411 of file idf_parser.h.
Referenced by GetPosition(), IDF3_COMPONENT(), SetPosition(), and writePlaceData().
|
private |
Definition at line 414 of file idf_parser.h.
Referenced by checkOwnership(), GetCadType(), GetUnit(), IDF3_COMPONENT(), and SetParent().
|
private |
Definition at line 410 of file idf_parser.h.
Referenced by checkOwnership(), GetPlacement(), IDF3_COMPONENT(), SetPlacement(), and writePlaceData().
|
private |
Reference Description (MUST BE UNIQUE)
Definition at line 413 of file idf_parser.h.
Referenced by AddDrill(), AddDrill(), GetRefDes(), SetRefDes(), and writePlaceData().
|
private |
Definition at line 407 of file idf_parser.h.
Referenced by GetPosition(), IDF3_COMPONENT(), SetPosition(), and writePlaceData().
|
private |
Definition at line 408 of file idf_parser.h.
Referenced by GetPosition(), IDF3_COMPONENT(), SetPosition(), and writePlaceData().