This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

Jump to visualization page when ID is received
#1
Hey Everybody,

I can't get the example script :"Open IP camera visualization page when intercom call is received" working.
I also want to use this functionality for more triggers, so I was hoping for a script in which the visualisation ID is triggert.

So for example: http://IP-ADDRESS/scada-vis/#18   This triggers by sending "18" to an 2 byte unsigned integer.

Anybody who can help me?

Thanks!
Reply
#2
Hi,

Here is a custom JS to do that:
Code:
$(function(){
  if (typeof grp != 'undefined') {
    grp.listen('1/1/1', function(object, state) {
      if (state == 'value') {
          showPlan(object.value);      
      }
    });
  }
});
BR,

Erwin
Reply
#3
(31.05.2020, 07:39)Erwin van der Zwart Wrote: Hi,

Here is a custom JS to do that:
Code:
$(function(){
  if (typeof grp != 'undefined') {
    grp.listen('1/1/1', function(object, state) {
      if (state == 'value') {
          showPlan(object.value);      
      }
    });
  }
});
BR,

Erwin
Hi Erwin,

Many thanks!  Works like a charme!
Added time out, so it hops back to startscreen (i defined).

if (plantimer){
        clearTimeout(plantimer)
        }
          plantimer=setTimeout(function(){
              showPlan(XX);
          }, 60000);
        }
      });


1.

(31.05.2020, 07:39)Erwin van der Zwart Wrote: Hi,

Here is a custom JS to do that:
Code:
$(function(){
  if (typeof grp != 'undefined') {
    grp.listen('1/1/1', function(object, state) {
      if (state == 'value') {
          showPlan(object.value);      
      }
    });
  }
});
BR,

Erwin
  Erwin,

1 question in addition to this. Can you also make the visualisation active?  I now use dimming. So the visulaisation is shown, but the screen is dimmed.
Reply
#4
Hi,

Add this line to your code:
Code:
$('.modal-backdrop').addClass("hide");
BR,

Erwin
Reply
#5
(31.05.2020, 21:33)Erwin van der Zwart Wrote: Hi,

Add this line to your code:
Code:
$('.modal-backdrop').addClass("hide");
BR,

Erwin


Hi Erwin,
Thx again for the quick response, however I now find it difficult to apply in my code. Can you please help.

My code: 

var plantimer;
$(function(){

  if (typeof grp != 'undefined') {
 
      grp.listen('1/1/1', function(incomingEvent, eventType) {
        if (eventType == 'value') {
          switch(incomingEvent.value){
              case 1:
                  showPlan(11);
                  break;
              case 2:
                  showPlan(7);
                  break;
              case 3:
                  showPlan(38);
                  break;
          }
  if (plantimer){
        clearTimeout(plantimer)
        }
          plantimer=setTimeout(function(){
              showPlan(1);
          }, 60000);
        }
      });
 
    }
});
Reply
#6
Just add it after each showPlan call where needed
Reply
#7
(01.06.2020, 09:49)admin Wrote: Just add it after each showPlan call where needed


Thx, it was the ";" I still had in there, why it did not work :-)
Reply


Forum Jump: