"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DashboardMMWave = void 0;
var utils_1 = require("./utils");
var CELCIUS = 'ºC';
var DashboardMMWave = /** @class */ (function () {
    function DashboardMMWave(Main) {
        this.container = document.querySelector('.ntsh_dashboard-mmwave');
        this.standardPortStatus = this.container.querySelector('.ntsh_dashboard-mmwave-standardstatus');
        this.standardPortInfo = this.container.querySelector('.ntsh_dashboard-mmwave-standardinfo');
        this.enhancedPortStatus = this.container.querySelector('.ntsh_dashboard-mmwave-enhancedstatus');
        this.enhancedPortInfo = this.container.querySelector('.ntsh_dashboard-mmwave-enhancedinfo');
        this.framesPerSecond = this.container.querySelector('.ntsh_dashboard-mmwave-framespersecond');
        this.trackedPersons = this.container.querySelector('.ntsh_dashboard-mmwave-trackedpersons');
        this.personsInBounds = this.container.querySelector('.ntsh_dashboard-mmwave-personsinbounds');
        this._Main = Main;
        this.registerListeners();
    }
    DashboardMMWave.prototype.updateState = function (state) {
        if (state == null)
            return;
        // ----------- Standard Port -----------
        (0, utils_1.setStatusState)(this.standardPortStatus, state.ports.standard.connected == 'connecting'
            ? 'warning'
            : state.ports.standard.connected
                ? 'ok'
                : 'error');
        this.standardPortInfo.innerText = state.ports.standard.path;
        // ----------- Enhanced Port -----------
        (0, utils_1.setStatusState)(this.enhancedPortStatus, state.ports.enhanced.connected == 'connecting'
            ? 'warning'
            : state.ports.enhanced.connected
                ? 'ok'
                : 'error');
        this.enhancedPortInfo.innerText = state.ports.enhanced.path;
        // ----------- Statistics -----------
        this.framesPerSecond.innerText = state.framesPerSecond.toString();
        this.trackedPersons.innerText = state.trackedPersons.toString();
        this.personsInBounds.innerText = state.personsInBounds.toString();
    };
    DashboardMMWave.prototype.registerListeners = function () {
        var _this = this;
        this._Main.socket.on('mmWaveState', function (state) {
            _this.updateState(state);
        });
    };
    return DashboardMMWave;
}());
exports.DashboardMMWave = DashboardMMWave;
//# sourceMappingURL=dashboard.mmwave%20copy.js.map