Key Container – step 0031 – February 2010

1 Purpose of SrrKeyContainer

SrrKeyContainer is one of the main prototypes to implement the “keys concept” (the other one is SrrLock).

Keys can be created during the initialization of an SrrKeyContainer. The user has to give a “global key id” (a string), hence the key will be accessible with the “global key Id”.

Every scene instance can take keys from a key container and add them to the “carried keys” (see SrrControl).

Every scene instance can locally “bind” a key container. That means, it will be the destination of the “put Keys” procedure for the local user (see SrrControl).

The contents of the key container (containedKeys) are kept synchronized among all scene instances via an internal network sensor with streamName/networkSensorId=”Srr-<moduleName>-<objId>”.

2 User Interface of SrrKeyContainer (uiObj)

SrrKeyContainer is an external prototype that is available at the directory srr/.

<ProtoDeclare name='SrrKeyContainer'>

<ProtoInterface>

<field accessType='inputOutput' name='objType' type='SFString' value='SrrKeyContainer'/>

<field accessType='inputOutput' name='version' type='SFFloat' value='0.0031'/>

<field accessType='inputOutput' name='quasiModule' type='SFString'/>

<field accessType='inputOutput' name='objId' type='SFString'/>

<field accessType='inputOutput' name='initialKeys' type='MFString'/>

<field accessType='inputOutput' name='modParam' type='SFNode'/>

<field accessType='inputOutput' name='enabled' type='SFBool' value="true"/>

<field accessType='outputOnly' name='initialized' type='SFNode'/>

<field accessType='inputOnly' name='set_bind' type='SFBool'/>

<field accessType='outputOnly' name='containedKeys' type='MFString'/>

<field accessType='inputOnly' name='takeKeys' type='MFString'/>

</ProtoInterface>

objId and quasiModule identify the SRR object. objId is a string unique within the module and quasiModule needs only be set if the SRR object is used in a global (vehicle) model.

initialKeys are set by the user to create keys in this key container. Each key gets an unstructured string as global key id. The global key id needs to be entered into the fittingKeys field of the lock, when you want to unlock a lock by this key. The same global key id may exist more than once.

If objId has been set, the initialization will start by setting the modParam. The user routes modParam from the SrrModCoord to the SrrKeyContainer.

initialized outputs an SFNode event, if the initialization has been finished. Normally, the user needs not monitor this field, it is mainly provided for the SrrKeyContainer instances that are instantiated as part of SrrLock nodes.

enabled can be used to disable all active elements of the SRR object if the model is unloaded.

With set_bind the user enables/disables putKeys actions into this key container (see the description of the keysToPut field of the SrrControl prototype).

The field containedKeys reports the global key ids of all contained keys, so the user can display them e.g. as a part of a key hanger.

With the field takeKeys the user starts the takeKeys action. As a result, the indicated keys will be removed from the key container and added to the “carried keys” of the scene instance (see SrrControl)