Skip to content

Stop knob value from changing while using touch or mouse #235

@Fbiss

Description

@Fbiss

Hi all,

I am using Knob for a climate control app. Every 10 seconds my script sends an ajax request to get the setPoint (variable of what the requested room temp should be to reach satisfied) from XML, and then this updates the knob value. I am also using Knob release event to call a function that sets the setPoint.

My issue is that sometimes it wil update the value of the knob in the middle of touching or mousing to change the setPoint.

Is there any way to stop the value change if in the middle of touching or mousing the wheel? Below is how i am retrieving and setting the knob value.

function getCurrentSetPoint() {
    $.ajax({
        type: "GET",
        url: "ControlHandler.ashx",
        dataType: "xml",
        cache: false,
        success: function (xml) {
            //Get Current Set Point
            $(xml).find('object[id="abcdefg"]').each(function () {
                var sTitle = $(this).find('objName').text();
                var sPublisher = Math.round($(this).find('objPresentValue').text());
                $('.setTemp').val(sPublisher).trigger("change");
            });
        },
        error: function () {
            alert("An error occurred while processing XML file.");
        }
    });
}

Thanks for any assistance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions