Expand description
NumericInput: a number an operation is given — a length, an angle, a
count — typed into a dialog’s number field as a plain value or as a
formula of the program’s parameters, which it follows (evaluate).
An operation’s arguments take one wherever they take a number. (How a
dialog shows one, the editor says.)
A step resolves it where it builds (NumericInput::resolve), reading each
parameter the formula names — a target the program defines
(parameter): the read is recorded, so a change to one of them
rebuilds the step, a change to any other does not.
Structs§
- Parameter
Values - Every parameter of the part, by name, in the order the steps defining them define them, as each comes to: what lists or designates the part reads. A parameter that failed is left out.
Enums§
- Numeric
Input - A number an operation is given: a plain value, or a formula of the
program’s parameters that it follows. Saved as a number when plain, and
as
{"formula": "width / 2"}otherwise. - Parameter
Value - What a parameter of the program comes to, as its target holds it
(
parameter): a number, or a text — the row of a table a part family is looked up in, by name.
Constants§
- FUNCTION_
NAMES - The functions a formula can call, by name. Angles are in degrees, as everywhere a designer types one.
Functions§
- evaluate
- The value of the formula
expression, withlookupthe value of each parameter it names: numbers,+ - * / ^, parentheses,pi, and the functions ofFUNCTION_NAMES, with angles in degrees — and, last, one comparison of two of those,< <= > >= == !=, 1 where it holds and 0 where not: what says whether a step runs,length > 40(crate::program::ProgramStep::active). Fails for anything else, for a namelookupdoes not know, and for a value that is no finite number. - names_
in - The names of parameters
expressionreads, in order, each once. - parameter
- The target of the parameter
name:width, orsize.dfor the columndof the row a table looks up by the parametersize. - parameter_
values - The target of every parameter of the part, as they come to.
- read_
parameter - The number
namestands for in a formula, asreaderreads it, the read recorded: a number parameter’s value —width, orsize.d, a column of the row a table looked up. None where no step defines that parameter, or it failed, or it is no number. - read_
parameter_ values - Every parameter of the part
readerreads, as they come to: none, for a part whose program defines none.