DLT-Message-Analyzer

"Extended search" plugin for the DLT-viewer

View on GitHub

Go to the previous page

Table of Contents

  1. Search
  2. Regex text editor
  3. How the search string is formed?
  4. Continuous search
  5. Case sensitive search
  6. Regex errors handling
  7. Regex history
  8. Regex group name glosssary
  9. Used regex engine

Search

This chapter describes the general aspects of the plugin’s search functionality.


Regex text editor

To search within the opened dlt file, the user should provide his input into the regex text editor:

Screenshot of the regex text editor

A text editor adjusts its height based on the provided content. The editor’s default maximum height is four lines of text. When reached, the scrollbar will appear to allow user navigation within the complex regular expression.

The user can adjust the maximum height from 1 to 10 using the following context menu item:

Screenshot of the 'set regex text edit max-height' context menu item


How the search string is formed?

The default search string is formed based on the following columns:

Apid + “ “ + Ctid + “ “ + Payload

But it is possible to adjust that. More information on this topic is located here.


Note!

Above means that you can easily:

  • filter out messages of the specific application - e.g. ^DLTD
  • filter out messages, which originate from the specific context id of all applications - e.g. ^[\w]{1,4} CTX
  • filter out messages, which originate from the specific context id of the specific application - e.g. ^SYS JOUR
  • use your already existing regex expression, which does not consider the above filtering capabilities

Together with the increased speed of the search this way of filtering becomes much more comfortable, than the usage of the usual dlt-viewer’s filters.

However, the search is fully compatible with the usage of the dlt-viewer’s filters.


Another thing, which differs between the “dlt-viewer’s search” and the “plugin’s search” is that DLT Message Analyzer allows getting the continuous updates of the search results.

Simply start the search:

Screenshot of the start of the search

You will see, that in case if your HU is connected, the search will continue to proceed with adding more and more results:

Screenshot of the connected ECU

Screenshot of the connected ECU


Note!

The continuous search will stop in the following cases:

  • loss of connection to the target
  • if the user presses the “Stop search” button

Be default the search is case insensitive. But, it is easy to change that via the search input field’s context menu:

Screenshot of the "Case sensitive search" context-menu item

The changed setting would be persisted and applied to all the next search operations.


Regex errors handling

In case if the user makes a mistake in the provided regex, the plugin will give a status bar notification with a description of the error, which was provided by the used regex engine:

Screenshot of the attempt to apply regex which contains the error

Notification message contains the col number, at which an error has occurred. In addition to that, the regex text edit will jump to the error location and will select the col number character, which contains an error.

The same kind of error handling is also supported in the other menus, where user can enter the regexes, e.g. during the edit operation of the previously saved pattern:

Screenshot of the attempt to save the regex which contains the error


Regex history

The DLT Message Analyzer plugin supports the regex history functionality:

Screenshot of the regex history feature

The history is filled in from two sources:

The main aspects of this feature are:


Regex group name glossary

The DLT Message Analyzer plugin heavily uses the regular expression group names feature. The plugin interprets the regex group names to tokenize each regular expression group name and the text it contains and uses that data for feature-specific purposes. For example, it gets X and Y data for the plot points, method names for sequence diagram arrows, RGB codes for text highlighting, indexes for grouped view data nesting, etc.

Too many features use this mechanism, making it hard for the user to remember all supported regular expression group names without continuously cross-checking the plugin’s documentation. This feature adds a glossary within the plugin so that the user can reference supported group name templates on the fly.

To use the feature:

Note! Some regular expression group names require the user to input the parameter values. E.g. for the color, the injected regular expression group name would be the following:

(?<RGB_[RED]_[GREEN]_[BLUE]>colored_text)

The user is given a hint to input values for the RED, GREEN, and BLUE color components. The parameter names are intentionally wrapped with the ‘[’, ‘]’ symbols to increase readability and provoke the error if the user doesn’t fill them in:

Screenshot of the error caused by the non-filled-in parameter


Used regex engine

The plugin’s implementation is using the QRegularExpression regex engine, which is a PCRE one. It works much faster than the QRegExp, which is still used in the dlt-viewer’s v.2.19.0.

Qt documentation itself tells:

https://doc.qt.io/qt-5/qregularexpression.html#notes-for-qregexp-users

The QRegularExpression class introduced in Qt 5 is a big improvement upon QRegExp, in terms of APIs offered, supported pattern syntax, and speed of execution.

And we’ve checked that. It works faster and provides deeper support of the regex syntax.


Go to the previous page