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.

Multitouch Problem
#4
Hi,

See this topic: https://forum.logicmachine.net/showthrea...62#pid3962

Or use this custom JS as a starting point, i created this for screen cleaning

Code:
$(function(){
 
  // Set your listener address and value here
  var grpaddress = '1/1/4';
  var objvalue = true;
 
  // Set your screenclean time here
  var screencleantime = 30;
 
  // Set your text here
  var screenclean_message = 'Screen cleaning mode is now active';
  var screenclean_remaining_prefix = 'remaining time';
  var screenclean_remaining_suffix = 'seconds';
 
  // Add screencleaner and listener to your visu
  if (typeof grp != 'undefined') {
    grp.listen(grpaddress, function(object, state) {
      var value = object.value;
      if(value == objvalue && state === 'value'){
        // Set start time
        var counter = screencleantime;
       
        // Function to count down the timer
        function countdown() {
          var el = document.getElementById('countertext');
          var intervalId = setInterval(function() {
            counter = counter - 1;
            $('#screencleantime').text(screenclean_remaining_prefix + ' ' + counter + ' ' + screenclean_remaining_suffix);
            if (counter === 5 || counter === 3 || counter === 1) {
                $('#screencleantime').css("color", "#ff0000");
            } else {
                $('#screencleantime').css("color", "#ffffff");
            }
            if (counter === 0 || counter < 0) {
               clearInterval(intervalId);  
              // Remove overlay from visu
                  $('#screenclean').remove();
            }
          }, 1000);
        };

        // Add dynamicly the overlay to visu
        $('body').append('<div id="screenclean" style="position:absolute;width:100%;height:100%;opacity:0.3;z-index:100;background:#000;"><div id="screenmessage" style="text-align:center;position:absolute;left:calc(50% - 200px);top:calc(50% - 100px);color:#ffffff;opacity:1;z-index:0;"><div><h4 id="screencleanmessage" style="min-width:100px;"></h4></div><div><h4 id="screencleantime" style="min-width:100px;"></h4></div></div>');
        $('#screencleanmessage').text(screenclean_message);
        $('#screencleantime').text(screenclean_remaining_prefix + ' ' + counter + ' ' + screenclean_remaining_suffix);
        // Start Countdown
        countdown();
       
      } else {
           // Remove overlay from visu on any other value
        $('#screenclean').remove();
      }
    }, true); // Set to true if you want to trigger again on same object value
  }
});

PS: I don’t think address 0/250/59 is possible (:

BR,

Erwin
Reply


Messages In This Thread
Multitouch Problem - by savaskorkmaz - 03.05.2018, 20:57
RE: Multitouch Problem - by tassiebean - 29.12.2019, 13:52
RE: Multitouch Problem - by Erwin van der Zwart - 29.12.2019, 14:19
RE: Multitouch Problem - by tassiebean - 30.12.2019, 04:30

Forum Jump: