NDEVR
API Documentation
Formula

Logic for storing the definition of a formula, that can be displayed to the end-user. More...

Collaboration diagram for Formula:
[legend]

Public Member Functions

Buffer< StringdependentVariables () const
 Retrieves the list of variable names this formula depends on.
String displayFormula (bool simplify) const
 Produces a display-ready version of the formula string.
Equation< fltp08equation () const
 Converts the formula into an evaluatable Equation object.
String simplifiedFormula () const
 Produces a simplified version of the formula string.
fltp08 solve () const
 Evaluates the formula and returns the numeric result.

Static Public Member Functions

static String DisplayString (const String &name)
 Formats a variable name for user-facing display.

Public Attributes

String category
 The category grouping this formula belongs to.
Dictionary< String, Stringdependent_variables
 A mapping of variable names to their current value strings.
String description
 A textual description of what the formula computes.
String formula
 The raw formula expression string.
TranslatedString name
 The user-facing display name of the formula.
ConstPointer< Unitresult_unit
 The specific unit of the formula result.
UnitCategory result_unit_type = UnitCategory::e_undefined_unit
 The unit category of the formula result.
String symbol
 The shorthand symbol representing the formula result.

Detailed Description

Logic for storing the definition of a formula, that can be displayed to the end-user.


Definition at line 11 of file Formula.h.

Member Function Documentation

◆ dependentVariables()

Buffer< String > Formula::dependentVariables ( ) const

Retrieves the list of variable names this formula depends on.

Returns
A Buffer of dependent variable name strings.

◆ displayFormula()

String Formula::displayFormula ( bool simplify) const

Produces a display-ready version of the formula string.

Parameters
[in]simplifyWhether to return a simplified form of the formula.
Returns
The formula string formatted for display.

◆ DisplayString()

String Formula::DisplayString ( const String & name)
static

Formats a variable name for user-facing display.

Parameters
[in]nameThe raw variable name to format.
Returns
A display-friendly version of the name.

References name.

◆ equation()

Equation< fltp08 > Formula::equation ( ) const

Converts the formula into an evaluatable Equation object.

Returns
An Equation of fltp08 representing this formula.

◆ simplifiedFormula()

String Formula::simplifiedFormula ( ) const

Produces a simplified version of the formula string.

Returns
The simplified formula expression.

◆ solve()

fltp08 Formula::solve ( ) const

Evaluates the formula and returns the numeric result.

Returns
The computed fltp08 result of the formula.

The documentation for this struct was generated from the following file: