mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-27 20:44:13 +02:00
6380e2a46b
addPlcIO/setPlcIO/removePlcIO edit a PLC master's IO table (type, address, function text, comment) directly through setElementData(), the same as MasterPropertiesWidget's own PLC IO editor -- and, like it, these are not undoable: MasterPropertiesWidget::associatedUndo() deliberately returns nullptr for PLC masters, since their linking is managed through the IO table rather than the link-tree widget it would otherwise build an unlink-all command from. linkElements() gains an optional groupIndex so a PLC slave can be linked onto one specific IO row instead of leaving the row unspecified. LinkElementCommand only reads the group index it is given when the command's own element is the Slave -- when built from the Master side (a=master, b=slave, the usual call shape) it looks in a per-slave map this call never populates, and setGroupIndex() is silently a no-op. Fixed by building the command from whichever of the two elements is actually the Slave, matching what PlcLinkWidget does. elementLinkGroupIndex() reads the result back. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>