From dfa56d08d28e9895f0d7227c1842141fc402683f Mon Sep 17 00:00:00 2001 From: Nav Date: Wed, 7 Sep 2022 02:19:53 +0100 Subject: [PATCH] New GetTargetState insight worker task --- src/Insight/CMakeLists.txt | 1 + .../InsightWorker/Tasks/GetTargetState.cpp | 10 +++++++++ .../InsightWorker/Tasks/GetTargetState.hpp | 22 +++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 src/Insight/InsightWorker/Tasks/GetTargetState.cpp create mode 100644 src/Insight/InsightWorker/Tasks/GetTargetState.hpp diff --git a/src/Insight/CMakeLists.txt b/src/Insight/CMakeLists.txt index dc929717..30cf93d4 100755 --- a/src/Insight/CMakeLists.txt +++ b/src/Insight/CMakeLists.txt @@ -28,6 +28,7 @@ target_sources( ${CMAKE_CURRENT_SOURCE_DIR}/InsightWorker/Tasks/ReadStackPointer.cpp ${CMAKE_CURRENT_SOURCE_DIR}/InsightWorker/Tasks/QueryLatestVersionNumber.cpp ${CMAKE_CURRENT_SOURCE_DIR}/InsightWorker/Tasks/ReadProgramCounter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/InsightWorker/Tasks/GetTargetState.cpp # Error dialogue window ${CMAKE_CURRENT_SOURCE_DIR}/UserInterfaces/InsightWindow/Widgets/ErrorDialogue/ErrorDialogue.cpp diff --git a/src/Insight/InsightWorker/Tasks/GetTargetState.cpp b/src/Insight/InsightWorker/Tasks/GetTargetState.cpp new file mode 100644 index 00000000..67e05cd3 --- /dev/null +++ b/src/Insight/InsightWorker/Tasks/GetTargetState.cpp @@ -0,0 +1,10 @@ +#include "GetTargetState.hpp" + +namespace Bloom +{ + using TargetController::TargetControllerConsole; + + void GetTargetState::run(TargetControllerConsole& targetControllerConsole) { + emit this->targetState(targetControllerConsole.getTargetState()); + } +} diff --git a/src/Insight/InsightWorker/Tasks/GetTargetState.hpp b/src/Insight/InsightWorker/Tasks/GetTargetState.hpp new file mode 100644 index 00000000..b72f5c5d --- /dev/null +++ b/src/Insight/InsightWorker/Tasks/GetTargetState.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include "InsightWorkerTask.hpp" + +#include "src/Targets/TargetState.hpp" + +namespace Bloom +{ + class GetTargetState: public InsightWorkerTask + { + Q_OBJECT + + public: + GetTargetState() = default; + + signals: + void targetState(Targets::TargetState state); + + protected: + void run(TargetController::TargetControllerConsole& targetControllerConsole) override; + }; +}