Skip to content

Commit

Permalink
[ISSUE #111][COMPONENTS] Introduce components architecture in the pro…
Browse files Browse the repository at this point in the history
…ject

1. [x] Have you followed the guidelines in our [Contributing document](../blob/master/CONTRIBUTING.md)?
2. [x] Have you checked to ensure there aren't other open [Pull Requests](../pulls) for the same update/change?
3. [x] Have you built the project, and performed manual testing of your functionality for all supported platforms - Linux and Windows?
4. [x] Is your change backward-compatible with the previous version of the plugin?

>>> Change description:

- Creation of the separate component from the analyzer folder of the project
- Adaptation of the project
- Update of the class diagrams
- Update of README

>>> Verification criteria:

- Manually checked on the Windows platform
- All sanity checks on Git Hub were passed
  • Loading branch information
svlad-90 committed Dec 8, 2020
1 parent c2cdc00 commit 34f2a1f
Show file tree
Hide file tree
Showing 66 changed files with 1,812 additions and 1,000 deletions.
3 changes: 2 additions & 1 deletion dltmessageanalyzerplugin/src/CDLTMessageAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include "groupedView/CGroupedViewModel.hpp"
#include "searchView/CSearchResultModel.hpp"
#include "analyzer/IDLTMessageAnalyzerController.hpp"
#include "components/analyzer/api/IDLTMessageAnalyzerController.hpp"
#include "common/CBGColorAnimation.hpp"
#include "patternsView/CPatternsView.hpp"
#include "filtersView/CFiltersView.hpp"
Expand Down Expand Up @@ -1800,5 +1800,6 @@ PUML_PACKAGE_BEGIN(DMA_Root)
PUML_COMPOSITION_DEPENDENCY_CHECKED(CRegexDirectoryMonitor, 1, 1, contains)
PUML_COMPOSITION_DEPENDENCY_CHECKED(CTableMemoryJumper, 1, 1, contains)
PUML_COMPOSITION_DEPENDENCY_CHECKED(CConsoleInputProcessor, 1, 1, contains)
PUML_USE_DEPENDENCY_CHECKED(IDLTMessageAnalyzerController, 1, 1, gets and feeds to IDLTMessageAnalyzerControllerConsumer)
PUML_CLASS_END()
PUML_PACKAGE_END()
2 changes: 1 addition & 1 deletion dltmessageanalyzerplugin/src/CDLTMessageAnalyzer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


#include "common/Definitions.hpp"
#include "analyzer/IDLTMessageAnalyzerControllerConsumer.hpp"
#include "components/analyzer/api/IDLTMessageAnalyzerControllerConsumer.hpp"

#include "QElapsedTimer"

Expand Down
13 changes: 11 additions & 2 deletions dltmessageanalyzerplugin/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ DMA_sync_plantuml()
DMA_sync_framework()
################### DEPENDENCIES ( END )###################

################### DEFINES ###############################
# enables generation of diagrams within DMA_Framework
add_definitions(-DPUML_ENABLED)
# enables force link which is used by DMA_Framework in diagrams generation
add_definitions(-DDMA_FORCE_LINK_ON)
################### DEFINES ( END ) #######################

################### COMPATIBILITY #########################
# Turn this on if you want build, compatible with the PLUGIN_INTERFACE_VERSION "1.0.0"
# add_definitions(-DPLUGIN_API_COMPATIBILITY_MODE_1_0_0)
Expand Down Expand Up @@ -72,6 +79,7 @@ TARGET_LINK_LIBRARIES(antlr4_PCRE_static antlr4_static)

################### DLT_MESSAGE_ANALYZER ##################
QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/form.ui )
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

################### PROJECT ###############################
enable_testing()
Expand All @@ -87,8 +95,8 @@ endif()

include_directories(../../thirdparty/DMA_Plantuml/src)

DMA_add_subdirectory_with_clang_tidy(analyzer)
DMA_add_subdirectory_with_clang_tidy(common)
DMA_add_subdirectory_with_clang_tidy(components)
DMA_add_subdirectory_with_clang_tidy(searchView)
DMA_add_subdirectory_with_clang_tidy(plant_uml)
DMA_add_subdirectory_with_clang_tidy(log)
Expand Down Expand Up @@ -120,7 +128,8 @@ target_link_libraries(DLT-Message-Analyzer
DMA_groupedView
DMA_patternsView
DMA_PCRE
DMA_Plantuml)
DMA_Plantuml
)

if(TURN_OFF_RCC)
set(CMAKE_AUTORCC OFF)
Expand Down
10 changes: 0 additions & 10 deletions dltmessageanalyzerplugin/src/analyzer/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions dltmessageanalyzerplugin/src/analyzer/doc/doc.md

This file was deleted.

1 change: 1 addition & 0 deletions dltmessageanalyzerplugin/src/components/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DMA_add_subdirectory_with_clang_tidy(analyzer)
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,24 @@
#pragma once

#include "memory"

#include "dma/component/IComponent.hpp"

