Logic Machine Forum
Overload existing Widget - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Overload existing Widget (/showthread.php?tid=3665)



Overload existing Widget - domotiqa - 05.11.2021

1/ Is there a way to add infos on existing value choice:

   

Like object name, and maybe object value from the original value with name difference like I did for the temp color change:

$(function() {
  $('.backTemp').each(function(_, el) {
    var addr = $(el).data('object');
    if (addr) {
      grp.listen(addr, function(obj) {
        var value = obj.value
          , color = 'rgba(255, 65, 65, 0.5)'; // default color
        //console.log(obj);
        //console.log(obj.value);
       
        var nom = obj.name;
        var newNom = nom.replace('SET','CUR');
        var valeur = grp.getvalue(newNom);

        if (valeur > 22.0) {
          color = 'rgba(255, 0, 0, 0.5)';
        }
        else if (valeur >= 18.0) {
          color = 'rgba(250, 165, 0, 0.7)';
        }
else if (valeur < 18.0) {
          color = 'rgba(75, 180, 230, 0.5)';
        }

        $(el).css('background-color', color);
      });
    }
  });
});


2/ Other option
I would like to generate a dynamic widget on ambiant temperature object clic, wich display setpoint choice, setpoint feedback, heat status, name of the room from object.namme or object.comment, background....

When you have 200 widget to do it would be great to overload your existing buton, or to dynamic create one (of course group adress should be with same name like room-set, room-ambiant, room-value, room-heat-state ...).



3/Last option but more pain, creat a script that generate all widget once...

Would appreciate if the first and second option is possible

4/ Last question when using cicle buton value choice (for setpoint temp for example). The arrow put value to min or max value, is there a way to only increase/decreas by step instead (like +1/ -1)


RE: Overload existing Widget - admin - 05.11.2021

1. Do you mean the "Custom value select" mode?

2. Not possible at the moment

3. This might be helpful: https://forum.logicmachine.net/showthread.php?tid=1249

4. Do you mean for slider? If step value in Vis. params is not empty then clicking the arrows will change step the value instead of setting min/max.


RE: Overload existing Widget - domotiqa - 08.11.2021

(05.11.2021, 14:47)admin Wrote: 1. Do you mean the "Custom value select" mode?

2. Not possible at the moment

3. This might be helpful: https://forum.logicmachine.net/showthread.php?tid=1249

4. Do you mean for slider? If step value in Vis. params is not empty then clicking the arrows will change step the value instead of setting min/max.

1/ no, for example when you have setpoint temperature click.
you can choose to use direct value, rotation value picker, slider...

I would like to add text, and value for ambiant temperature... to this popup (for example add text based on object.comment for example...)

2/ ok, would be cool to be apple based on class object for example, to add javascript function that generate a dynamic popup

3/ thanks

4/ ok in fact, I think there is a bug. I display the value with 0 decimal (because on floorplan I want no decimal), and in step I put 0.5, because I want the customer to be abble to change 0.5 by 0.5. Whith this config, the + and - button go to max/min instead of +/-0.5.
I put 1 in step value and it's ok but no 0.5 step