Interface Component: PortTime ()

Description:

This port defines a floating point value like PortFloatSlider. However, the value is typically interpreted as a time value. It can be automatically animated in forward or backward direction, or it can be synchronized with any other object providing a time port, for example, a global Time object. In order to facilitate this kind of synchronization, PortTime is derived from Connection. If the port is connected to some other object providing a time port, the value of that port is used, i.e., the time port becomes an alias of the connected time port. The range of the time port as well as its increment (which is relevant for animation) can be edited in a little dialog which is pops up when pressing the right mouse button over the slider.

In addition to the main button the time slider also provides so-called subrange buttons. These buttons allow you to temporarily restrict the range of the slider. For animations only this restricted range is considered. The subrange buttons can be set to an exact value via the port's popup dialog or by typing L <value> or R <value> in the sliders text field. The letters L or R indicate that the left or right subrange button should be set, and not the main button.

Commands:

Inherits all commands of Connection.

getValue
Returns the current time value.

setValue <value>
Sets the current time value.

getMinMax
Returns two numbers indicating the full range of the time port.

setMinMax <min> <max>
Sets the range of the time port.

getSubMinMax
Returns two numbers indicating the subrange of the time port. The subrange is relevant for animations.

setSubMinMax <min> <max>
Sets the subrange of the time port.

getIncrement
Returns the increment of the time port. During animations or when pressing the forward or backward buttons the time value is increased or decreased by the increment.

setIncrement <value>
Sets the increment of the time port.

getDiscrete
Checks if the time port is in discrete mode or not. In discrete mode the time can only take on values min + n*increment, where min is the minimum value of the range, increment is the port's increment value, and n is an integer value.

setDiscrete {0|1}
Sets discrete mode on or off.

setFormat <format>
Sets the format used for the slider's text field in printf syntax. Typically, the default format is %g.

setTracking {0|1}
Turns tracking on or off. If tracking is enabled the object the port belongs to is fired permanently while the moving the slider with the mouse. If tracking is off the object is only fired once when the mouse button is released.

play [-forward|-backward] [-once|-loop|-swing]
Starts to animate the time value. Additional arguments can be specified for the animation direction (forward or backward) and for the animation mode (play once, loop forever, play forth and back forever). If no arguments are specified forward play and the last animation mode are assumed.

stop
Stops a running animation.

step [-f(orward)|-b(ackward)]
Plays the animation by one time step forward or backward.

setRealTimeDuration <duration_in_seconds>
This command enables real time mode. In real time mode a full animation cycle takes as long as specified by this command. The increment added to the current time value after each animation step depends on the time required for that step. When real time mode is enabled discrete mode will be automatically disabled.

getRealTimeDuration
Returns the time duration of a full animation cycle in real time mode. If real time mode is disabled, 0 is returned. When the min or max time value is changed while real time mode is enabled the time duration is automatically adjusted.