WebContent/widgets/symbol.js
// Get widget's data-symbol-# based on number from PV data
Get widget's data-symbol-# based on number from PV data
Get widget ' s data - symbol - # based on number from PV data
function __getSymbol(widget, data)
{
    let number = data.value;
    if (number === undefined)
        number = parseInt(data.text);
    if (Array.isArray(number))
    {
        let index = widget.data("index");
        if (index === undefined)
            index = 0;
        number = number[index];
    }
    number = Math.trunc(number);
    return widget.data("symbol-" + number);
}
function __getSymbol ( widget , data ) { let number = data . value ; if ( number === undefined ) number = parseInt ( data . text ) ; if ( Array . isArray ( number ) ) { let index = widget . data ( "index" ) ; if ( index === undefined ) index = 0 ; number = number [ index ] ; } number = Math . trunc ( number ) ; return widget . data ( "symbol-" + number ) ; }
Get widget's data-symbol-# based on number from PV data
Get widget ' s data - symbol - # based on number from PV data
// Expect number, fall back to parsing number from string // For array, check index // Only use integer part