KiCad PCB EDA Suite
|
Hold 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) |
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 |
Test 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) |
Read one aperture macro parameter. More... | |
Private Attributes | |
int | m_index |
has meaning to define parameter local to an aperture macro More... | |
std::vector< AM_PARAM_ITEM > | m_paramStack |
List of operands/operators to evaluate the actual value if a par def is $3/2, there are 3 items in stack: 3 (type PUSHPARM) , / (type DIV), 2 (type PUSHVALUE). More... | |
Hold 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 deferred 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 284 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 309 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 |
Test 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 | ||
) |
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 | is the type of item (NOP, PUSHVALUE, PUSHPARM, ADD, SUB, MUL, DIV, EQUATE) |
aValue | is 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 | ) |
Read one aperture macro parameter.
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.
a parameter can be: a number a reference to an aperture definition parameter value: $1 to $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 |
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 |
has meaning to define parameter local to an aperture macro
Definition at line 335 of file am_param.h.
Referenced by AM_PARAM(), GetIndex(), ReadParam(), and SetIndex().
|
private |
List of operands/operators to evaluate the actual value if a par def is $3/2, there are 3 items in stack: 3 (type PUSHPARM) , / (type DIV), 2 (type PUSHVALUE).
Definition at line 336 of file am_param.h.
Referenced by GetValue(), IsImmediate(), PushOperator(), and ReadParam().