#include "components/analyzer/api/IDLTMessageAnalyzerController.hpp"

class CAnalyzerComponent : public DMA::IComponent
{
public:

CAnalyzerComponent();
std::shared_ptr<IDLTMessageAnalyzerController> getAnalyzerController() const;

virtual const char* getName() const override;

protected:
virtual DMA::tSyncInitOperationResult init() override;
virtual DMA::tSyncInitOperationResult shutdown() override;

private:
std::shared_ptr<IDLTMessageAnalyzerController> mpMessageAnalyzerController;
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
* @author vgoncharuk
* @brief Declaration of the IDLTMessageAnalyzerController class
*/
#ifndef IDLTMESSAGEANALYZERCONTROLLER_HPP
#define IDLTMESSAGEANALYZERCONTROLLER_HPP
#pragma once

#include <QObject>

#include "../common/Definitions.hpp"
#include "common/Definitions.hpp"

//Forward declarations
class IDLTMessageAnalyzerControllerConsumer;
Expand Down Expand Up @@ -88,5 +87,3 @@ class IDLTMessageAnalyzerController: public QObject
};

typedef std::shared_ptr<IDLTMessageAnalyzerController> tDLTMessageAnalyzerControllerPtr;

#endif // IDLTMESSAGEANALYZERCONTROLLER_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
* @author vgoncharuk
* @brief Declaration of the IDLTMessageAnalyzerControllerConsumer class
*/
#ifndef IDLTMESSAGEANALYZERCONTROLLERCONSUMER_HPP
#define IDLTMESSAGEANALYZERCONTROLLERCONSUMER_HPP
#pragma once

#include <QObject>

#include "../common/Definitions.hpp"
#include "common/Definitions.hpp"

//Forward declarations

Expand Down Expand Up @@ -52,4 +51,3 @@ public slots:

typedef std::shared_ptr<IDLTMessageAnalyzerControllerConsumer> tDLTMessageAnalyzerControllerConsumerPtr;
typedef std::weak_ptr<IDLTMessageAnalyzerControllerConsumer> tDLTMessageAnalyzerControllerConsumerWeakPtr;
#endif // IDLTMESSAGEANALYZERCONTROLLERCONSUMER_HPP
25 changes: 25 additions & 0 deletions dltmessageanalyzerplugin/src/components/analyzer/doc/doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[**Go to the previous page**](../../../../../md/dev_docs/dev_docs.md)

----

# DMA_Analyzer

## Standalone package API diagram

![Class diagram with dependencies](../../../../../md/dev_docs/puml/DMA_Analyzer_API_standalone.svg)

## Package API diagram with the first-level dependencies

![Class diagram with dependencies](../../../../../md/dev_docs/puml/DMA_Analyzer_API.svg)

## Standalone package diagram

![Class diagram with dependencies](../../../../../md/dev_docs/puml/DMA_Analyzer_standalone.svg)

## Package diagram with the first-level dependencies

![Class diagram with dependencies](../../../../../md/dev_docs/puml/DMA_Analyzer.svg)

----

[**Go to the previous page**](../../../../../md/dev_docs/dev_docs.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#include "../api/CAnalyzerComponent.hpp"

#include "CContinuousAnalyzer.hpp"
#include "CMTAnalyzer.hpp"

#include "DMA_Plantuml.hpp"

#include "dma/base/ForceLink.hpp"

CAnalyzerComponent::CAnalyzerComponent():
mpMessageAnalyzerController(nullptr)
{
// force linkage references in order to have consistent diagrams
DMA_FORCE_LINK_REFERENCE(INamedObject)
}

const char* CAnalyzerComponent::getName() const
{
return "CAnalyzerComponent";
}

DMA::tSyncInitOperationResult CAnalyzerComponent::init()
{
DMA::tSyncInitOperationResult result;

try
{
auto pMTController = IDLTMessageAnalyzerController::createInstance<CMTAnalyzer>();
mpMessageAnalyzerController = IDLTMessageAnalyzerController::createInstance<CContinuousAnalyzer>(pMTController);

result.bIsOperationSuccessful = true;
result.returnCode = 0;
}
catch (...)
{}

return result;
}

DMA::tSyncInitOperationResult CAnalyzerComponent::shutdown()
{
DMA::tSyncInitOperationResult result;
result.bIsOperationSuccessful = true;
result.returnCode = 0;
return result;
}

std::shared_ptr<IDLTMessageAnalyzerController>
CAnalyzerComponent::getAnalyzerController() const
{
return mpMessageAnalyzerController;
}

PUML_PACKAGE_BEGIN(DMA_Analyzer)
PUML_CLASS_BEGIN(CAnalyzerComponent)
PUML_INHERITANCE_CHECKED(DMA::IComponent, implements)
PUML_COMPOSITION_DEPENDENCY_CHECKED(CContinuousAnalyzer, 1, 1, contains)
PUML_USE_DEPENDENCY_CHECKED(CMTAnalyzer, 1, 1, creates and feeds into CContinuousAnalyzer)
PUML_CLASS_END()
PUML_PACKAGE_END()
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
#include "qdlt.h"

#include "CContinuousAnalyzer.hpp"
#include "IDLTMessageAnalyzerControllerConsumer.hpp"
#include "../api/IDLTMessageAnalyzerControllerConsumer.hpp"
#include "functional"
#include "QTimer"
#include "QDebug"

#include "../dltWrappers/CDLTFileWrapper.hpp"
#include "dltWrappers/CDLTFileWrapper.hpp"

#include "DMA_Plantuml.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
* @author vgoncharuk
* @brief Declaration of the CContinuousAnalyzer class
*/
#ifndef CCONTINUOUSANALYZER_HPP
#define CCONTINUOUSANALYZER_HPP
#pragma once

#include "IDLTMessageAnalyzerController.hpp"
#include "IDLTMessageAnalyzerControllerConsumer.hpp"
#include "../api/IDLTMessageAnalyzerController.hpp"
#include "../api/IDLTMessageAnalyzerControllerConsumer.hpp"
#include "functional"
#include "QRegularExpression"

Expand Down Expand Up @@ -114,5 +113,3 @@ class CContinuousAnalyzer : public IDLTMessageAnalyzerController
tSubRequestDataMap mSubRequestDataMap;
tRequestId mRequestIdCounter;
};

