summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* CAN Example: Fix entering invalid chars in CAN ID inputAndre Hartmann2019-04-291-1/+1
| | | | | | | | | | | | | | The old code returned Intermediate for invalid inputs (e.g. chars outside the A-F range or special characters), because input.toUInt() returned 0 for these cases. Fix that by checking ok from input.toUInt(&ok) first. To allow clearing an edit field containing valid input with backspace again, an additional isEmpty() check has to be added. Change-Id: I4ae28e35ca21611fc5f323b26cdeca75257f1352 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-06-231-2/+3
|\ | | | | | | Change-Id: Ica7f98ed62f5374526c8d7406487f523befe83fa
| * 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>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-121-1/+1
|\| | | | | | | Change-Id: I1ab92643c96792ee03cc3f77a6eaa1fd239890ae
| * Modernize CAN bus exampleAndre Hartmann2018-05-111-1/+1
| | | | | | | | | | Change-Id: I3f732cf739c598b7725ca43a90f98d0ac9f76750 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | CAN-Example: Show data bitrate in the status bar alsoAndre Hartmann2018-03-151-4/+14
|/ | | | | | Change-Id: Ie3b357645c8beb4d6e048d309e04f6abbe02824d Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> 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>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-204-0/+4
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ibcb5508d7f131cbeba0d047111177a8dff1e5f68
| * qtlite: Skip building examples when configured with no-feature-itemviewsRainer Keller2018-01-124-0/+4
| | | | | | | | | | | | Task-number: QTBUG-53141 Change-Id: I04c3627ca94de9277d7c09365b4de6a382187c62 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Add more info to QCanBusDeviceInfoAndre Hartmann2018-01-122-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added description, serial number and channel for SocketCAN, PeakCAN, SystecCAN, and VectorCAN plugins. For now, not all plugins do support all kind of information: SocketCAN: description and channel PeakCAN: description and channel (Windows PCANBasic >= 4.2.0) SystecCAN: description, serial number, and channel VectorCAN: description, serial number, and channel [ChangeLog][QCanBusDeviceInfo] Added description, serial number and channel to QCanBusDeviceInfo, as far as supported by the various plugins. Change-Id: Ib2292e06065eb91848f682ebf69a4cc968f4d4ba Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-2030-68/+357
|\| | | | | | | Change-Id: Ia04f54eee1264b659d8928b7f08d7221f587bc54
| * Fix outdated BSD license headerLiang Qi2017-11-162-4/+24
| | | | | | | | | | Change-Id: I93a7fa404ade8b55a1410956ba9b17976fec71d0 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| * Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta4Liang Qi2017-10-3028-62/+322
| |\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Icfbad81955ad8a7c4ddc49ac4ee952bcba6317ec
| | * Fix outdated BSD license headerKai Koehne2017-10-2026-52/+312
| | | | | | | | | | | | | | | | | | 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>
| * | canbus: Add missed 'explicit' keyword to CAN-bus exampleDenis Shienkov2017-10-211-1/+1
| | | | | | | | | | | | | | | Change-Id: I589d1e907552a7a2cfe17d08c1c72de7a5068779 Reviewed-by: André Hartmann <aha_1980@gmx.de>
| * | 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>
| * | CAN-Example: Disable Send button if frame id is emptyv5.10.0-beta1Andre Hartmann2017-10-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every CAN frame needs a CAN-ID to be sent. Disable the Send button with a informative tooltip if this condition is not met. Change-Id: I77033a36c4a45c136185135776ef79185dc548be Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | CAN: Introduce categorized loggingAndre Hartmann2017-11-131-0/+3
|/ / | | | | | | | | | | | | | | | | | | [ChangeLog][CAN bus] Introduced categorized logging to the CAN bus module which can be enabled by the "qt.canbus" and "qt.canbus.plugins.<pluginname>" filters. Change-Id: Ib39c0b2ebcd967cd7812602190807ad3488ccb18 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | CAN-Example: Fix Clang semantic warningAndre Hartmann2017-08-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | Semantic Issue -Wimplicit-fallthrough 103:5: warning: unannotated fall-through between switch labels 103:5: note: insert 'break;' to avoid fall-through Change-Id: I191ea47160eb27d994e0a1a7435b57418a094cdf Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-151-1/+1
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ib884bd5bddf08b7c03cedd6941d60f157f128912
| * 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>
* | Fix namespace build of can bus exampleAlex Blasche2017-07-181-0/+2
| | | | | | | | | | | | Change-Id: Ia3e9fcd129cf61669bb666f32e60820c88e9c547 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | CAN-Example: Add a dedicated send frame group boxAndre Hartmann2017-07-177-145/+514
| | | | | | | | | | | | | | | | | | | | | | | | | | | | By moving the send frame logic to a separate panel, the MainWindow gets easier to understand as it only connects signals to slots. The new SendFramesBox also does more sanity check on the parameters (options that exclude each other are checked) and forbids invalid input by using QValidators. The payload input is also prettified with spaces. This was first done by InputMasks but this had strange side effects so now the input validator is used for this task also. Change-Id: Ib95605ce4bc23b52d1cf5d082b1533b2a59f7749 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN-Example: Show errors and number of frames written in the UIAndre Hartmann2017-07-112-4/+11
| | | | | | | | | | | | Change-Id: I1a8a14abee0cb533d454f67c8fca35099d8b4c1d Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN-Example: Simplify payload handlingAndre Hartmann2017-07-111-8/+2
| | | | | | | | | | | | Change-Id: I538ec95b2465e610b19d955e2f4bd34d98e680f8 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN-Example: Rename slots to describe their purpose betterAndre Hartmann2017-07-112-15/+12
| | | | | | | | | | Change-Id: Ic63e01635273704196b8fc6e4f00d6aff409f5ab Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN-Example: Inline very short functionAndre Hartmann2017-07-102-11/+5
| | | | | | | | | | | | | | Change-Id: Iccbf9091d138cedacc74b043db5f83b686b7c27e Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN-Example: Rename all occurrences of "backend" to "plugin"Andre Hartmann2017-07-104-18/+18
| | | | | | | | | | | | | | | | | | | | The first parameter of QCanBus::createDevice() is called "plugin", so use this term in our examples to avoid confusion. Change-Id: I2fc28731d3763e037c18a7030205dad5d54183cd Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN-Example: Init all user interface actions in one functionAndre Hartmann2017-07-071-4/+2
| | | | | | | | | | | | | | Change-Id: I7a89ad9cf150b2bacedbb3ab246d5d89c0d92e56 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN-Example: Remove unneeded QAction::setEnabled() callsAndre Hartmann2017-07-071-2/+0
| | | | | | | | | | | | | | | | | | Both actions were already enabled in the UI file. Change-Id: I39d39f77a31c8b7b724a0c961c35caf159ed69a2 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | QCanBusFrame: Introduce local echo flagAndre Hartmann2017-07-041-5/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Inspiration for change after reading the SocketCAN mailing list thread: https://marc.info/?l=linux-can&m=147438437202356&w=2 The main usage is, to verify at application stage, that and when a frame was really sent on the bus. For architectures like SocketCAN, where multiple applications can connect to one CAN bus on the same system, this flag also indicates frames that are sent by an other local running application (i.e. not coming from the real bus). Implementations done for SystecCAN, VectorCAN and SocketCAN plugin. PCAN Basic does not seem to have support for this flag. For SocketCAN, see section "4.1.7 RAW socket returned message flags" in https://www.kernel.org/doc/Documentation/networking/can.txt for reference. [ChangeLog][QCanBusFrame] Added local echo flag to mark all echo frames that are generated by the hardware on successful transmission to CAN bus as such. Change-Id: I66d4ce1ec6dfd0a0b994a7b7a9de1a5f503fcb70 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.9.0' into 5.9Liang Qi2017-05-311-0/+2
|\ | | | | | | Change-Id: I9c93f053c5a6a7af04c79d6e2cc8ded76c906319
| * fix namespaced buildv5.9.0-rc2v5.9.0-rc1v5.9.0Oswald Buddenhagen2017-05-121-0/+2
| | | | | | | | | | Change-Id: I7daa9be5b0b21c0f94021b9a2eb139915c501049 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN Example: Add menu entry to show online documentationAndre Hartmann2017-05-292-0/+13
|/ | | | | | | | | | | | | The different plugins have varying runtime requirements, that should be described in the plugins documentation. Allow the user to open the documentation easily. [ChangeLog][QCanBus] Added a menu to open plugins online documentation to the CAN Example. Change-Id: I2ae19b439f91042c6bcb09a7db079249fb34355c Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9v5.9.0-beta1Liang Qi2017-03-3124-25/+25
|\ | | | | | | | | | | | | | | 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-0224-24/+24
| | | | | | | | | | Change-Id: I7d38491c7ee15a1de788375acf9144c59b507d2a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN: Introduce CAN FD flag Error State Indicator (ESI)Andre Hartmann2017-01-171-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added hasErrorStateIndicator and setErrorStateIndicator to QCanBusFrame. * Setting QCanBusFrame::setErrorStateIndicator(true) also sets QCanBusFrame::setFlexibleDataRateFormat(true) * Setting QCanBusFrame::setFlexibleDataRateFormat(false) also sets QCanBusFrame::setErrorStateIndicator(false) [ChangeLog][QCanBusFrame] Added error state indicator flag to QCanBusFrame and set it appropriate receiving CAN FD frames with the SocketCAN plugin. Setting this flag for testing purposes is also possible. Change-Id: I406b693fc7b7cde8a0d6b2c34c1f313800f11203 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN: Introduce CAN FD Bitrate Switch (BRS)Andre Hartmann2017-01-174-8/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCanBusFrame: Added hasBitrateSwitch and setBitrateSwitch to QCanBusFrame and therefore, increased the QCanBusFrame version number. * Setting QCanBusFrame::setBitrateSwitch(true) also sets QCanBusFrame::setFlexibleDataRateFormat(true) * Setting QCanBusFrame::setFlexibleDataRateFormat(false) also sets QCanBusFrame::setBitrateSwitch(false) QCanBusDevice: Reference implementation and documentation are done for the SocketCAN plugin. The CAN Example allows to send frames with Bitrate Switch enabled and visualize received frames with Bitrate Switch set. Unfortunately, the SocketCAN plugin does not allow to change any bitrate yet, so the newly added data bitrate selection box in ConnectDialog seems a bit useless. This box is however needed once other plugins become CAN FD capable and implement bitrate switching. [ChangeLog][QCanBusFrame] Introduced flag to allow data bitrate switching for CAN FD frames. Reference implementation is done for the SocketCAN plugin. Task-number: QTBUG-56720 Change-Id: Ieab04020f4750c8b0085624d2250ad7cd982cd96 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN-Example: Introduce bitrate selection combox boxAndre Hartmann2017-01-166-55/+202
| | | | | | | | | | | | | | | | Factor the bitrate selection logic out of connect dialog to allow re-using the logic for CAN FD data bitrate selection later. Change-Id: I0a509c6200dddbd6b254a5e7f0702e6b0c99d1a3 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Eradicate Q_FOREACH loops and mark the module as Q_FOREACH-freeAndre Hartmann2017-01-114-7/+8
| | | | | | | | | | Change-Id: I4ec52799514b750c158e3cb8e6c38d1f1063c6c5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN-Example: Remove unneeded include from ConnectDialogAndre Hartmann2017-01-101-1/+0
| | | | | | | | | | | | Change-Id: Ic5c1d48c8b17014df2cc5adf5179c44f4dbd9fd3 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN: Add QCanBusDeviceInfoAndre Hartmann2017-01-103-19/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Returns: * a list of available devices for the chosen plugin * if the device is virtual * if the device is CAN FD capable Use this list in the CAN Example for interface selection. If information about virtual channels or CAN FD capabability is not available, false is returned. For SocketCAN, PeakCAN, VectorCAN and SystecCAN, the implementation is completed. TinyCAN only return the list of possible interfaces for now. This is can be changed later, but needs quite some refactoring of the TinyCAN plugin. [ChangeLog][QtCanBus] Added the new class QCanBusDeviceInfo for enumeration of available CAN interfaces and more information about them. Task-number: QTBUG-54298 Change-Id: I851bcc3b9ee41aaaf1164c6b4a5aaf6503cd8746 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CAN: Add SYS-TEC PluginAndre Hartmann2017-01-051-0/+2
| | | | | | | | | | | | | | | | | | Add Windows support for CAN adapters of www.systec-electronic.com Linux support is available through a SocketCAN driver. Change-Id: Iaf5877d688c9cb404abe20210bd2352e82170d87 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-122-16/+30
|\| | | | | | | | | | | | | Conflicts: examples/serialbus/can/mainwindow.cpp Change-Id: I8d821a832bc5bf966230b4f66f0113929b3114dc
| * QCanBusFrame: add flag to identify CAN FD framesRolf Eike Beer2016-11-151-0/+1
| | | | | | | | | | | | | | | | Task-number: QTBUG-49675 Task-number: QTBUG-56720 Change-Id: Id24783c6ee1b81317d2e6d0965a9ed37987b47ec Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * CAN-Examples: Fix reading only one frame on framesReceived()Andre Hartmann2016-11-111-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signal framesReceived() is emitted, when one or more CAN frames were received from CAN bus. Reading only the first frame may leave more CAN frames in the receive queue, seemingly leading to frame loss. Task-number: QTBUG-56886 Change-Id: I9cbb9451eb67e6058a779aba678beb215f1113e9 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Andreas Wilhelm <aw@emlix.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * CAN-Example: Add action to clear log windowAndre Hartmann2016-11-042-0/+14
| | | | | | | | | | Change-Id: I0ffac644fc510d4657c44085810fff38dba5cd36 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| * CAN-Example: Sort, tighten and unify includesAndre Hartmann2016-11-031-5/+2
| | | | | | | | | | Change-Id: I0477369288b9c9bdcd39fd083172e8b0237aaa1f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>