更新 index.html

This commit is contained in:
2019-01-16 04:57:19 +00:00
parent 9e62c39736
commit 795e0bb309

View File

@@ -154,34 +154,6 @@
var typeItemsLen = {
'uint8be': 1,
'uint8le': 1,
'int8be': 1,
'int8le': 1,
'uint16be': 1,
'uint16le': 1,
'int16be': 1,
'int16le': 1,
'int16be1': 1,
'int16le1': 1,
'uint32be': 2,
'uint32le': 2,
'uint32sw': 2,
'uint32sb': 2,
'int32be': 2,
'int32le': 2,
'int32sw': 2,
'int32sb': 2,
'uint64be': 4,
'uint64le': 4,
'int64be': 4,
'int64le': 4,
'floatbe': 2,
'floatle': 2,
'floatsw': 2,
'floatsb': 2,
'doublebe': 4,
'doublele': 4,
'string': 0,
'stringle': 0
};
@@ -357,9 +329,6 @@
}
function switchAll(data) {
switchOneType(data, 'disInputs');
switchOneType(data, 'coils');
switchOneType(data, 'inputRegs');
switchOneType(data, 'holdingRegs');
if ($('#modbus_showAliases').prop('checked')) {
$('.offsets').show();
@@ -400,59 +369,14 @@
// todo read roles and expand this list
var roleItems = [
{value: '', text: ''},
{value: 'value', text: 'value'},
{value: 'level', text: 'level'},
{value: 'state', text: 'state'},
{value: 'switch', text: 'switch'},
{value: 'value.temperature', text: 'value.temperature'},
{value: 'value.humidity', text: 'value.humidity'},
{value: 'value.brightness', text: 'value.brightness'},
{value: 'value.uv', text: 'value.uv'},
{value: 'value.pressure', text: 'value.pressure'},
{value: 'value.battery', text: 'value.battery'},
{value: 'value.valve', text: 'value.valve'},
{value: 'value.time', text: 'value.time'},
{value: 'value.interval', text: 'value.interval'},
{value: 'value.window', text: 'value.window'},
{value: 'button', text: 'button'},
{value: 'indicator', text: 'indicator'},
{value: 'level.dimmer', text: 'level.dimmer'},
{value: 'level.valve', text: 'level.valve'},
{value: 'level.blind', text: 'level.blind'},
{value: 'level.temperature', text: 'level.temperature'},
{value: 'level.interval', text: 'level.interval'}
{value: 'indicator', text: 'indicator'}
];
var typeItems = [
{value: '', text: ''},
{value: 'uint16be', text: 'Unsigned 16 bit (Big Endian)'},
{value: 'uint16le', text: 'Unsigned 16 bit (Little Endian)'},
{value: 'int16be', text: 'Signed 16 bit (Big Endian)'},
{value: 'int16le', text: 'Signed 16 bit (Little Endian)'},
{value: 'uint32be', text: 'Unsigned 32 bit (Big Endian)'},
{value: 'uint32le', text: 'Unsigned 32 bit (Little Endian)'},
{value: 'uint32sw', text: 'Unsigned 32 bit (Big Endian Word Swap)'},
{value: 'uint32sb', text: 'Unsigned 32 bit (Big Endian Byte Swap)'},
{value: 'int32be', text: 'Signed 32 bit (Big Endian)'},
{value: 'int32le', text: 'Signed 32 bit (Little Endian)'},
{value: 'int32sw', text: 'Signed 32 bit (Big Endian Word Swap)'},
{value: 'int32sb', text: 'Signed 32 bit (Big Endian Byte Swap)'},
{value: 'uint64be', text: 'Unsigned 64 bit (Big Endian)'},
{value: 'uint64le', text: 'Unsigned 64 bit (Little Endian)'},
{value: 'uint8be', text: 'Unsigned 8 bit (Big Endian)'},
{value: 'uint8le', text: 'Unsigned 8 bit (Little Endian)'},
{value: 'int8be', text: 'Signed 8 bit (Big Endian)'},
{value: 'int8le', text: 'Signed 8 bit (Little Endian)'},
// {value: 'int64be', text: 'Signed 64 bit (Big Endian)'},
// {value: 'int64le', text: 'Signed 64 bit (Little Endian)'},
{value: 'floatbe', text: 'Float (Big Endian)'},
{value: 'floatle', text: 'Float (Little Endian)'},
{value: 'floatsw', text: 'Float (Big Endian Word Swap)'},
{value: 'floatsb', text: 'Float (Big Endian Byte Swap)'},
{value: 'doublebe', text: 'Double (Big Endian)'},
{value: 'doublele', text: 'Double (Little Endian)'},
{value: 'string', text: 'String (Zero-end)'},
{value: 'stringle', text: 'String (Little Endian, Zero-end)'}
{value: 'int8le', text: 'Signed 8 bit (Little Endian)'}
];
var roomsItems = [{value: '', text: ''}];
@@ -478,18 +402,6 @@
{name: 'cw' , title: _('CW'), type: 'checkbox', width: '35px'},
{ type: 'control', width: '80px'}
];
if (_id === 'modbus_disInputs' || _id === 'modbus_inputRegs') {
fields.splice(11, 3);
}
if (_id === 'modbus_coils' || _id === 'modbus_disInputs') {
fields.splice(4, 5);
}
if (parseInt($('#modbus_slave').val())) {
fields.splice(13, 1);
fields.splice(1, 1);
} else if (!$('#modbus_multiDeviceId').prop('checked')) {
fields.splice(1, 1);
}
var g = $('#' + _id).jsGrid({
width: 'auto',
@@ -669,15 +581,6 @@
} else {
if ($('#modbus_showAliases').prop('checked')) {
if (id === 'disInputs') {
obj.item._address = data.params.disInputsOffset;
} else if (id === 'coils') {
obj.item._address = data.params.coilsOffset;
} else if (id === 'inputRegs') {
obj.item._address = data.params.inputRegsOffset;
} else if (id === 'holdingRegs') {
obj.item._address = data.params.holdingRegsOffset;
}
obj.item.address = alias2address(id, obj.item._address, isDirect);
} else {
obj.item.address = 0;
@@ -876,9 +779,7 @@
if (systemLang === 'de') {
translate_de();
} else if (systemLang === 'ru') {
translate_ru();
}
}
if (typeof localStorage !== 'undefined') {
activePage = localStorage['modbuspage'];
@@ -1050,24 +951,6 @@
callback(obj);
}
/*var _map = {
0: 7,
1: 6,
2: 5,
3: 4,
4: 3,
5: 2,
6: 1,
7: 0,
8: 15,
9: 14,
10: 13,
11: 12,
12: 11,
13: 10,
14: 9,
15: 8
};*/
var _rmap = {
0: 15,
1: 14,