Replaced targetProgramCounterUpdated signal with new ReadProgramCounter Insight worker task.
Also some other bits of tidying
This commit is contained in:
@@ -41,10 +41,6 @@ namespace Bloom
|
||||
std::bind(&InsightWorker::onTargetResetEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<Events::RegistersWrittenToTarget>(
|
||||
std::bind(&InsightWorker::onTargetRegistersWrittenEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<Events::ProgrammingModeEnabled>(
|
||||
std::bind(&InsightWorker::onProgrammingModeEnabledEvent, this, std::placeholders::_1)
|
||||
);
|
||||
@@ -92,7 +88,6 @@ namespace Bloom
|
||||
|
||||
this->lastTargetState = TargetState::STOPPED;
|
||||
emit this->targetStateUpdated(TargetState::STOPPED);
|
||||
emit this->targetProgramCounterUpdated(event.programCounter);
|
||||
}
|
||||
|
||||
void InsightWorker::onTargetResumedEvent(const Events::TargetExecutionResumed& event) {
|
||||
@@ -113,30 +108,13 @@ namespace Bloom
|
||||
emit this->targetStateUpdated(TargetState::STOPPED);
|
||||
}
|
||||
|
||||
emit this->targetProgramCounterUpdated(this->targetControllerConsole.getProgramCounter());
|
||||
emit this->targetReset();
|
||||
|
||||
} catch (const Exceptions::Exception& exception) {
|
||||
Logger::debug("Error handling TargetReset event - " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
void InsightWorker::onTargetRegistersWrittenEvent(const Events::RegistersWrittenToTarget& event) {
|
||||
emit this->targetRegistersWritten(event.registers, event.createdTimestamp);
|
||||
|
||||
for (const auto& reg : event.registers) {
|
||||
if (reg.descriptor.type == Targets::TargetRegisterType::PROGRAM_COUNTER) {
|
||||
try {
|
||||
emit this->targetProgramCounterUpdated(this->targetControllerConsole.getProgramCounter());
|
||||
|
||||
} catch (const Exceptions::Exception& exception) {
|
||||
Logger::debug("Error reading program counter - " + exception.getMessage());
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InsightWorker::onTargetControllerStateChangedEvent(const Events::TargetControllerStateChanged& event) {
|
||||
using TargetController::TargetControllerState;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Bloom
|
||||
void ready();
|
||||
void taskQueued();
|
||||
void targetStateUpdated(Bloom::Targets::TargetState newState);
|
||||
void targetProgramCounterUpdated(quint32 programCounter);
|
||||
void targetReset();
|
||||
void targetControllerSuspended();
|
||||
void targetControllerResumed(const Bloom::Targets::TargetDescriptor& targetDescriptor);
|
||||
void targetRegistersWritten(const Bloom::Targets::TargetRegisters& targetRegisters, const QDateTime& timestamp);
|
||||
@@ -65,7 +65,6 @@ namespace Bloom
|
||||
void onTargetStoppedEvent(const Events::TargetExecutionStopped& event);
|
||||
void onTargetResumedEvent(const Events::TargetExecutionResumed& event);
|
||||
void onTargetResetEvent(const Events::TargetReset& event);
|
||||
void onTargetRegistersWrittenEvent(const Events::RegistersWrittenToTarget& event);
|
||||
void onTargetControllerStateChangedEvent(const Events::TargetControllerStateChanged& event);
|
||||
void onProgrammingModeEnabledEvent(const Events::ProgrammingModeEnabled& event);
|
||||
void onProgrammingModeDisabledEvent(const Events::ProgrammingModeDisabled& event);
|
||||
|
||||
10
src/Insight/InsightWorker/Tasks/ReadProgramCounter.cpp
Normal file
10
src/Insight/InsightWorker/Tasks/ReadProgramCounter.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "ReadProgramCounter.hpp"
|
||||
|
||||
namespace Bloom
|
||||
{
|
||||
using TargetController::TargetControllerConsole;
|
||||
|
||||
void ReadProgramCounter::run(TargetControllerConsole& targetControllerConsole) {
|
||||
emit this->programCounterRead(targetControllerConsole.getProgramCounter());
|
||||
}
|
||||
}
|
||||
20
src/Insight/InsightWorker/Tasks/ReadProgramCounter.hpp
Normal file
20
src/Insight/InsightWorker/Tasks/ReadProgramCounter.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "InsightWorkerTask.hpp"
|
||||
|
||||
namespace Bloom
|
||||
{
|
||||
class ReadProgramCounter: public InsightWorkerTask
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ReadProgramCounter() = default;
|
||||
|
||||
signals:
|
||||
void programCounterRead(std::uint32_t programCounter);
|
||||
|
||||
protected:
|
||||
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user