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 that you accept these cookies being set.

visualization
#1
LM visualization has created multiple pages. Is there any way to make this interface loop through, such as looping through the computer interface for 10 seconds each.

Thanks.
Reply
#2
Add this to Custom JavaScript:

Code:
$(function() {
  var show = window.showPrevNextPlan;
  
  if (show) {
    setInterval(function() {
      show(true);
    }, 10 * 1000);
  }
});
Reply
#3
On the basis of the first post, when rotating to the current interface, the objects on the current interface can be automatically controlled through rotation, such as turning on and off three lights in sequence and switching control for several scenes in sequence.
How should it be implemented?
Reply
#4
Can you explain in more detail what do you want to achieve? Do you want to stop this automatic plan switching?
Reply
#5
On the basis of retaining the automatic plan switching of the visual page, when switching to the current interface, the control objects on that interface can be automatically controlled, such as the switch objects' 1/1/1 ',' 1/1/2 ', and' 1/1/3 ', which automatically cycle through the' true 'and' false 'commands with a 3-second interval.

In short, the visual interface and control objects on the interface can be automatically displayed dynamically. If the display can only be dynamically switched when the visualization is accessed through LM's new user login name and password, it would be even more perfect.
Reply
#6
Use this to enable automatic plan switching only for certain users (admin and user123 in this example):
Code:
$(function() {
  var show = window.showPrevNextPlan;
  var user = window.Globals ? window.Globals.user : '';

  if (show && (user == 'admin' || user == 'user123')) {
    setInterval(function() {
      show(true);
    }, 10 * 1000);
  }
});
Reply
#7
The currently displayed visualization device automatically executes, eg: '1/1/1' automatically executes' true ', and after 3 seconds,' false 'is executed. Of course, when switching to other pages, the value of object' 1/1/1 'remains unchanged.
Can such dynamic effects be achieved?
Reply
#8
(12.12.2023, 08:25)admin Wrote: Use this to enable automatic plan switching only for certain users (admin and user123 in this example):
Code:
$(function() {
  var show = window.showPrevNextPlan;
  var user = window.Globals ? window.Globals.user : '';

  if (show && (user == 'admin' || user == 'user123')) {
    setInterval(function() {
      show(true);
    }, 10 * 1000);
  }
});

This is exactly what I'm needing, thank you.
Is it possible to specify what plan ID's to switch between? 
And if so, could I setup 2 at the same time with different plans and users?
Reply
#9
Fill the sequence array with plan IDs for all required users:
Code:
$(function() {
  var show = window.showPlan;
  var user = window.Globals ? window.Globals.user : '';
  var sequence, index = 0;
  
  if (!show) {
    return;
  }
  
  if (user == 'admin') {
    sequence = [ 1, 2, 3 ];
  }
  else if (user == 'user123') {
    sequence = [ 11, 14, 18, 22 ];
  }
  else {
    return;
  }
  
  function showNext() {
    showPlan(sequence[ index ]);
    index = (index + 1) % sequence.length;
  }
  
  setInterval(showNext, 10 * 1000);
  showNext();
});
Reply


Forum Jump: