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.

Line lamp , light strip ,How to display with SVG or CSS?
#8
(04.03.2019, 08:41)admin Wrote: First, create visuzalization elements for strip display. Set Display mode to icon and Additional classes to lights

Add this code to Custom JavaScript, change 32/1/1 to your color object value. It will remove icons from strip display elements and use current object color value as background fill with 50% opacity. You can change opacity from 0.5 to any other value between 1 and 0 if needed.

Code:
$(function(){
 if (typeof grp === 'object') {
   var lights = $('.lights');
        
   $.each(lights, function(_, el) {
     var light = $(el);

     light
       .css('width', light.width())
       .css('height', light.height())
       .css('opacity', 0.5)
       .find('.icon').remove();
   });
   
   grp.listen('32/1/1', function(obj) {
     lights.css('background-color', Scada.getRgbHex(obj.value));
   }, true);
 }
});

My light strip are not RGB, only on and off. How to define the two colors on and off in the aboveCustom JavaScript , The group address is one bit.
Reply


Messages In This Thread
RE: Line lamp , light strip ,How to display with SVG or CSS? - by newspaper - 09.03.2019, 07:09

Forum Jump: