Live Data Overlay  

Share your tips and tricks here or get help with any Panotour 2.0+ problem!
No bug reports (of any kind) in this forum!
no avatar
LSM1604
New member
 
Topic author
Posts: 5
Likes: 0 post
Liked in: 0 post
Joined: Wed Mar 09, 2016 2:53 pm
Info

Live Data Overlay

by LSM1604 » Wed Sep 05, 2018 4:00 pm

Hi,

I was wondering if someone could help me with something please?

I have built a tour of an industrial environment (valves, pumps, tanks, motors etc), and I would like to make some enhancements if possible.

One of those enhancements is to have an overlay of live data shown from within the tour. For example, if I hover my mouse over a particular pump it shows me whether it is running or not running, and the flow rate of the water running through it. If I hover over a tank it shows me the level. A motor it shows my the RPM etc.

We have all of this data and it is held within OSISoft PI Historian, and therefore have the ability to use the PI API should we need to.

Is there any way that I can get a tour created with PanoTour to do this? If not, could someone point me in the right direction with how I can get KrPano to do this once the tour has been built in PanoTour?

Any help is welcome :)

Thanks,
Liam

User avatar
360-compunics-com-ni
Member
 
Posts: 418
Likes: 15 posts
Liked in: 163 posts
Joined: Wed Dec 17, 2014 12:37 am
Location: León, Nicaragua
Info

Re: Live Data Overlay

by 360-compunics-com-ni » Sat Sep 08, 2018 12:00 pm

Can be done using PTP and some custom coding, here is a general overview:
You can use AJAX-calls to get the live data, the following function (inside your index.html-file) can be triggered by an event like entering a scene (onnewpano) or at certain intervals (every 10 seconds, for example) - having it execute on every mouseover-event might lead to issues when users "fire" the event too rapidly.

The server-side script "get_livedata.php" would extract the data corresponding to the current pano's hotspots (hsidlist) and echo it back in a determined format, which could then be interpreted and displayed by the "show_livedata()"-function which can be inserted into the generated XML-files as custom plugin or via the "include XML"-plugin.

Code: Select all
function get_livedata( hsidlist ) {
    if (hsidlist == "") {
        return;
    } else {
        if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                var callstr = "show_livedata(" + xmlhttp.responseText + ")";
      getCurrentTourPlayer().call(callstr);
            }
        };
        xmlhttp.open("GET","get_livedata.php?ids="+hsidlist,true);
        xmlhttp.send();
    }
}
Out now: DeviceCheck for PTP plugins! https://www.kolor.com/forum/viewtopic.php?f=40&t=37446

Want to know how clients use your tours? Google Analytics Track Events plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=34442

Add actions to your hotspots: Hotspot Actionlist plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=35829


Who is online

Users browsing this forum: No registered users and 7 guests