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.

JS'ed SVG for Siemens RDG1x0KN thermostats
#2
Please check this example of svg controlled via js:
http://forum.logicmachine.net/showthread...275&page=4

I can also prepare something to start for you. If this wouldn't work please change '0' to '1' or other value, it depends on how many other images do you have in your visualisation.

Code:
$(function(){

  $('object').load(function() {
    
    var svg = $('.siemens')[0].firstChild; // Choosing svg
        
    var svgDoc = svg.contentDocument; // Choosing content from svg
    var temperature = svgDoc.getElementById("temperature"); // Choosing temperature from content
    var setpoint = svgDoc.getElementById("setpoint"); // Choosing setpoint from content
    var primary = svgDoc.getElementById("primary"); // Choosing primary from content
    var secondary = svgDoc.getElementById("secondary"); // Choosing secondary from content
    var radiator = svgDoc.getElementById("radiator"); // Choosing radiator from content
    var speed0_16 = svgDoc.getElementById("speed0_16"); // Choosing speed0_16 from content
    var speed16_33 = svgDoc.getElementById("speed16_33"); // Choosing speed16_33 from content
    var speed33_50 = svgDoc.getElementById("speed33_50"); // Choosing speed33_50 from content
    var speed50_83 = svgDoc.getElementById("speed50_83"); // Choosing speed50_83 from content
    var speed83_100 = svgDoc.getElementById("speed83_100"); // Choosing speed83_100 from content
    var fan = svgDoc.getElementById("g24"); // Choosing fan from content
    var heat = svgDoc.getElementById("g39"); // Choosing heat from content
    var cool = svgDoc.getElementById("g34"); // Choosing cool from content

    // Update temperature
    actual_temp = Scada.encodeGroupAddress('1/1/10'); // temperature
    objectStore.addListener(actual_temp, function(obj, type) {
    console.log(temperature, obj.value)
    temperature.textContent= obj.value
    });
    
});
 
});


At this moment I have only time for such little helpSad Maybe tomorrowWink

I see also some buttons, can you describe how do you change parameters on real thermostat?
Reply


Messages In This Thread
RE: JS'ed SVG for Siemens RDG1x0KN thermostats - by buuuudzik - 12.01.2017, 21:54

Forum Jump: