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 value of the control can be set by the user. 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
Link copied to clipboard
abstract val elementId: Int
Link copied to clipboard
abstract val elementName: String
Link copied to clipboard
abstract val elementType: String
Link copied to clipboard
abstract val keyName: String
Link copied to clipboard
abstract val lowerBound: Double
Link copied to clipboard
abstract val modelName: String
Link copied to clipboard
abstract val propertyName: String
Link copied to clipboard
abstract val type: ControlType
Link copied to clipboard
abstract val upperBound: Double
Link copied to clipboard
abstract var value: Double

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