![]() |
KiCad PCB EDA Suite
|
AM_PARAM holds a parameter value for an "aperture macro" as defined within standard RS274X. More...
#include <am_param.h>
Public Member Functions | |
AM_PARAM () | |
void | PushOperator (parm_item_type aType, double aValue) |
function PushOperator add an operator/operand to the current stack More... | |
void | PushOperator (parm_item_type aType, int aValue=0) |
double | GetValue (const D_CODE *aDcode) const |
bool | IsImmediate () const |
Function IsImmediate tests if this AM_PARAM holds an immediate parameter or is a pointer into a parameter held by an owning D_CODE. More... | |
unsigned | GetIndex () const |
void | SetIndex (int aIndex) |
bool | ReadParam (char *&aText) |
Function ReadParam Read one aperture macro parameter a parameter can be: a number a reference to an aperture definition parameter value: $1 ot $3 ... More... | |
Private Attributes | |
int | m_index |
std::vector< AM_PARAM_ITEM > | m_paramStack |
AM_PARAM holds a parameter value for an "aperture macro" as defined within standard RS274X.
The parameter can be a constant, i.e. "immediate" parameter, or depend on some defered values, defined in a D_CODE, by the ADD command. Note the actual value could need an evaluation from an arithmetical expression items in the expression are stored in . A simple definition is just a value stored in one item in m_paramStack
Definition at line 286 of file am_param.h.
AM_PARAM::AM_PARAM | ( | ) |
Definition at line 49 of file am_param.cpp.
References m_index.
|
inline |
Definition at line 316 of file am_param.h.
References m_index.
double AM_PARAM::GetValue | ( | const D_CODE * | aDcode | ) | const |
Definition at line 74 of file am_param.cpp.
References ADD, CLOSE_PAR, DIV, Evaluate(), Format(), AM_PARAM_ITEM::GetIndex(), APERTURE_MACRO::GetLocalParam(), D_CODE::GetMacro(), D_CODE::GetParam(), D_CODE::GetParamCount(), AM_PARAM_ITEM::GetType(), AM_PARAM_ITEM::GetValue(), D_CODE::m_Num_Dcode, m_paramStack, MUL, OPEN_PAR, PUSHPARM, PUSHVALUE, and SUB.
Referenced by APERTURE_MACRO::GetLocalParam().
bool AM_PARAM::IsImmediate | ( | ) | const |
Function IsImmediate tests if this AM_PARAM holds an immediate parameter or is a pointer into a parameter held by an owning D_CODE.
Function IsImmediate tests if this AM_PARAM holds an immediate parameter or has parameter held by an owning D_CODE.
Definition at line 59 of file am_param.cpp.
References m_paramStack.
void AM_PARAM::PushOperator | ( | parm_item_type | aType, |
double | aValue | ||
) |
function PushOperator add an operator/operand to the current stack
add an operator/operand to the current stack aType = NOP, PUSHVALUE, PUSHPARM, ADD, SUB, MUL, DIV, EQUATE aValue required only for PUSHVALUE (double) or PUSHPARM (int) aType.
aType | = the type of item (NOP, PUSHVALUE, PUSHPARM, ADD, SUB, MUL, DIV, EQUATE) |
aValue | = the item value, double for PUSHVALUE or int for PUSHPARM type. |
Definition at line 152 of file am_param.cpp.
References m_paramStack.
Referenced by ReadParam().
void AM_PARAM::PushOperator | ( | parm_item_type | aType, |
int | aValue = 0 |
||
) |
Definition at line 158 of file am_param.cpp.
References m_paramStack.
bool AM_PARAM::ReadParam | ( | char *& | aText | ) |
Function ReadParam Read one aperture macro parameter a parameter can be: a number a reference to an aperture definition parameter value: $1 ot $3 ...
a parameter definition can be complex and have operators between numbers and/or other parameter like $1+3 or $2x2.. Parameters are separated by a comma ( of finish by *)
aText | = pointer to the parameter to read. Will be modified to point to the next field |
a parameter definition can be complex and have operators between numbers and/or other parameter like $1+3 or $2x2.. Note minus sign is not always an operator. It can be the sign of a value. Parameters are separated by a comma ( of finish by *)
aText | = pointer to the parameter to read. Will be modified to point to the next field |
Definition at line 177 of file am_param.cpp.
References ADD, CLOSE_PAR, DIV, KI_FALLTHROUGH, m_index, m_paramStack, MUL, OPEN_PAR, PushOperator(), PUSHPARM, PUSHVALUE, ReadDouble(), ReadInt(), SetIndex(), and SUB.
Referenced by GERBER_FILE_IMAGE::ReadApertureMacro().
|
inline |
|
private |
Definition at line 289 of file am_param.h.
Referenced by AM_PARAM(), GetIndex(), ReadParam(), and SetIndex().
|
private |
Definition at line 290 of file am_param.h.
Referenced by GetValue(), IsImmediate(), PushOperator(), and ReadParam().