|
|
@ -160,40 +160,6 @@
|
|
|
|
var attempts = 0;
|
|
|
|
var attempts = 0;
|
|
|
|
var ignoreDialog = 0;
|
|
|
|
var ignoreDialog = 0;
|
|
|
|
|
|
|
|
|
|
|
|
function getComPorts(actualValue) {
|
|
|
|
|
|
|
|
var timeout = setTimeout(function () {
|
|
|
|
|
|
|
|
getComPorts(actualValue);
|
|
|
|
|
|
|
|
}, 2000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sendTo(null, 'listUart', null, function (list) {
|
|
|
|
|
|
|
|
if (timeout) {
|
|
|
|
|
|
|
|
clearTimeout(timeout);
|
|
|
|
|
|
|
|
timeout = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!list || !list.length) {
|
|
|
|
|
|
|
|
attempts++;
|
|
|
|
|
|
|
|
if (attempts < 10) {
|
|
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
|
|
getComPorts(actualValue);
|
|
|
|
|
|
|
|
}, 1000);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var $comName = $('#modbus_comName');
|
|
|
|
|
|
|
|
var text = '<option value="">' + _('Select port') + '</option>';
|
|
|
|
|
|
|
|
for (var j = 0; j < list.length; j++) {
|
|
|
|
|
|
|
|
if (list[j].comName === 'Not available') {
|
|
|
|
|
|
|
|
text = '<option value="" selected>' + _('Not available') + '</option>';
|
|
|
|
|
|
|
|
$comName.prop('disabled', true);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
text += '<option value="' + list[j].comName + '" ' + ((actualValue === list[j].comName) ? 'selected' : '') + '>' + list[j].comName + '</option>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$comName.html(text);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getExport(data, id, delimiter) {
|
|
|
|
function getExport(data, id, delimiter) {
|
|
|
|
delimiter = delimiter || '\t';
|
|
|
|
delimiter = delimiter || '\t';
|
|
|
|
var text = '';
|
|
|
|
var text = '';
|
|
|
@ -913,7 +879,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
getIsAdapterAlive(function (isAlive) {
|
|
|
|
getIsAdapterAlive(function (isAlive) {
|
|
|
|
if (isAlive || common.enabled) {
|
|
|
|
if (isAlive || common.enabled) {
|
|
|
|
getComPorts(settings.params.comName);
|
|
|
|
//
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|