^RFRP & RMF new features
vining
Posts: 4,368
I came across this info accidentally over the week end so I figured I'd post it as an FYI.
The ^RFRP and ^RMF have some new features that work with a new custom event that allows you to send an additional parameter to the TP so that the TP sends back to the master via a custom event a notification when a dynamic resource has loaded.
I had a chance to work with it this week end too and it does work as advertised. I modified some code to display photos from flickr, facebook, spotify, etc and now using the new custom event I can trigger ^SHO send commands to make the pictures visible when I know it's been loaded and opposed to some fixed wait time. It has allot of potential.
Here's the complete section of X series doc.
The ^RFRP and ^RMF have some new features that work with a new custom event that allows you to send an additional parameter to the TP so that the TP sends back to the master via a custom event a notification when a dynamic resource has loaded.
I had a chance to work with it this week end too and it does work as advertised. I modified some code to display photos from flickr, facebook, spotify, etc and now using the new custom event I can trigger ^SHO send commands to make the pictures visible when I know it's been loaded and opposed to some fixed wait time. It has allot of potential.
Here's the complete section of X series doc.
--Dynamic Image Commands--
^RFR-<resource name>,<notification option>
^RFRP-<resource name>, <notification option>
Force a refresh of the given resource. The ^RFR command will refresh when the resource is visible onscreen. If it is not onscreen, it will be deferred until it is visible to do the refresh. The ^RFRP will "prefetch" the resource even if it is not currently visible.
Modero X Panels add a new optional notification option at the end of the command with the following possible values:
1. on - notifications are sent whenever the named dynamic image resource is loaded/refreshed.
2. off - notifications are not sent (default).
3. once - notifications are sent one time whenever the named dynamic image resource is loaded/refreshed. Notifications are not sent on subsequent loads/refreshes.
Examples:
SEND_COMMAND Panel, ‘^RFR-Sports_Image,on’
Force a refresh on ‘Sport_Image’ when the resource is visible onscreen and enable completion notifications.
SEND_COMMAND Panel, ‘^RFR-Sports_Image,off’
Force a refresh on ‘Sport_Image’ when the resource is visible onscreen and disable completion notifications.
SEND_COMMAND Panel, ‘^RFR-Sports_Image,once’
Force a refresh on ‘Sport_Image’ when the resource is visible onscreen and enable a one-time completion notification.
SEND_COMMAND Panel, ‘^RFRP-Sports_Image,on’
Force a refresh on ‘Sport_Image’ immediately and enable completion notifications.
SEND_COMMAND Panel, ‘^RFRP-Sports_Image,off’
Force a refresh on ‘Sport_Image’ immediately and disable completion notifications.
SEND_COMMAND Panel, ‘^RFRP-Sports_Image,once’
Force a refresh on ‘Sport_Image’ immediately and enable a one-time completion notification.
For Modero X, the ^RAF and ^RMF commands added the %C embedded code. Here is the full list of supported codes:
Parameter Embedded Code Description
========= ============= ===========
protocol '%P<0-1>' Set protocol: either HTTP (0) or FTP (1)\
user '%U<user>' Set Username for authentication.
password '%S<password>' Set Password for authentication.
host '%H<host>' Set Host Name (fully qualified DNS or IP address).
path ‘%A<path>’ Set directory path. The path must be a valid HTTP URL minus the protocol, host, and filename. The only exception to this is the inclusion of special escape sequences and in the case of the FTP protocol, regular expressions.
file '%F<file>' The file or program that will return the resource. The file must be a valid HTTP URL minus the protocol, host, and path. The only exception to this is the inclusion of special escape sequences and in the case of the FTP protocol, regular expressions.
refresh '%R<refresh 0-65535>' The number of seconds between refreshes in which the resource is downloaded again. Refreshing a resource causes the button displaying that resource to refresh also. The default value is 0, which means to only download the resource once for each time it comes into view (or if preserve is set, only once period).
NOTE: For Motion JPEGs, the Refresh interval should always be 0.
newest '%N<0-1>' Set the newest file. A value of 1 means that only the most recent file matching the pattern is downloaded.
Note: The 'newest file' option only applies to FTP Dynamic Images, and only those that have pattern matching as part of their filename. Neither 'newest file' nor pattern matching apply to HTTP Dynamic Images. When set, the panel will first pull a list of files matching the given pattern from the specified FTP server and path. The timestamps of the items in the list will be compared, with the newest one being displayed on the panel. This is useful for source devices that place a uniquely named still image in a folder at constant intervals, allowing the panel always to display the most recent one.
preserve ‘%V<0-1>’ Set the value of the preserve flag. A value of 0 (the default) means the resource should be reloaded each time it comes into view. A value of 1 means the resource should be preserved in cache after the first time it is loaded, and not reloaded each time it comes into view. This value is ignored if the Refresh interval is greater than 0.
dynamo ‘%D<0-1>’ Enable/disable Fast Dynamo.
Panel will attempt to accelerate this resource in hardware.
Notification setting ‘%C<on,off,once>’ Indicates whether a notification is required when a Dynamic Image is loaded/refreshed.
The string following the %C can be:
1. on - notifications are sent whenever the named dynamic image resource is loaded/refreshed.
2. off - notifications are not sent (default).
3. once - notifications are sent one time whenever the named dynamic image resource is loaded/refreshed. Notifications are not sent on subsequent loads/refreshes.
If the %C code is not sent as part of a ^RAF command, the notifications are set to off.
If the %C code is not sent as part of a ^RMF command, the notifications are not changed from the current setting.
Examples of new %C embedded code:
SEND_COMMAND Panel,’^RAF-New Image,%P0%HAMX.COM%ALab/Test%%5Ffile%Ftest.jpg%Con’
Adds a new resource.
• The resource name is ‘New Image’
• %P (protocol) is HTTP
• %H (host name) is AMX.COM
• %A (file path) is Lab/test_file
• %F (file name) is test.jpg
• %C (completion) is on
SEND_COMMAND Panel,’^RMF-New Image, %Conce’
Changes the ‘New Image’ resource to notifications are sent one time.
SEND_COMMAND Panel,’^RMF-New Image, %Coff’
Changes the ‘New Image’ resource to no notifications.
--Resource Load Notification--
This custom event is received when a resource for which notification is enabled is loaded.
CUSTOM.TYPE = EVENTID = 1400
CUSTOM.ID = 0
CUSTOM.FLAG = 0
CUSTOM.VALUE1 = 0
CUSTOM.VALUE2 = 0
CUSTOM.VALUE3 = 0
CUSTOM.TEXT = String containing the resource name
Example:
BUTTON_EVENT[Panel,1]
{
PUSH:
{
SEND_COMMAND Panel, ‘^RFRP-Sports_Image,once’; // refresh the resource name ‘Sports_Image’
}
}
CUSTOM_EVENT[Panel,0,1400]
{
SEND_STRING 0,"’*** Dynamic Image loaded. Resource=‘,CUSTOM.TEXT,’ ***’"
// resulting string for Sports_Image would be ‘*** Dynamic Image loaded. Resource=Sports_Image ***’
}
0