-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* QML executor plugin Signed-off-by: Remigiusz Kołłątaj <[email protected]> Co-authored-by: Sebastian Wieczorek <[email protected]> Co-authored-by: Remigiusz Kołłątaj <[email protected]> Co-authored-by: Remigiusz Kołłątaj <[email protected]>
- Loading branch information
1 parent
7748b6a
commit 4acee7b
Showing
31 changed files
with
2,538 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
set(COMPONENT_NAME qmlexecutor) | ||
|
||
set(SRC | ||
gui/qmlexecutor.ui | ||
gui/qmlexecutorguiimpl.h | ||
gui/qmlexecutorguiint.h | ||
qmlexecutor.cpp | ||
qmlexecutor_p.cpp | ||
qmlexecutormodel.cpp | ||
canbusmodel.hpp | ||
) | ||
|
||
set(QT_QML_LIBS Qt5::Quick Qt5::Widgets Qt5::Qml Qt5::QuickWidgets) | ||
|
||
add_library(${COMPONENT_NAME} ${SRC}) | ||
target_link_libraries(${COMPONENT_NAME} cds-common ${QT_QML_LIBS}) | ||
target_include_directories(${COMPONENT_NAME} INTERFACE ${Qt5Widgets_INCLUDE_DIRS}) | ||
target_include_directories(${COMPONENT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
if(WITH_TESTS) | ||
|
||
add_executable(${COMPONENT_NAME}_test tests/${COMPONENT_NAME}_test.cpp tests/guimock.h) | ||
target_link_libraries(${COMPONENT_NAME}_test ${COMPONENT_NAME} Qt5::Test fakeit ${QT_QML_LIBS}) | ||
add_test(NAME ${COMPONENT_NAME}_test COMMAND ${COMPONENT_NAME}_test) | ||
|
||
add_executable(${COMPONENT_NAME}model_test tests/${COMPONENT_NAME}model_test.cpp) | ||
target_link_libraries(${COMPONENT_NAME}model_test ${COMPONENT_NAME} Qt5::Test fakeit ${QT_QML_LIBS}) | ||
add_test(NAME ${COMPONENT_NAME}model_test COMMAND ${COMPONENT_NAME}model_test) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#ifndef CANBUSMODEL_HPP | ||
#define CANBUSMODEL_HPP | ||
|
||
#include <QObject> | ||
#include <QCanBusFrame> | ||
|
||
/** | ||
* @brief The CANBusModel class is used to interface CAN operations with QML stack | ||
*/ | ||
class CANBusModel : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
CANBusModel() : QObject(nullptr) {} | ||
|
||
signals: | ||
/** | ||
* @brief Sends a CAN frame | ||
* @param frameId frame identifier | ||
* @param frameData frame payload | ||
*/ | ||
void sendFrame(const quint32& frameId, const QByteArray& frameData); | ||
|
||
/** | ||
* @brief Send a CAN named signal | ||
* @param name signal name | ||
* @param value signal value | ||
*/ | ||
void sendSignal(const QString& name, const QVariant& value); | ||
|
||
/** | ||
* @brief A CAN frame was received | ||
* @param frameId frame identifier | ||
* @param frameData frame payload | ||
*/ | ||
void frameReceived(const quint32& frameId, const QByteArray& frameData); | ||
|
||
/** | ||
* @brief A CAN signal was received | ||
* @param signal name | ||
* @param signal value | ||
*/ | ||
void signalReceived(const QString& name, const QVariant& value); | ||
|
||
/** | ||
* @brief The simulation was started | ||
*/ | ||
void simulationStarted(); | ||
|
||
/** | ||
* @brief The simulation was stopped | ||
*/ | ||
void simulationStopped(); | ||
}; | ||
|
||
#endif // CANBUSMODEL_HPP |
Oops, something went wrong.