This commit is contained in:
Kellermorph
2026-07-29 16:40:17 +02:00
parent b3a8ae898e
commit 3db298996a
+6
View File
@@ -835,6 +835,8 @@ void ElementData::kindInfoFromXml(const QDomElement &xml_element)
if (!xml_names.isNull()) { if (!xml_names.isNull()) {
for (const auto &xml_col : QETXML::findInDomElement(xml_names, QStringLiteral("column"))) { for (const auto &xml_col : QETXML::findInDomElement(xml_names, QStringLiteral("column"))) {
int index = xml_col.attribute(QStringLiteral("index")).toInt(); int index = xml_col.attribute(QStringLiteral("index")).toInt();
if (index < 0 || index >= 5)
continue;
while (m_plc_master_data.columnNames.size() <= index) while (m_plc_master_data.columnNames.size() <= index)
m_plc_master_data.columnNames.append(QString()); m_plc_master_data.columnNames.append(QString());
m_plc_master_data.columnNames[index] = xml_col.text(); m_plc_master_data.columnNames[index] = xml_col.text();
@@ -846,6 +848,8 @@ void ElementData::kindInfoFromXml(const QDomElement &xml_element)
if (!xml_order.isNull()) { if (!xml_order.isNull()) {
QStringList parts = xml_order.text().split(','); QStringList parts = xml_order.text().split(',');
for (const auto &p : parts) { for (const auto &p : parts) {
if (m_plc_master_data.columnOrder.size() >= 5)
break;
bool ok; bool ok;
int val = p.trimmed().toInt(&ok); int val = p.trimmed().toInt(&ok);
if (ok) if (ok)
@@ -861,6 +865,8 @@ void ElementData::kindInfoFromXml(const QDomElement &xml_element)
// Parse IO entries // Parse IO entries
auto xml_ios = xml_plc.firstChildElement(QStringLiteral("plcIOs")); auto xml_ios = xml_plc.firstChildElement(QStringLiteral("plcIOs"));
for (const auto &xml_io : QETXML::findInDomElement(xml_ios, QStringLiteral("plcIO"))) { for (const auto &xml_io : QETXML::findInDomElement(xml_ios, QStringLiteral("plcIO"))) {
if (m_plc_master_data.ios.size() >= 128)
break;
PlcIO io; PlcIO io;
io.type = plcIOTypeFromString( io.type = plcIOTypeFromString(
xml_io.attribute(QStringLiteral("type"), QStringLiteral("entree_digitale"))); xml_io.attribute(QStringLiteral("type"), QStringLiteral("entree_digitale")));