WSF
WsfGuidanceComputer::Variable Class Reference

#include <WsfGuidanceComputer.hpp>

Public Member Functions

 Variable (double aValue=0.0)

Operator overloading.

Allows the variable to be used as a normal variable.

Note
: This manipulates the constant value. If the variable references a script variable then the
double mValue
double mScale
 The scale factor used to convert from user supplied units to internal units.
WsfStringId mVarNameId
 operator double () const
double operator+ (double aRhs) const
double operator- (double aRhs) const
double operator= (double aRhs)
double Get () const
bool HasDefaultValue () const
bool IsReference () const
 Returns true if the variable is a script reference.
void ReadValue (UtInput &aInput, WsfScriptContext &aContext)
void ReadValueOfType (UtInput &aInput, UtInput::ValueType aValueType, WsfScriptContext &aContext)
void Update (WsfScriptContext &aContext)
void ValueInClosedRange (UtInput &aInput, double aMinValue, double aMaxValue)
 Interface to UtInput::ValueInClosedRange.
void ValueGreater (UtInput &aInput, double aMinValue)
 Interface to UtInput::ValueGreater.
void ValueGreaterOrEqual (UtInput &aInput, double aMinValue)
 Interface to UtInput::ValueGreaterOrEqual.
void ValueLess (UtInput &aInput, double aMaxValue)
 Interface to UtInput::ValueLess.
void ValueLessOrEqual (UtInput &aInput, double aMaxValue)
 Interface to UtInput::ValueLessOrEqual.

Detailed Description

A class that defines a double precision value that can be either:

  • a constant
  • a reference to a script variable.
    Note
    This class was the predecessor to WsfVariable. We cannot change to use WsfVariable because:
  • The input syntax is slightly different.
  • This version supports continuous reevaluation of the script variable.
  • This only support variables of type double.
    Note
    This class is public because it is (or eventually be) used by WsfGuidanceProgram.

Constructor & Destructor Documentation

◆ Variable()

WsfGuidanceComputer::Variable::Variable ( double aValue = 0.0)
inline

References mScale, mValue, and mVarNameId.

Member Function Documentation

◆ Get()

double WsfGuidanceComputer::Variable::Get ( ) const
inline

References mValue.

◆ HasDefaultValue()

bool WsfGuidanceComputer::Variable::HasDefaultValue ( ) const
inline

◆ IsReference()

bool WsfGuidanceComputer::Variable::IsReference ( ) const
inline

Returns true if the variable is a script reference.

References mVarNameId.

Referenced by ValueGreater(), ValueGreaterOrEqual(), ValueInClosedRange(), ValueLess(), and ValueLessOrEqual().

◆ operator double()

WsfGuidanceComputer::Variable::operator double ( ) const
inline

References mValue.

◆ operator+()

double WsfGuidanceComputer::Variable::operator+ ( double aRhs) const
inline

References mValue.

◆ operator-()

double WsfGuidanceComputer::Variable::operator- ( double aRhs) const
inline

References mValue.

◆ operator=()

double WsfGuidanceComputer::Variable::operator= ( double aRhs)
inline

References mScale, mValue, and mVarNameId.

◆ ReadValue()

void WsfGuidanceComputer::Variable::ReadValue ( UtInput & aInput,
WsfScriptContext & aContext )

Read a unitless value.

Parameters
aInputThe input stream.
aContextThe script context for resolving a script variable.

References WsfScriptContext::GetContext(), mScale, mValue, and mVarNameId.

◆ ReadValueOfType()

void WsfGuidanceComputer::Variable::ReadValueOfType ( UtInput & aInput,
UtInput::ValueType aValueType,
WsfScriptContext & aContext )

Read a value with units

Parameters
aInputThe input stream.
aValueTypeThe unit type of the parameter.
aContextThe script context for resolving a script variable.

References WsfScriptContext::GetContext(), mScale, mValue, and mVarNameId.

Referenced by WsfGuidanceComputer::Phase::ProcessNextPhase().

◆ Update()

void WsfGuidanceComputer::Variable::Update ( WsfScriptContext & aContext)

Update the value of the variable if it a script reference

Parameters
aContextThe script context for resolving a script variable.

References WsfScriptContext::GetContext(), mScale, mValue, and mVarNameId.

Referenced by WsfGuidanceComputer::CheckForPhaseChange().

◆ ValueGreater()

void WsfGuidanceComputer::Variable::ValueGreater ( UtInput & aInput,
double aMinValue )

Interface to UtInput::ValueGreater.

References HasDefaultValue(), IsReference(), and mValue.

Referenced by WsfGuidanceComputer::Phase::ProcessNextPhase().

◆ ValueGreaterOrEqual()

void WsfGuidanceComputer::Variable::ValueGreaterOrEqual ( UtInput & aInput,
double aMinValue )

Interface to UtInput::ValueGreaterOrEqual.

References HasDefaultValue(), IsReference(), and mValue.

Referenced by WsfGuidanceComputer::Phase::ProcessNextPhase().

◆ ValueInClosedRange()

void WsfGuidanceComputer::Variable::ValueInClosedRange ( UtInput & aInput,
double aMinValue,
double aMaxValue )

Interface to UtInput::ValueInClosedRange.

References HasDefaultValue(), IsReference(), and mValue.

◆ ValueLess()

void WsfGuidanceComputer::Variable::ValueLess ( UtInput & aInput,
double aMaxValue )

Interface to UtInput::ValueLess.

References HasDefaultValue(), IsReference(), and mValue.

Referenced by WsfGuidanceComputer::Phase::ProcessNextPhase().

◆ ValueLessOrEqual()

void WsfGuidanceComputer::Variable::ValueLessOrEqual ( UtInput & aInput,
double aMaxValue )

Interface to UtInput::ValueLessOrEqual.

References HasDefaultValue(), IsReference(), and mValue.

Member Data Documentation

◆ mScale

double WsfGuidanceComputer::Variable::mScale

The scale factor used to convert from user supplied units to internal units.

Referenced by operator=(), ReadValue(), ReadValueOfType(), Update(), and Variable().

◆ mValue

double WsfGuidanceComputer::Variable::mValue

The current value. This will be the constant value if mVarNameId.IsNull() or the last value resolved from a script reference.

Referenced by Get(), operator double(), operator+(), operator-(), operator=(), ReadValue(), ReadValueOfType(), Update(), ValueGreater(), ValueGreaterOrEqual(), ValueInClosedRange(), ValueLess(), ValueLessOrEqual(), and Variable().

◆ mVarNameId

WsfStringId WsfGuidanceComputer::Variable::mVarNameId

The name of the script variable from which the value is to be gotten. If IsNull() then use the constant value in mValue.

Referenced by IsReference(), operator=(), ReadValue(), ReadValueOfType(), Update(), and Variable().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved