Skip to content

Commit

Permalink
[ISSUE #182] Introduce timestamp uml-seuqnce-id
Browse files Browse the repository at this point in the history
- Implemented the UTS uml-sequence-id
- Removed the reference to OEM-specific trace
- Removed the redundant "qdlt.h" include
- Extended the source code comments
- Updated README.md

Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
  • Loading branch information
Vladyslav Goncharuk committed Nov 15, 2023
1 parent 98d23a4 commit 7517758
Show file tree
Hide file tree
Showing 6 changed files with 1,135 additions and 16 deletions.
17 changes: 13 additions & 4 deletions dltmessageanalyzerplugin/src/common/Definitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,28 @@ const QString sVARPrefix = "VAR_";
//////// UML_IDENTIFIERS ////////
const QString s_UML_SEQUENCE_ID = "USID"; // - optional
const QString s_UML_CLIENT = "UCL"; // - mandatory
const QString s_UML_REQUEST = "URT"; // - mandatory
const QString s_UML_RESPONSE = "URS"; // - mandatory
const QString s_UML_EVENT = "UEV"; // - mandatory
const QString s_UML_REQUEST = "URT"; // - request type
const QString s_UML_RESPONSE = "URS"; // - request type
const QString s_UML_EVENT = "UEV"; // - request type
const QString s_UML_SERVICE = "US"; // - mandatory
const QString s_UML_METHOD = "UM"; // - mandatory
const QString s_UML_ARGUMENTS = "UA"; // - optional
const QString s_UML_TIMESTAMP = "UTS"; // - optional
const QString s_UML_ALIAS_DELIMITER = "_";
const QString s_Regex_options = "(?J)";

static tUML_IDs_Map createUMLIDsMap()
{
tUML_IDs_Map result;

{
tUML_ID_Item item;
item.id_type = eUML_ID_Type::e_Optional;
item.id_str = s_UML_TIMESTAMP;
item.description = "Call timestamp";
result.insert(std::make_pair(eUML_ID::UML_TIMESTAMP, item));
}

{
tUML_ID_Item item;
item.id_type = eUML_ID_Type::e_Optional;
Expand Down Expand Up @@ -1010,7 +1019,7 @@ tItemMetadata::tUpdateUMLInfoResult tItemMetadata::updateUMLInfo(const tFoundMat
* E.g. for the following string:
* UI
* IF1
* [daimler.if1verbose] 10886 MainMultiSeat#2:RP : setIsClientConnected() [unknown:0]]
* [comp.if1verbose] 10886 Service#2:RP : setIsClientConnected() [unknown:0]]
* With the following regex:
* ^(?<UCL>[\w]+) IF1 .*\] (?<USID>[\d]+) (?<US>[A-Za-z]+#[\d]+):(?<URS>RP) : (?<UM>[\w])\((?<UA>.*)\) \[unknown
* We will need to fill in the following information:
Expand Down
3 changes: 2 additions & 1 deletion dltmessageanalyzerplugin/src/common/Definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ extern const QString sRegexScriptingDelimiter;

enum class eUML_ID
{
UML_SEQUENCE_ID = 0,
UML_TIMESTAMP = 0,
UML_SEQUENCE_ID,
UML_CLIENT ,
UML_REQUEST,
UML_RESPONSE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ static void UML_sequence_identifiers()
{
QString id_type_msg = QString("Type - ").append(getUMLIDTypeAsString(item.second.id_type));

if(item.first == eUML_ID::UML_TIMESTAMP)
{
id_type_msg.append(" - if not specified, the dlt message timestamp is used");
}

if(item.second.id_type == eUML_ID_Type::e_RequestType)
{
id_type_msg.append(" - at least one of the request types should be filled in");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* @brief Implementation of the CSearchResultModel class
*/

#include "qdlt.h"

#include "CSearchResultModel.hpp"
#include "components/log/api/CLog.hpp"
#include "components/settings/api/ISettingsManager.hpp"
Expand Down Expand Up @@ -342,6 +340,16 @@ std::pair<int /*rowNumber*/, QString /*diagramContent*/> CSearchResultModel::get
UMLRepresentationResult.second.append(str);
}
break;
case eUML_ID::UML_TIMESTAMP:
{
QString str;
str.append("[");
str.append( message.mid(range.from, range.to - range.from + 1) );
str.append("] ");

UMLRepresentationResult.second.append(str);
}
break;
default:
{
UMLRepresentationResult.second.append(message.mid(range.from, range.to - range.from + 1));
Expand Down Expand Up @@ -372,21 +380,52 @@ std::pair<int /*rowNumber*/, QString /*diagramContent*/> CSearchResultModel::get
str.append("\"");

// let's directly use client-defined value, ignoring value from the group
UMLRepresentationResult.first = true;
UMLRepresentationResult.second.append(str);
}
break;
case eUML_ID::UML_TIMESTAMP:
{
const auto column = eSearchResultColumn::Timestamp;
QString timestampVal = getStrValue(row, column);
QString str;
str.reserve(timestampVal.size() + 3);
str.append("[");
str.append( timestampVal );
str.append("] ");

// let's use dlt's native timestamp
UMLRepresentationResult.second.append(str);
}
break;
default:
{
// let's directly use client-defined value, ignoring value from the group
UMLRepresentationResult.first = true;
UMLRepresentationResult.second.append(item.UML_Custom_Value);
}
break;
}

UMLRepresentationResult.first = true;
}
}
}
else
{
if(UML_ID == eUML_ID::UML_TIMESTAMP)
{
const auto column = eSearchResultColumn::Timestamp;
QString timestampVal = getStrValue(row, column);
QString str;
str.reserve(timestampVal.size() + 3);
str.append("[");
str.append( timestampVal );
str.append("] ");

// let's use dlt's native timestamp
UMLRepresentationResult.second.append(str);
UMLRepresentationResult.first = true;
}
}

return UMLRepresentationResult;
};
Expand Down Expand Up @@ -414,10 +453,7 @@ std::pair<int /*rowNumber*/, QString /*diagramContent*/> CSearchResultModel::get
appendUMLData(eUML_ID::UML_SERVICE);
subStr.append(" : ");
int wrappingStartingPoint = subStr.size();
subStr.append("[");
const auto column = eSearchResultColumn::Timestamp;
subStr.append( getStrValue(row, column) );
subStr.append("] ");
appendUMLData(eUML_ID::UML_TIMESTAMP);
appendUMLData(eUML_ID::UML_SEQUENCE_ID);
subStr.append(" ");
insertMethodFormattingRange.from = subStr.size();
Expand Down
Loading

0 comments on commit 7517758

Please sign in to comment.