更新 main.js

master
钟进 6 years ago
parent fd6f66f5cb
commit c451c36934

@ -345,6 +345,7 @@ function checkObjects(options, regType, regName, regFullName, tasks, newObjects)
regs[i].fullId = id;
objects[id] = {
_id: regs[i].id,
type: 'state',
@ -363,28 +364,26 @@ function checkObjects(options, regType, regName, regFullName, tasks, newObjects)
deviceId: regs[i].deviceId
}
};
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;
}
}
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;
objects[id].native.poll = regs[i].poll;
tasks.push({
id: regs[i].id,
name: 'add',
obj: objects[id]
});
tasks.push({
id: id,
name: 'syncEnums',
obj: regs[i].room
});
newObjects.push(id);
}

Loading…
Cancel
Save