#endif // CCONTINUOUSANALYZER_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

#include "QDebug"

#include "../common/Definitions.hpp"
#include "common/Definitions.hpp"

#ifdef DEBUG_BUILD
#include "QElapsedTimer"
#endif

#include "../settings/CSettingsManager.hpp"
#include "../log/CLog.hpp"
#include "settings/CSettingsManager.hpp"
#include "log/CLog.hpp"
#include "CDLTRegexAnalyzerWorker.hpp"

#include "DMA_Plantuml.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
* @author vgoncharuk
* @brief Declaration of the CDLTRegexAnalyzerWorker class
*/
#ifndef CDLTREGEXANALYZERWORKER_HPP
#define CDLTREGEXANALYZERWORKER_HPP
#pragma once

#include "memory"
#include "set"
#include "map"

#include <QRegularExpression>

#include "../common/Definitions.hpp"
#include "IDLTMessageAnalyzerController.hpp"
#include "common/Definitions.hpp"
#include "../api/IDLTMessageAnalyzerController.hpp"

typedef int tWorkerThreadCookie;

Expand Down Expand Up @@ -49,5 +48,3 @@ public slots:
tWorkerId mWorkerId;
QVector<QColor> mColors;
};

#endif // CDLTREGEXANALYZERWORKER_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
#include "qdlt.h"

#include "CMTAnalyzer.hpp"
#include "../dltWrappers/CDLTFileWrapper.hpp"
#include "IDLTMessageAnalyzerControllerConsumer.hpp"
#include "../dltWrappers/CDLTMsgWrapper.hpp"
#include "../log/CLog.hpp"
#include "../common/cpp_extensions.hpp"
#include "dltWrappers/CDLTFileWrapper.hpp"
#include "../api/IDLTMessageAnalyzerControllerConsumer.hpp"
#include "dltWrappers/CDLTMsgWrapper.hpp"
#include "log/CLog.hpp"
#include "common/cpp_extensions.hpp"

#include "DMA_Plantuml.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
* @author vgoncharuk
* @brief Declaration of the CMTAnalyzer class
*/
#ifndef CDLTMESSAGEANALYZERCONTROLLER_HPP
#define CDLTMESSAGEANALYZERCONTROLLER_HPP
#pragma once

#include <list>

#include <QRegularExpression>

#include "../common/Definitions.hpp"
#include "common/Definitions.hpp"

#include "IDLTMessageAnalyzerController.hpp"
#include "../api/IDLTMessageAnalyzerController.hpp"
#include "CDLTRegexAnalyzerWorker.hpp"

//Forward declarations
Expand Down Expand Up @@ -107,5 +106,3 @@ private slots:
tRequestMap mRequestMap;
tRequestId mRequestIdCounter;
};

#endif // CDLTMESSAGEANALYZERCONTROLLER_HPP
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
qt5_wrap_cpp(PROCESSED_MOCS
../api/IDLTMessageAnalyzerControllerConsumer.hpp
../api/IDLTMessageAnalyzerController.hpp)

add_library(DMA_analyzer STATIC
IDLTMessageAnalyzerController.cpp
IDLTMessageAnalyzerControllerConsumer.cpp
CMTAnalyzer.cpp
CContinuousAnalyzer.cpp
CDLTRegexAnalyzerWorker.cpp
CAnalyzerComponent.cpp
${PROCESSED_MOCS}
)

################### QT ####################################
target_link_libraries(DMA_analyzer PUBLIC qdlt Qt5::Widgets DMA_framework_base DMA_framework_component)
################### QT ( END ) ############################
Loading

0 comments on commit 34f2a1f

Please sign in to comment.