Logic Machine Forum
visualization - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: visualization (/showthread.php?tid=5140)



visualization - rw_echo - 08.12.2023

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.


RE: visualization - admin - 08.12.2023

Add this to Custom JavaScript:

Code:
$(function() {
  var show = window.showPrevNextPlan;
  
  if (show) {
    setInterval(function() {
      show(true);
    }, 10 * 1000);
  }
});



RE: visualization - rw_echo - 11.12.2023

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?


RE: visualization - admin - 11.12.2023

Can you explain in more detail what do you want to achieve? Do you want to stop this automatic plan switching?


RE: visualization - rw_echo - 12.12.2023

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.


RE: visualization - admin - 12.12.2023

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);
  }
});



RE: visualization - rw_echo - 12.12.2023

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?


RE: visualization - Novodk - 12.12.2023

(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?


RE: visualization - admin - 12.12.2023

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();
});