This commit is contained in:
Kellermorph
2026-08-22 09:52:01 +02:00
parent dbe2bcb599
commit 2f6fb7808a
5 changed files with 86 additions and 76 deletions
+13
View File
@@ -99,6 +99,19 @@ class ElementData : public PropertiesInterface
int terminalCount = 1; ///< Number of terminals for this IO (1-4)
QStringList terminals; ///< Terminal values T1, T2, ... (size = terminalCount)
/**
* @brief Return terminal labels, generating defaults (T1, T2...) if empty
*/
QStringList effectiveTerminals() const {
if (!terminals.isEmpty())
return terminals;
int count = qMax(terminalCount, 1);
QStringList defaults;
for (int i = 0; i < count && i < 4; ++i)
defaults << QStringLiteral("T%1").arg(i + 1);
return defaults;
}
bool operator==(const PlcIO &other) const {
return type == other.type
&& address == other.address