summaryrefslogtreecommitdiffstats
path: root/examples/serialbus/modbus
Commit message (Collapse)AuthorAgeFilesLines
* Fix modbus client/server examples for missing QtSerialPortJoerg Bornemann2023-01-182-2/+6
| | | | | | | | Fixes: QTBUG-109940 Change-Id: I477d0da422ff2f3a35a035620b93d44112f4c802 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit cc12e9055ab97332a3709440458a881cb6147af3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Port from qAsConst() to std::as_const()Marc Mutz2022-11-121-1/+1
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. This is a 6.4 re-run of the script we ran in dev, in order to avoid conflicts between the branches when cherry-picking. Change-Id: I5eca3df3179dfb2b2682c75a479ba9a4259cc703 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Polish the modbus client exampleFriedemann Kleint2022-10-124-59/+84
| | | | | | | | | | | | | | - Use modern string literals - Use QCommandLineParser to switch on verbose mode - Fix translated texts with arguments - Streamline some code - Remove unused member variable - Use QVariant casts Change-Id: Ie3bdaa82856bfe8df020dc289de9177d098f02d3 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> (cherry picked from commit 101295aef757747490fb5533710d9e10bf303d19) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use SPDX license identifiersLucie Gérard2022-06-1024-1107/+48
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Ie17b09db5a4aa7bb0d33906360f1125e9632425c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 3c9b4c67f87ee28aba216029173feee8b41aa221) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve examples CMakeLists.txtKai Köhne2022-02-173-29/+10
| | | | | | | | | | | | | | | | | | - Remove "# generated from xyz.pro" comment from pro2cmake - Remove automatic use of CMAKE_AUTORCC - Only opt into CMAKE_AUTOUIC if .ui files are involved - Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR where not necessary - Combine multiple find_package(Qt6 ... calls) - use REQUIRED COMPONENTS - sort components alphabetically - Fix wrong indentations - Use (only) one empty line after multi-line commands Pick-to: 6.3 Change-Id: I66b7edaf699db528ed91f738a009aaa2423e3d80 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Switch examples to build as isolated sub-buildsAlexandru Croitor2021-12-151-3/+3
| | | | | | | Pick-to: 6.2 6.3 Task-number: QTBUG-90820 Change-Id: Idf2121e678bebac834531e23bf5928c02384ba96 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-173-3/+3
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I821f412f9dbe11ae99ffd888a7ab2ba415ed9379 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix examples to search for the Network packageAlexandru Croitor2021-08-123-0/+3
| | | | | | | | | | | | | | A previous change added an explicit link dependency to the examples without searching for the package first. Amends 4a2828a3d30fa1e4760a6778b8b58569caefb632 Pick-to: 6.2 Task-number: QTBUG-86533 Fixes: QTBUG-95387 Change-Id: I6d5fb5d3d62acc877e096951e0a6d70b5d63baa8 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Explicitly link against the built QtNetwork libraryAlexandru Croitor2021-07-233-0/+3
| | | | | | | | | | | | | This is to ensure that the pre-existing QtNetwork library from the b2qt SDK sysroot in the CI is not picked up. This is likely a consequence of CMake not adding an -rpath-link flag when linking. See QTBUG-86533 for details. Task-number: QTBUG-86533 Pick-to: 6.2 Change-Id: Id05d49812f957c8a6c12c03f5ff633015bd63103 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix QModbusDataUnit inconsistent signedness for params and return valuesKarsten Heimrich2021-04-082-6/+6
| | | | | | Fixes: QTBUG-73743 Change-Id: I49f71488a80cc008bdcfda9c478a956b4151c2e3 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix "No such signal QButtonGroup::buttonClicked(int)"Karsten Heimrich2021-03-261-2/+2
| | | | | | | | | The signal got removed long time ago but stayed unoticed in the example cause of the use of the SIGNAL/ SLOT macro. Change-Id: I632a03eecb508ec38b86955809e700aba187f000 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Modbus: Remove unused variable from custom exampleAndre Hartmann2021-03-181-1/+0
| | | | | Change-Id: Ide7505ebf0184978cf8973e863efa16f01e230b6 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Adapt, improve and verify documentationKarsten Heimrich2021-03-173-4/+54
| | | | | | | | Fixes: QTBUG-91211 Change-Id: I38dc720402f0b1a9806ce39c31dbbd52f7d66aa6 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix Modbus adueditor example depending on private headersKarsten Heimrich2021-03-1012-2828/+0
| | | | | | | | | | | Since our public nor private API can be modified in a way to keep the application working, and, since we need to have such an app to generate invalid and/or illigal frames to test the error handling of the Modbus server, move the example into manual tests. Fixes: QTBUG-55270 Change-Id: I1bc541f19f7327833cc74e9b80065b236969dc3c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove now superfluous QOverload invocationsKarsten Heimrich2021-03-043-13/+12
| | | | | | Task-number: QTBUG-91213 Change-Id: I0ca8f4d87fd356966a449675c7c18bc70f7c92dc Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Reword example and documentations from master/slave to client/serverKarsten Heimrich2021-03-0238-64/+58
| | | | | | | | Task-number: QTBUG-91213 Task-number: QTBUG-91212 Task-number: QTBUG-91211 Change-Id: I2b585d73b5fa3194459709fa57d44a8f42dceeed Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename and deprecate QModbusRtuSerialSlave and QModbusRtuSerialMasterKarsten Heimrich2021-03-023-6/+6
| | | | | | | | | | This change follows the recommendation announced by the Modbus organization in the press release of July 9th, 2020. Task-number: QTBUG-91213 Change-Id: Id946eea900b620a7f021caa30ae40e3f0b0c3dc4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add Modbus custom function code exampleKarsten Heimrich2021-03-0119-1/+1868
| | | | | | Task-number: QTBUG-91212 Change-Id: I5df9e33186acb5216335ec1010f6694bcbab9376 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix some typosKarsten Heimrich2021-02-232-3/+3
| | | | | Change-Id: Ied9bcecc57838f41ba4435afdc995dc5194c0681 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Port to CMakeAndreas Buhr2021-01-274-0/+184
| | | | | | | Task-number: QTBUG-90399 Change-Id: I0521231e7d61809f38c44215b5cd923b292b9e02 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-12-201-1/+1
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I76cbcea127f326d61bfb9420e4afe0b260a3f190 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Use QList instead of QVectorJarek Kobus2020-08-171-1/+1
| | | | | | Task-number: QTBUG-84469 Change-Id: I3a3cd127fb9fed7b25d543a9c5af75c734397806 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Update dependencies and fix related issuesAlex Blasche2020-06-101-0/+5
| | | | | Change-Id: I7a84d3acea165128c0a9dcb4dec1929d5fe5aeab Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Remove usages of deprecated QLatin1LiteralSona Kurazyan2019-06-252-2/+2
| | | | | | Task-number: QTBUG-76491 Change-Id: I8e16068e04b5f04ab7873697075e19a5ec760d54 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix Qt6 buildSona Kurazyan2019-06-242-5/+5
| | | | | | | Added 'Qt::' prefixes where missing. Change-Id: I97d5d9fa78d7c1feaef4caae72b735ea0625a081 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-04-161-1/+1
|\ | | | | | | | | | | | | Conflicts: examples/serialbus/modbus/adueditor/modbustcpclient_p.h Change-Id: I620bfce752a957fdcd068c44ff039d84b7502edc
| * Add context information to QObject::connect(...) callsKarsten Heimrich2019-04-011-1/+1
| | | | | | | | | | Change-Id: I3888da16e5152c479deeb3e5bfbb8d0dd587cea8 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* | Cleanup and modernize the Modbus examplesAndre Hartmann2019-02-1315-135/+162
|/ | | | | | | | | | | | | | * Replace static_cast with QOverload * Fix some Clang warnings * Mark user-visible strings with tr() * Disable verbose log output * Replace auto-connect with explicit functor-style connect * Initialize members at declaration * Small style cleanup Change-Id: Idcb6c24a8733e7fd659ad4750ce0798a72c84af6 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove hard QtSerialPort dependency from QtSerialBusAlex Blasche2018-11-079-3/+47
| | | | | | Task-number: QTBUG-70360 Change-Id: I511e368e227a46f9eba178612c8b106f5930ee49 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Migrate the modbus example to use QRegularExpressionSamuel Gaist2018-06-201-2/+3
| | | | | | | | | This patch updates the modbus example MainWindow class to use QRegularExpression in place of QRegExp which is to be considered deprecated. Change-Id: Ie030b695a1885c5e1ffc2511da2381c5df6b958a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename master example title to "Client"Alex Blasche2018-03-011-1/+1
| | | | | | | | | | The slave example already uses the Server terminology in the same spot. This change makes the master example consistent with the slave example. The client/server terminology is much easier to understand than Modbus' Master/Slave terminology. Change-Id: Ic99cc75f223394faba8dcd62f144edd76a9dd50a Reviewed-by: André Hartmann <aha_1980@gmx.de>
* qtlite: Skip building examples when configured with no-feature-itemviewsRainer Keller2018-01-123-0/+3
| | | | | | Task-number: QTBUG-53141 Change-Id: I04c3627ca94de9277d7c09365b4de6a382187c62 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta4Liang Qi2017-10-3021-48/+238
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Icfbad81955ad8a7c4ddc49ac4ee952bcba6317ec
| * Fix outdated BSD license headerKai Koehne2017-10-2019-38/+228
| | | | | | | | | | | | Change-Id: Ifdd8f08e12f471aee37f749b4ad911ab7b6adb2a Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| * Fix outdated FDL license headerKai Koehne2017-10-202-10/+10
| | | | | | | | | | | | Change-Id: Ib7a43e822a32f7e0c77055baeef4f0fba33092a5 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | modbus: Remove unused 'this' lambda captureDenis Shienkov2017-10-201-1/+1
|/ | | | | | | | | | | | | This commit fixes following clang warning: warning: lambda capture 'this' is not used [-Wunused-lambda-capture] connect(m_device, &QModbusDevice::stateChanged, [this] (QModbusDevice::State state) { ^ Change-Id: I487b8f024bdf8e0c18acb10dad370a230c796d92 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Fix address counter for received modbus register entriesAlex Blasche2017-08-101-1/+1
| | | | | | | | THis happens when the number of retrieved entries is larger than 1. Task-number: QTBUG-62421 Change-Id: I250d528914d887d0c9be34cd828763f87a5099e7 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9v5.9.0-beta1Liang Qi2017-03-3119-20/+20
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/canbus/canbus.pro src/plugins/canbus/vectorcan/vectorcanbackend.cpp Change-Id: I3625693784e88204c93479806242ae70c7ec7ff3
| * modbus master example: fix nonsensical codeMarc Mutz2017-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Pointed out by GCC 7: writeregistermodel.cpp:117:48: warning: enum constant in boolean context [-Wint-in-bool-context] if (index.column() == HoldingColumn && Qt::EditRole) { // holding registers ^~~~~~~~ Change-Id: I5d0f19c0480b027109c6a751f69852114cb634b2 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com>
| * Updated copyright headersAndre Hartmann2017-02-0219-19/+19
| | | | | | | | | | Change-Id: I7d38491c7ee15a1de788375acf9144c59b507d2a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Eradicate Q_FOREACH loops and mark the module as Q_FOREACH-freeAndre Hartmann2017-01-112-5/+6
|/ | | | | Change-Id: I4ec52799514b750c158e3cb8e6c38d1f1063c6c5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Replace QOverload with C++11 "using TypeId" patternAlex Blasche2016-09-061-1/+2
| | | | | | | | | It appears QOverload is not quite accepted by all compilers. In particular OSX 10.11.6 seems to have problems. Task-number: QTBUG-55747 Change-Id: Idff19ba41836fc7cebb8a837d999189427f30f66 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove ambiguity when using QTimer::setInterval() pointer in examplev5.8.0-alpha1Alex Blasche2016-08-311-1/+2
| | | | | | | | This is required because QTimer introduced a new overload for setInterval(). Change-Id: I7dbf2eb9b424132439fc420b84584d2f55498c3c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Make adueditor compile on platforms with QT_NO_CLIPBOARDAlex Blasche2016-06-031-0/+2
| | | | | | | | Task-number: QTBUG-53277 Change-Id: I24d019696e73171154c8c29a5f76d9fc1737645c Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Fix misspelled settingFrank Meerkoetter2016-05-021-1/+1
| | | | | | Change-Id: I00c9c755118a4c1cde11db9d8a06045f2a0f3775 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* add example installsOswald Buddenhagen2016-04-283-0/+9
| | | | | Change-Id: I9a42406c973a0933125106d610fb0547b4cc5bb0 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Use enums instead of defines in WriteRegisterModelDenis Shienkov2016-04-261-26/+21
| | | | | | | Change-Id: I3c4f15d2ad5f48ede2902a10cba5445b19e2dcdc Reviewed-by: Ralf Nolden <nolden@kde.org> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Replace 'Q_DECL_OVERRIDE' with 'override'Denis Shienkov2016-04-262-7/+7
| | | | | Change-Id: Iebbd61359296499600fe164429e710273a94b86d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Use 'auto' where it is possibleDenis Shienkov2016-04-224-9/+9
| | | | | | Change-Id: I3d915a6230a1f35317abc39d6266a9d46a5d9be6 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Adjust Pointer and Reference to Qt Coding StyleAndre Hartmann2016-04-226-11/+11
| | | | | Change-Id: Ifa233b324a82209cb597b5cf555b4e290b890e10 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>