Update main.js
This commit is contained in:
parent
44014f6ca0
commit
6934206d18
21
main.js
21
main.js
@ -287,11 +287,10 @@ function checkObjects(options, regType, regName, regFullName, tasks, newObjects)
|
||||
common: {
|
||||
name: regs[i].description,
|
||||
role: regs[i].role,
|
||||
type: regType === 'coils' || regType === 'disInputs' ? 'boolean' :
|
||||
((regs[i].type === 'string' || regs[i].type === 'string') ? 'string' : 'number'),
|
||||
type: regs[i].type,
|
||||
read: true,
|
||||
write: regType === 'coils' || regType === 'holdingRegs',
|
||||
def: regType === 'coils' || regType === 'disInputs' ? false : 0
|
||||
write: true,
|
||||
def: regs[i].type === 'boolean' ? false : regs[i].value
|
||||
},
|
||||
native: {
|
||||
regType: regType,
|
||||
@ -299,21 +298,11 @@ function checkObjects(options, regType, regName, regFullName, tasks, newObjects)
|
||||
deviceId: regs[i].deviceId
|
||||
}
|
||||
};
|
||||
|
||||
if (regType === 'coils') {
|
||||
objects[id].native.poll = regs[i].poll;
|
||||
objects[id].native.wp = regs[i].wp;
|
||||
} else
|
||||
if (regType === 'inputRegs' || regType === 'holdingRegs') {
|
||||
objects[id].common.unit = regs[i].unit || '';
|
||||
|
||||
objects[id].native.type = regs[i].type;
|
||||
objects[id].native.len = regs[i].len;
|
||||
objects[id].native.offset = regs[i].offset;
|
||||
objects[id].native.factor = regs[i].factor;
|
||||
if (regType === 'holdingRegs') {
|
||||
objects[id].native.poll = regs[i].poll;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.push({
|
||||
id: regs[i].id,
|
||||
|
Loading…
Reference in New Issue
Block a user