* @brief Applies all --modbus-register specs and warns if none are present. */
| 960 | * @brief Applies all --modbus-register specs and warns if none are present. |
| 961 | */ |
| 962 | static void applyModbusRegisters(const QCommandLineParser& parser, const QCommandLineOption& opt) |
| 963 | { |
| 964 | IO::ConnectionManager::instance().modbus()->clearRegisterGroups(); |
| 965 | if (!parser.isSet(opt)) { |
| 966 | qWarning() << "No register groups specified. Use --modbus-register to add registers."; |
| 967 | return; |
| 968 | } |
| 969 | |
| 970 | const QStringList registerSpecs = parser.values(opt); |
| 971 | for (const QString& spec : std::as_const(registerSpecs)) |
| 972 | applyModbusRegister(spec); |
| 973 | } |
| 974 | |
| 975 | /** |
| 976 | * @brief Parses a Modbus TCP host[:port] string. |
no test coverage detected