Home -> FPP plugins page -> panologic.swf
This plugin is completely free for use in any context or connection.
panologic.swf
FPP external plugin that makes it possible to apply IF-ELSE logic to your FPP commands. The logic can of course not be written directly in the FPP XML file, but is instead entered in its own file from where it can be executed just as easily with a simple command. Your logic is stored in "functions", and would normally consist of one or several IF-ELSE statements and one or several FPP commands.
The following parameters are supported:

Parameter names are not case sensitive ("XMLFile" is equal to xmlfile"). Parameter values, on the other hand, will be saved
exactly as written.

Only one parameter is supported at plugin initialization:
xmlfilexmlFile=myfunctions.xmlname of XML file containing your functions
default is "panologic.xml"

Parameters that can be set via "external.panologic.name=value" call:
xmlfilexmlFile=newfunctions.xmlyou can anytime load a new set of functions
function_namefunction_name=valueIF-ELSE function call



Overview

Your pano logic is written in "functions" that you can execute from FPP. Each function can contain as many IF-ELSE statements and FPP commands as you need - there is no limit.

The IF-ELSE statements can be nested in any number of levels, and the expressions to be tested can be grouped with parentheses in any number of levels.

When expressions are evaluated, a numeric compare will be made if at least one of the operands are numeric, else a string compare will be made.

No arithmetic is allowed in expressions.



Allowed operators are:

==equal to
!=not equal to
<less than
<=less than or equal to
>greater than
>=greater than or equal to



Logical operators:

&&and
||or



Operands can be:

numbersex: 123 85.4 -11
stringsex: "images/pano5"
meta operandsex: $pan $panoname $date



Meta operands are used for values that are not fixed, and the plugin has to fetch at the moment when the evaluation takes place - like pan position, date, fullscreen state. They are written in the form "$meta_name" and can be one of the following:

$internetconnected to Internet (true=1, false=0)
$panonamename of loaded pano
$panowidthwidth of loaded pano
$panoheightheight of loaded pano
$panoratiowidth/height of loaded pano
$fullscreencurrent display state (true=1, false=0)
$pancurrent pan value
$tiltcurrent tilt value
$zoomcurrent zoom value
$timecurrent time ("hh:mm")
$datecurrent date ("yymmdd")
$parmparameter value (external.panologic.function_name=parameter_value)
$javascript:function_namestring value returned from a JavaScript function call
$name.attributehotspot attribute, ex: $image22.alpha



FPP commands to be executed has to be written as:

$command(FPP_command(s)_to_be_executed)
Example: $command(pano.pan=125,4000)



Executing an IF-ELSE statement

When you want to execute your IF-ELSE statement, you do this by calling the function in which you have written it. An example:

Lets say you have two (invisible) hotspots, and when the viewer presses a button you want to show SpotA if he is in fullscreen mode and SpotB if he is not. The button then has an onClick:
onClick="external.panologic.fulltest=nnn"
In your plugin XML file, you have this function:
   <function name="fulltest">
      <![CDATA[
      if ($fullscreen == 1) {
         $command(SpotA.visible=1)
      }
      else {
         $command(SpotB.visible=1)
      }
      ]]>
   </function>



NOTES:

You have to write your logic inside a CDATA section ( <![CDATA[ your_if-else ]]> ). Data inside a CDATA section is ignored by the XML parser, and can therefore contain characters like "<" and "&".

The format of the IF's are very free - you can write everything on one line, or split it up in several lines. All whitespace (blanks, tabs, newlines) is removed by the plugin when parsing the functions.

As FPP converts plugin parameter names to lower case, the function names are case insensitive. The plugin will convert them to lower case internally.

The parameter value "nnn" after the equal sign when making a function call can be anything - it is just an FPP requirement. But it can be used in your functions as $parm if you want to make use of it:

if ($parm == 5) {...} else {...}

To use the Internet connection test you have to include the <internet url="..."> tag in the XML file. The url should point to a very small file that the plugin can load at initialization. If the loading is successful, all tests for Internet connection will result in "true".



Example of a panologic XML file:

<?xml version = '1.0'?>
<panologic>
   <internet url="http://wirestam.com/panos/Flash/panologic/iptest.txt" />
   <functions>
      <function name="tohires">
         <![CDATA[
         if ($Pano1low.visible == "1") { $command(global.showPano1High) }
         if ($Pano2low.visible == "1") { $command(global.showPano2High) }
         if ($Pano3low.visible == "1") { $command(global.showPano3High) }
         ]]>
      </function>
      <function name="tolowres">
         <![CDATA[
         if ($Pano1hi.visible == "1") { $command(global.showPano1Low) }
         if ($Pano2hi.visible == "1") { $command(global.showPano2Low) }
         if ($Pano3hi.visible == "1") { $command(global.showPano3Low) }
         ]]>
      </function>

      <function name="showpano1">
         if ($gohires.visible == "0") { $command(global.showPano1High) }
         else { $command(global.showPano1Low) }
      </function>
      <function name="showpano2">
         if ($gohires.visible == "0") { $command(global.showPano2High) }
         else { $command(global.showPano2Low) }
      </function>
      <function name="showpano3">
         if ($gohires.visible == "0") { $command(global.showPano3High) }
         else { $command(global.showPano3Low) }
      </function>

      <function name="fulltest">
         if ($fullscreen == 1) { $command(global.fullYes) }
         else { $command(global.fullNo) }
      </function>

      <function name="iptest">
         if ($internet == 1) { $command(global.internetYes) }
         else { $command(global.internetNo) }
      </function>
   </functions>
</panologic>