AutoSwitchBase

MacroModule
genre FlowControl
author Volker Dicken
package FMEstable/ReleaseMeVis
definition AutoSwitchBase.def
see also BaseSwitch, BaseSwitch2, AutoSwitch, Switch2
keywords switch, optional, base, automatic, object

Purpose

Automatically switches to the valid one of the two input objects. If both are valid, the second one (inOverrideObject) is preferred.

Usage

Connect your default image to inDefaultObject, and an optional “override” image to inOverrideObject.

Tips

WARNING: If both input base objects have a common source field somewhere down the graph, a notification on that object will reach one of the inputs first without the other one knowing about it. Due to the way MeVisLab works, there is no way of telling which one will get the notification first, or to ‘wait’ until the other input field was also notified. Thus, if the notification reaches inOverrideObject first and results in inOverrideObject becoming NULL, the switch will switch to inDefaultObject - which will still point to the object that was previously there, although it will most likely now also be NULL, the notification is just not there yet. This may result in an undefined intermediate state, or even in crashes if said object was already destroyed!

Windows

Default Panel

../../../Projects/Switches/AutoSwitchBase/Modules/mhelp/Images/Screenshots/AutoSwitchBase._default.png

Input Fields

inDefaultObject

name: inDefaultObject, type: MLBase, deprecated name: in1

Object to be used if there is no valid override object at inOverrideObject.

inOverrideObject

name: inOverrideObject, type: MLBase, deprecated name: in2

Optional object that, if valid, is always selected as outObject.

Output Fields

outObject

name: outObject, type: MLBase, deprecated name: out

The forwarded Base object.

Parameter Fields

Visible Fields

Right (Override) Input Enabled

name: outUseOverrideObject, type: Bool, persistent: no, deprecated name: useInput1

True if the override object is valid (and thus relayed to the output).