Skip to content

Commit

Permalink
Merge pull request #213 from svlad-90/dev/vladyslav-goncharuk/ISSUE-37
Browse files Browse the repository at this point in the history
[ISSUE #37][COVERAGE_NOTE] Introduce coverage note functionality
  • Loading branch information
svlad-90 authored Oct 26, 2024
2 parents 715f986 + 8283388 commit 35e004f
Show file tree
Hide file tree
Showing 94 changed files with 5,968 additions and 734 deletions.
677 changes: 674 additions & 3 deletions LICENSE.txt

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@

----

## v.1.0.28 released!
## <span style="color:red">v.1.0.29 released!</span>

<span style="color:red">Checkout the ['Gantt chart'](./md/plot_view/plot_view.md#gantt-charts) support!</span>

----

## Implemented features targeted for release v1.0.29:

<span style="color:red">Use the HEAD revision to try out the following features:</span>
New features in release v.1.0.29:

- [Coverage note](./md/coverage_note/coverage_note.md)
- [Grouped view highlighting](./md/grouped_view/grouped_view.md#highlighting-the-group-in-the-search-view)
- [Regex history](.//md/search/search.md#regex-history)

Expand Down Expand Up @@ -99,6 +94,10 @@ There are the following schemas of deployment:

- Plugin supports integration with the QCustomPlot library, which allows you to create plots out of the logs

### [Coverage note](./md/coverage_note/coverage_note.md)

- Plugin supports creation of the coverage note and exporting it to JSON and HTML formats

### [Files view](./md/files_view/files_view.md)

- Extension, which lists the paths & names of all currently opened DLT files
Expand Down
23 changes: 23 additions & 0 deletions dltmessageanalyzerplugin/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,28 @@ function (DMA_sync_q_custom_plot)
endfunction(DMA_sync_q_custom_plot)
################### QCUSTOMPLOT ( END ) ###################

################### NLOHMANN_JSON #########################
# function - sync_qcustomplot
# Syncs QCustomPlot, implementation, which is used for
# the creation of plots
function (DMA_sync_nlohmann_json)
include(FetchContent)
FetchContent_Declare(
nlohmannjson
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.11.3
)

FetchContent_GetProperties(nlohmannjson)
if(NOT nlohmannjson_POPULATED)
FetchContent_Populate(nlohmannjson)
add_subdirectory(${nlohmannjson_SOURCE_DIR} ${nlohmannjson_BINARY_DIR})
endif()

include_directories(${nlohmannjson_SOURCE_DIR}/include)
endfunction(DMA_sync_nlohmann_json)
################### QCUSTOMPLOT ( END ) ###################

################### COMMON_DEPS ###########################
include(FetchContent)
FetchContent_Declare(
Expand Down Expand Up @@ -83,6 +105,7 @@ DMA_sync_g_test_framework()
DMA_sync_plantuml()
DMA_sync_framework()
DMA_sync_q_custom_plot()
DMA_sync_nlohmann_json()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
install(TARGETS qcustomplot LIBRARY DESTINATION ${DLT_LIBRARY_INSTALLATION_PATH} )
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
Expand Down
1 change: 1 addition & 0 deletions dltmessageanalyzerplugin/src/common/BaseDefinitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct tQStringPtrWrapper
tQStringPtrWrapper();
tQStringPtrWrapper(const tQStringPtr& pString_);
bool operator== ( const tQStringPtrWrapper& rVal ) const;
bool operator!= ( const tQStringPtrWrapper& rVal ) const;
bool operator< ( const tQStringPtrWrapper& rVal ) const;
tQStringPtr pString = nullptr;
};
Expand Down
18 changes: 16 additions & 2 deletions dltmessageanalyzerplugin/src/common/Definitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,11 @@ bool tQStringPtrWrapper::operator== ( const tQStringPtrWrapper& rVal ) const

return ( *pString == *rVal.pString );
}

bool tQStringPtrWrapper::operator!= ( const tQStringPtrWrapper& rVal ) const
{
return !(*this == rVal);
}
//////////////////////////////////////////////////////////////////////////

struct tAnalysisRange
Expand Down Expand Up @@ -3613,6 +3618,10 @@ PUML_PACKAGE_BEGIN(Qt)
PUML_CLASS_END()
PUML_CLASS_BEGIN(QFileSystemWatcher)
PUML_CLASS_END()
PUML_CLASS_BEGIN(QTextEdit)
PUML_CLASS_END()
PUML_CLASS_BEGIN(QListView)
PUML_CLASS_END()
PUML_PACKAGE_END()

PUML_PACKAGE_BEGIN(DLT)
Expand All @@ -3622,16 +3631,16 @@ PUML_PACKAGE_BEGIN(DLT)
PUML_INTERFACE_END()
PUML_INTERFACE_BEGIN(QDltPluginViewerInterface)
PUML_INTERFACE_END()
#ifdef PLUGIN_API_COMPATIBILITY_MODE_1_0_0
PUML_CLASS_BEGIN(QDltPlugin)
PUML_CLASS_END()
PUML_CLASS_BEGIN(QDltPluginManager)
PUML_CLASS_END()
#endif
PUML_CLASS_BEGIN(QDltFile)
PUML_CLASS_END()
PUML_CLASS_BEGIN(QDltMsg)
PUML_CLASS_END()
PUML_CLASS_BEGIN(QListView)
PUML_CLASS_END()
PUML_PACKAGE_END()

PUML_PACKAGE_BEGIN(qcustomplot)
Expand All @@ -3654,3 +3663,8 @@ PUML_CLASS_END()
PUML_INHERITANCE(QObject, extends)
PUML_CLASS_END()
PUML_PACKAGE_END()

PUML_PACKAGE_BEGIN(nlohmann_json)
PUML_CLASS_BEGIN(nlohmann::json)
PUML_CLASS_END()
PUML_PACKAGE_END()
50 changes: 50 additions & 0 deletions dltmessageanalyzerplugin/src/common/Definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,4 +768,54 @@ tQStringPtr getDataStrFromMsg(const tMsgId& msgId, const tMsgWrapperPtr &pMsg, e
*/
QColor getChartColor();

/**
* @enum eTabIndexes
* @brief This enumeration defines the indexes of different views
* used as tab positions in the QTabWidget.
*/
enum class eTabIndexes
{
/**
* @brief Index for the search view tab.
* @details Represents the position of the Search View in the QTabWidget.
*/
SEARCH_VIEW = 0,

/**
* @brief Index for the grouped view tab.
* @details Represents the position of the Grouped View in the QTabWidget.
*/
GROUPED_VIEW = 1,

/**
* @brief Index for the UML view tab.
* @details Represents the position of the UML View in the QTabWidget.
*/
UML_VIEW = 2,

/**
* @brief Index for the plot view tab.
* @details Represents the position of the Plot View in the QTabWidget.
*/
PLOT_VIEW = 3,

/**
* @brief Index for the coverage note view tab.
* @details Represents the position of the Coverage Note View in the QTabWidget.
*/
COVERAGE_NOTE_VIEW = 4,

/**
* @brief Index for the files view tab.
* @details Represents the position of the Files View in the QTabWidget.
*/
FILES_VIEW = 5,

/**
* @brief Index for the console view tab.
* @details Represents the position of the Console View in the QTabWidget.
*/
CONSOLE_VIEW = 6
};

#endif // DEFINITIONS_HPP
1 change: 1 addition & 0 deletions dltmessageanalyzerplugin/src/components/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DMA_add_subdirectory_with_clang_tidy(analyzer)
DMA_add_subdirectory_with_clang_tidy(coverageNote)
DMA_add_subdirectory_with_clang_tidy(filtersView)
DMA_add_subdirectory_with_clang_tidy(groupedView)
DMA_add_subdirectory_with_clang_tidy(log)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DMA_add_subdirectory_with_clang_tidy(src)
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#pragma once

#include "memory"

#include "QTextEdit"
#include "QTableView"
#include "QPushButton"

#include "common/Definitions.hpp"
#include "dma/component/IComponent.hpp"
#include "components/settings/api/ISettingsManager.hpp"

#include "ICoverageNoteProvider.hpp"

/**
* @brief Class representing the coverage note component.
*
* This component is responsible for managing the coverage notes functionality.
*/
class CCoverageNoteComponent : public DMA::IComponent
{
public:
/**
* @brief Constructor for CCoverageNoteComponent.
*
* @param pSettingsManager Pointer to the settings manager.
* @param pCommentTextEdit Pointer to the QTextEdit for comments.
* @param pItemsTableView Pointer to the QTableView for items.
* @param MessagesTextEdit Pointer to the QTextEdit for messages.
* @param pRegexTextEdit Pointer to the QTextEdit for regex.
* @param pUseRegexButton Pointer to the QPushButton for using regex.
* @param pCurrentFileLineEdit Pointer to the QLineEdit for current file.
* @param pFilesViewTextEdit Pointer to the QTextEdit for files view.
*/
CCoverageNoteComponent(const tSettingsManagerPtr& pSettingsManager,
QTextEdit* pCommentTextEdit,
QTableView* pItemsTableView,
QTextEdit* MessagesTextEdit,
QTextEdit* pRegexTextEdit,
QPushButton* pUseRegexButton,
QLineEdit* pCurrentFileLineEdit,
QTextEdit* pFilesViewTextEdit);

/**
* @brief Gets the name of the component.
*
* @return The name of the component as a const char pointer.
*/
virtual const char* getName() const override;

/**
* @brief Gets the coverage note provider pointer.
*
* @return A shared pointer to the ICoverageNoteProvider.
*/
const tCoverageNoteProviderPtr& getCoverageNoteProviderPtr();

/**
* @brief Sets the main table view for the component.
*
* @param pMainTableView Pointer to the QTableView to be set as the main table view.
*/
void setMainTableView(QTableView* pMainTableView);

protected:
/**
* @brief Initializes the component.
*
* @return The result of the initialization operation.
*/
virtual DMA::tSyncInitOperationResult init() override;

/**
* @brief Shuts down the component.
*
* @return The result of the shutdown operation.
*/
virtual DMA::tSyncInitOperationResult shutdown() override;

private:
tCoverageNoteProviderPtr mpCoverageNoteProvider; ///< Pointer to the coverage note provider.
tSettingsManagerPtr mpSettingsManager; ///< Pointer to the settings manager.
QTextEdit* mpCommentTextEdit; ///< Pointer to the comment text edit.
QTableView* mpItemsTableView; ///< Pointer to the items table view.
QTextEdit* mpMessagesTextEdit; ///< Pointer to the messages text edit.
QTextEdit* mpRegexTextEdit; ///< Pointer to the regex text edit.
QPushButton* mpUseRegexButton; ///< Pointer to the use regex button.
QLineEdit* mpCurrentFileLineEdit; ///< Pointer to the current file line edit.
QTextEdit* mpFilesViewTextEdit; ///< Pointer to the file view text edit.
QTableView* mpMainTableView; ///< Pointer to the main table view.
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#pragma once

#include "QObject"
#include "QTableView"

#include "../api/Types.hpp"

/**
* @brief Interface class for providing coverage note functionalities.
*
* This class serves as an interface for managing coverage note items,
* including adding items, setting regex and messages, and handling
* externally triggered coverage note UI interactions.
*/
class ICoverageNoteProvider : public QObject
{
Q_OBJECT

public:
/**
* @brief Constructor for ICoverageNoteProvider.
* @param parent The parent QObject, default is nullptr.
*/
ICoverageNoteProvider(QObject *parent = nullptr);

/**
* @brief Virtual destructor for ICoverageNoteProvider.
*/
virtual ~ICoverageNoteProvider();

/**
* @brief Adds a new coverage note item.
* @return The ID of the newly added coverage note item.
*/
virtual tCoverageNoteItemId addCoverageNoteItem() = 0;

/**
* @brief Sets the regex pattern for a coverage note item.
* @param id The ID of the coverage note item.
* @param regex The regex pattern to set.
*/
virtual void setCoverageNoteItemRegex(const tCoverageNoteItemId& id, const QString& regex) = 0;

/**
* @brief Sets the message for a coverage note item.
* @param id The ID of the coverage note item.
* @param comment The message/comment to set.
*/
virtual void setCoverageNoteItemMessage(const tCoverageNoteItemId& id, const QString& comment) = 0;

/**
* @brief Scrolls to the last coverage note item in the UI.
*/
virtual void scrollToLastCoveageNoteItem() = 0;

/**
* @brief Sets the main table view for creation of comments
* from the main dlt-viewer's table.
* @param pMainTableView Pointer to the main QTableView.
*/
virtual void setMainTableView(QTableView* pMainTableView) = 0;

/**
* @brief Shuts down the coverage note provider, releasing any resources.
*/
virtual void shutdown() = 0;

signals:
/**
* @brief Signal emitted when regex application is requested.
* @param regex The regex pattern to apply.
*/
void regexApplicationRequested(const QString& regex);

/**
* @brief Signal emitted when a request is made to add a comment from the main table.
*/
void addCommentFromMainTableRequested();
};

/**
* @brief Shared pointer for ICoverageNoteProvider.
*/
typedef std::shared_ptr<ICoverageNoteProvider> tCoverageNoteProviderPtr;
Loading

0 comments on commit 35e004f

Please sign in to comment.