Dynamic View Controller (V1.1.3) Information

Posted on
Sat Nov 12, 2016 7:10 pm
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Dynamic View Controller (V1.1.3) Information

The Dynamic View Controller (Indigo 7.0+) is a generalised plugin for displaying images in a control page with actions to page backwards and forwards by number, time and date.

The Dynamic View Controller can traverse any folder structure but has specific processing to support the Foscam HD Controller (for which it was primarily designed).

The Dynamic View controller enables you to scan back and forth over a range of image files (includes image files in sub-folders). It maintains the current position even when the underlying folders are updated. There are actions to page forward and back: a File at at a time; Half hour at a time and a Day at a time. You can specify the number of files, half-hours and days to page - the input fields are there on actions. The half hour and day paging will first always go to the earliest image in the current half hour or day before moving further backwards or forwards. Missing days or half-hours are ignored i.e when no images have been captured in any particular half-hour or in a day. This allows you to define multiple buttons to do specific paging actions on a Control Page.

The plugin is available here: Autolog Dynamic View Controller

Install the plugin as normal.

The only configuration options for the plugin are to set monitoring and debugging options - not normally required.

Each Dynamic View is defined as an indigo device via New... > Type = Dynamic View Controller > Dynamic View

Configuring the Dynamic View device
  • Processing Mode
    Select either Foscam HD or Modified File Date Order
  • Broadcaster Plugin
    This plugin will listen for broadcasts from the selected plugin. On receiving a broadcast with the selected message type (see next), the plugin will refresh the Dynamic View
    If viewing Foscam HD images - select Foscam HD Controller from list. If another plugin supports Dynamic View broadcasting then you can select that one.
  • Message Type
    Specify the message type to listened for to refresh the dynamic view. The Foscam HD Controller broadcasts message type updateDynamicView (default)
  • Root Folder to Scan
    Specify the full path to the root folder to be scanned for files e.g. /users/<YOUR NAME>/Documents/CAMERA/FI9826P_001122AABBCC
    This will typically be the camera folder setup under the root folder specified in the Foscam HD Controller camera device.
  • Sym Link To File
    Specify the full path of a file symlink that will be created by the plugin. You will use this in a Control Page to display the currently selected file. An example Sym link definition is: /Users/<YOUR_USERID>/Documents/CAMERA/image-Camera-02.jpg. Note that the plugin will create the Sym link, you just have to tell it where you want it.. You will use this symlink as the file to display as refreshing image in your Control Page.
  • Sym Link To Latest File
    Specify the full path of a file symlink that will be created by the plugin. You will use this in a Control Page to display the latest file. An example Sym link definition is: /Users/<YOUR_USERID>/Documents/CAMERA/latest-image-Camera-02.jpg. Note that the plugin will create the Sym link, you just have to tell it where you want it.. You will use this symlink as the file to display as refreshing image in your Control Page.
  • Default File
    Specify the full path of an existing file that you want displayed when no file is available to display. The plugin will point the above symlinks to this file when there is no file available.
Actions available
  • Initialise Dynamic State
    This forces an initialisation of the Dynamic View. This is not normally required as it is done when the Dynamic View device is started
  • Update Dynamic State
    This will refresh and update the Dynamic View. If The plugin is receiving broadcasts (e.g. from the Foscam HD Controller to update the Dynamic View) then this action will not normally be used.
  • Skip To Latest
    This will point the Sym Link To File at the latest image. Note that the Sym Link To Latest File will always point to the latest file.
  • Day Skip Back
    This will point the Sym Link to File at a file that is a number of days previous to the current file as specified by Number of Days To Skip Backward
  • Day Skip Forward
    This will point the Sym Link to File at a file that is a number of days forward from the current file as specified by Number of Days To Skip Forward
  • Time Skip Back
    This will point the Sym Link to File at a file that is a number of half-hours previous to the current file as specified by Number of Half-Hours To Skip Backward
  • Time Skip Forward
    This will point the Sym Link to File at a file that is a number of half-hours forward from the current file as specified by Number of Half-Hours To Skip Forward
  • Skip Back
    This will point the Sym Link to File at a file that is a number of files previous to the current file as specified by Number to Skip Backward
  • Skip Forward
    This will point the Sym Link to File at a file that is a number of files forward from the current file as specified by Number to Skip Backward

Usage
When setting up a control page for browsing, I have found that the best way (so far) is to add a Refreshing Image URL and set its refresh rate to 24 hours. Then setup six buttons to page forwards and back with server actions: skip back, skip forward (for files), time skip back, time skip forward (for time i.e half-hours) and day skip back, day skip forward. For each of these buttons set up a client action to Replace with Control Page - the current control page (you might need to save and close and re-edit to get it in the control page list for the client action). This way you can page backwards and forwards very quickly through the images. Adding in various states e.g. selected number UI, will give you fields such as 'n' of 'n' e.g 27 of 89.

Note that when the Dynamic View Controller receives a broadcast from the Foscam HD controller, it will update the list of files so you will see the file count change. As mentioned previously, the Dynamic Viewer will remember where it was.

One final "feature" is that if you are paging quickly through the list of files, it is possible (probably likely) that you will get errors such as:
file:///Users/<USERID>/Documents/CAMERA/image-02.jpg load error: <urlopen error [Errno 2] No such file or directory: '/Users/<USERID>/Documents/CAMERA/image-02.jpg'>
- This happens because the plugin is unlinking the Sym Link from the old file before Sym Linking the new file. It corrects itself as soon as the new Sym Link is establish.

It is possible to disable these error messages appearing in the log (at your own risk) by changing line 472 inside indigoreqhandler.py (/Library/Application Support/Perceptive Automation/Indigo 7/IndigoWebServer/indigopy/devicesreqhandler.py):
From
Code: Select all
return self._ReturnError(kHtmlPageStr, err.value)
To
Code: Select all
return self._ReturnError(kHtmlPageStr, err.value, logError=False)


Note that you need to stop the Indigo Server and restart it for the change to indigoreqhandler.py to load, and also note if that file is changed in a future version of Indigo then the installer will overwrite your change (and you'll need to make it again).

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest