Home -> VRSmarty plugins page -> commander.swf
This plugin is completely free for use in any context or connection.
commander.swf
This plugin keeps track of pano movements like panning, tilting and zooming, and when the viewer changes pano. The plugin can then trigger actions with VRSmarty commands or functions depending on how the viewer is moving through the tour. This can be combined with event timers to induce delayed actions. Lack of user activity can also be trapped to trigger actions.

Plugin parameters can be read from the VRSmarty xml file or from an external xml file.

The following parameters are supported:

In VRSmarty xml file:
xmlFilexmlFile='myCommands.xml'plugin control XML file, default=commander.xml



Plugin attributes:set with spot_id.content.name=value
enabledenabled=1enable/disable plugin
intervalinterval=100check interval (ms), default=200


Plugin methods: call with spot_id.content.name(value)
addAction(data)addAction(...)add action, see below for action format
deleteAction(id)deleteAction('A5')remove action, id='all' removes all actions
resetAction(id)resetAction('sign2')reset action, id='all' resets all actions
enableAction(id)enableAction('wait1')enable action, id='all' enables all actions
disableAction(id)disableAction('P2')disable action, id='all' disables all actions


addAction() parameter format:
   addAction('id|enabled|panoname|delay:flag|pan:range|tilt:range|fov:range|inactivity|repetition|commandIn|commandOut')



Plugin external xml file:

In <commander> tag:
enabledenabled=0enable/disable plugin, default=1
intervalinterval=150plugin checking interval (ms), default=200
tracetrace=1enable trace messages, default=0
In <action> tag:
idid="A3"action id, used as internal reference and to remove, reset, enable and disable an action
enabledenabled="0"0=action disabled, 1=action enabled (default=1)
panonamepanoname="bridge"limit action to this pano (works as spot "linked" parameter)
panpan="130:20"pan value:range, limit action to this pan range, this example will trigger action in the pan range 110 - 150.
tilttilt="-10:20"tilt value:range, limit action to this tilt range, this example will trigger action in the tilt range -30 - +10.
fovfov="50:40"fov value:range, limit action to this fov range, this example will trigger action in the fov range 10 - 90.
inactivityinactivity="20"action will be triggered when no change in pan, tilt or fov has been made in the specified number of seconds. Normally not used together with other requirements.
repetitionrepetition="2"number of times an action may be repeated (0-nnn, default=999)
delaydelay="5:1"time:flag, delay time(s) for action, format "delay:flag". Can be used alone simply to delay an action, or together with other attributes (pan, tilt, fov).
flag (default=0):
0: launch action with delay AFTER all other requirements are met
1: launch action after delay OR if other requirements are met (whichever happens first)
2: don't start checking other requirements UNTIL delay has passed
commandIncommandIn="showSign"command(s) to execute when an action is triggered
commandOutcommandOut="hideSpot"command(s) that will execute when action gets "untriggered", for example when the user leaves the triggering pan range.



NOTES:
The command fields may consist of VRSmarty commands and/or plugin dynamic parameters. Remember that
all VRSmarty commands must come first and that parameter settings must start with a "#" (see examples
in plugin XML file).

As you can't use the &;= characters inside parameters in the VRSmarty XML file, you have to encode them as follows:

& as %26
; as %3B
= as %3D



Example of plugin xml file:
<?xml version = '1.0'?>
   <commander activate="1" interval="250" trace="0">
      <action 
         id="101" 
         enabled="1"
         panoname="../stadshuset/img/stadshuset1" 
         pan="133:15" 
         tilt="0:30" 
         fov="" 
         delay="10:2" 
         repetition="1" 
         commandIn="global.showQmark()"
         commandOut="global.hideQmark()#activate=102"
      />
      <action 
         id="109" 
         inactivity="15"
         commandIn="global.panToExit()"
      />
      ...
      <action id="107" repetition="1" panoname="../stadshuset/img/stadshuset1" pan="133:15" 
         tilt="0:30" enabled="0" commandIn="global.showEmark()" 
         commandOut="global.hideEmark()#activate=103"
      />
      ...
   </commander>
					

Version history: