mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-03 10:34:14 +02:00
Fix-PLC-Manager
This commit is contained in:
@@ -978,7 +978,7 @@ void MasterPropertiesWidget::plcUpdateDisplaySettings()
|
||||
ElementData::PlcMasterData plc_data = ed.plcMasterData();
|
||||
plc_data.ios.clear();
|
||||
|
||||
// Read IOs from table
|
||||
// Read IOs from table, preserving terminal data from original IOs
|
||||
for (int row = 0; row < m_plc_table->rowCount(); ++row) {
|
||||
ElementData::PlcIO io;
|
||||
|
||||
@@ -1002,6 +1002,13 @@ void MasterPropertiesWidget::plcUpdateDisplaySettings()
|
||||
if (crossref_item)
|
||||
io.crossRef = crossref_item->text();
|
||||
|
||||
// Preserve terminal data from the original IO
|
||||
if (row < ed.plcMasterData().ios.size()) {
|
||||
const auto &orig_io = ed.plcMasterData().ios.at(row);
|
||||
io.terminalCount = orig_io.terminalCount;
|
||||
io.terminals = orig_io.terminals;
|
||||
}
|
||||
|
||||
plc_data.ios.append(io);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user