Update main.js
This commit is contained in:
parent
2dea08a96a
commit
e4eba580d9
34
main.js
34
main.js
@ -228,10 +228,11 @@ function prepareConfig(config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let deviceIds = [];
|
let deviceIds = [];
|
||||||
checkDeviceIds(options, config.disInputs, deviceIds);
|
|
||||||
checkDeviceIds(options, config.coils, deviceIds);
|
//checkDeviceIds(options, config.disInputs, deviceIds);
|
||||||
checkDeviceIds(options, config.inputRegs, deviceIds);
|
//checkDeviceIds(options, config.coils, deviceIds);
|
||||||
checkDeviceIds(options, config.holdingRegs, deviceIds);
|
//checkDeviceIds(options, config.inputRegs, deviceIds);
|
||||||
|
//checkDeviceIds(options, config.holdingRegs, deviceIds);
|
||||||
deviceIds.sort();
|
deviceIds.sort();
|
||||||
|
|
||||||
// settings for master
|
// settings for master
|
||||||
@ -249,15 +250,7 @@ function prepareConfig(config) {
|
|||||||
port: parseInt(params.port, 10) || 502,
|
port: parseInt(params.port, 10) || 502,
|
||||||
bind: params.bind
|
bind: params.bind
|
||||||
};
|
};
|
||||||
} else {
|
}
|
||||||
options.config.serial = {
|
|
||||||
comName: params.comName,
|
|
||||||
baudRate: params.baudRate,
|
|
||||||
dataBits: params.dataBits,
|
|
||||||
stopBits: params.stopBits,
|
|
||||||
parity: params.parity
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let d = 0; d < deviceIds.length; d++) {
|
for (let d = 0; d < deviceIds.length; d++) {
|
||||||
let deviceId = deviceIds[d];
|
let deviceId = deviceIds[d];
|
||||||
@ -427,15 +420,7 @@ function checkObjects(options, regType, regName, regFullName, tasks, newObjects)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// localOptions = {
|
|
||||||
// multiDeviceId
|
|
||||||
// showAliases
|
|
||||||
// doNotRoundAddressToWord
|
|
||||||
// directAddresses
|
|
||||||
// isSlave
|
|
||||||
// maxBlock
|
|
||||||
// maxBoolBlock
|
|
||||||
// };
|
|
||||||
function iterateAddresses(isBools, deviceId, result, regName, regType, localOptions) {
|
function iterateAddresses(isBools, deviceId, result, regName, regType, localOptions) {
|
||||||
const config = result.config;
|
const config = result.config;
|
||||||
if (config && config.length) {
|
if (config && config.length) {
|
||||||
@ -551,9 +536,14 @@ function iterateAddresses(isBools, deviceId, result, regName, regType, localOpti
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parseConfig(callback) {
|
function parseConfig(callback) {
|
||||||
|
|
||||||
|
adapter.log.warn('adapter.config=' + adapter.config);
|
||||||
|
|
||||||
let options = prepareConfig(adapter.config);
|
let options = prepareConfig(adapter.config);
|
||||||
const params = adapter.config.params;
|
const params = adapter.config.params;
|
||||||
|
|
||||||
|
adapter.log.warn('options=' + options);
|
||||||
|
|
||||||
const localOptions = {
|
const localOptions = {
|
||||||
multiDeviceId: options.config.multiDeviceId,
|
multiDeviceId: options.config.multiDeviceId,
|
||||||
showAliases: (params.showAliases === true || params.showAliases === 'true'),
|
showAliases: (params.showAliases === true || params.showAliases === 'true'),
|
||||||
|
Loading…
Reference in New Issue
Block a user