ControlIfc

interface ControlIfc

A control represents an element within a model that can be changed by the user. Every control has a type (DOUBLE, INTEGER, LONG, FLOAT, SHORT, BYTE, BOOLEAN). The user can set the value of the control. If the supplied value is not within the allowed range of the control, the value will be limited to within the range. If the user assigns the value of the control to less than the lower bound, then the value is set to the lower bound. If the user assigns the value greater than the upper bound, then the value is set at the upper bound. For example, suppose the lower bound of the control is 1.0 and the upper bound is 10.0. Setting the control value to 0.0 will set the control to 1.0. Setting the control value to 12.0 will set the control to 10.0. Thus, out-of-range values are not permitted and corrected (silently). The limitToRange() function can be used to inspect the value that will result if the control is set to the supplied value.

Properties

Link copied to clipboard
abstract val comment: String

The comment string that was supplied in the control annotation.

Link copied to clipboard
abstract val elementId: Int

The model element identifier for the model element that has the control.

Link copied to clipboard
abstract val elementName: String

The name of the model element that has the control.

Link copied to clipboard
abstract val elementType: String

The simple class name associated with the model element that has the control.

Link copied to clipboard
abstract val keyName: String

The unique name for accessing the control. This is the string "

${elementName}.$

{propertyName}"

Link copied to clipboard
abstract val lowerBound: Double

The lower bound allowed for the value of the control.

Link copied to clipboard
abstract val modelName: String

The name of the model that holds the element associated with the control.

Link copied to clipboard
abstract val propertyName: String

The name of the property that was annotated as a control.

Link copied to clipboard
abstract val type: ControlType

The type of the control (DOUBLE, INTEGER, LONG, FLOAT, SHORT, BYTE, BOOLEAN)

Link copied to clipboard
abstract val upperBound: Double

The upper bound allowed for the value of the control.

Link copied to clipboard
abstract var value: Double

The current value of the control.

Functions

Link copied to clipboard
open fun limitToRange(value: Double): Double

Ensures that the supplied double is within the bounds associated with the control. This function does not change the state of the control.

Returns an array that has been mapped to legal values for the control

Link copied to clipboard
open fun withinRange(value: Double): Boolean

Checks if the supplied value is within lowerBound, upperBound