Renamed TargetControllerConsole to TargetControllerService

This commit is contained in:
Nav
2022-12-26 21:27:19 +00:00
parent de97e8d4e0
commit d353b55f9b
85 changed files with 261 additions and 257 deletions

View File

@@ -206,7 +206,7 @@ namespace Bloom
this->checkBloomVersion();
this->mainWindow->init(this->targetControllerConsole.getTargetDescriptor());
this->mainWindow->init(this->targetControllerService.getTargetDescriptor());
this->mainWindow->show();
}
@@ -322,7 +322,7 @@ namespace Bloom
void Insight::onTargetResetEvent(const Events::TargetReset& event) {
try {
if (this->targetControllerConsole.getTargetState() != TargetState::STOPPED) {
if (this->targetControllerService.getTargetState() != TargetState::STOPPED) {
return;
}

View File

@@ -17,7 +17,7 @@
#include "src/EventManager/EventListener.hpp"
#include "src/EventManager/Events/Events.hpp"
#include "src/TargetController/TargetControllerConsole.hpp"
#include "src/Services/TargetControllerService.hpp"
#include "src/Targets/TargetState.hpp"
#include "InsightSignals.hpp"
@@ -90,7 +90,7 @@ namespace Bloom
this->insightProjectSettings
);
TargetController::TargetControllerConsole targetControllerConsole = TargetController::TargetControllerConsole();
Services::TargetControllerService targetControllerService = Services::TargetControllerService();
Targets::TargetState lastTargetState = Targets::TargetState::UNKNOWN;
bool targetStepping = false;

View File

@@ -83,7 +83,7 @@ namespace Bloom
auto* task = queuedTask.value();
task->moveToThread(this->thread());
task->setParent(this);
task->execute(this->targetControllerConsole);
task->execute(this->targetControllerService);
{
const auto taskGroupsLock = InsightWorker::taskGroupsInExecution.acquireLock();

View File

@@ -9,7 +9,7 @@
#include "Tasks/InsightWorkerTask.hpp"
#include "src/Helpers/SyncSafe.hpp"
#include "src/TargetController/TargetControllerConsole.hpp"
#include "src/Services/TargetControllerService.hpp"
namespace Bloom
{
@@ -41,7 +41,7 @@ namespace Bloom
static inline SyncSafe<std::map<QueuedTaskId, InsightWorkerTask*>> queuedTasksById = {};
static inline SyncSafe<TaskGroups> taskGroupsInExecution = {};
TargetController::TargetControllerConsole targetControllerConsole = TargetController::TargetControllerConsole();
Services::TargetControllerService targetControllerService = Services::TargetControllerService();
void executeTasks();
};

View File

@@ -10,7 +10,7 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
CaptureMemorySnapshot::CaptureMemorySnapshot(
const QString& name,
@@ -28,12 +28,12 @@ namespace Bloom
, data(data)
{}
void CaptureMemorySnapshot::run(TargetControllerConsole& targetControllerConsole) {
void CaptureMemorySnapshot::run(TargetControllerService& targetControllerService) {
using Targets::TargetMemorySize;
Logger::info("Capturing snapshot");
const auto& targetDescriptor = targetControllerConsole.getTargetDescriptor();
const auto& targetDescriptor = targetControllerService.getTargetDescriptor();
const auto memoryDescriptorIt = targetDescriptor.memoryDescriptorsByType.find(this->memoryType);
if (memoryDescriptorIt == targetDescriptor.memoryDescriptorsByType.end()) {
@@ -58,7 +58,7 @@ namespace Bloom
);
for (std::uint32_t i = 0; i < readsRequired; i++) {
auto dataSegment = targetControllerConsole.readMemory(
auto dataSegment = targetControllerService.readMemory(
this->memoryType,
memoryDescriptor.addressRange.startAddress + static_cast<Targets::TargetMemoryAddress>(readSize * i),
(memorySize - this->data->size()) >= readSize
@@ -78,7 +78,7 @@ namespace Bloom
std::move(this->description),
this->memoryType,
std::move(*this->data),
targetControllerConsole.getProgramCounter(),
targetControllerService.getProgramCounter(),
std::move(this->focusedRegions),
std::move(this->excludedRegions)
);

View File

@@ -28,7 +28,7 @@ namespace Bloom
void memorySnapshotCaptured(MemorySnapshot snapshot);
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
void run(Services::TargetControllerService& targetControllerService) override;
private:
QString name;

View File

@@ -20,7 +20,7 @@ namespace Bloom
qRegisterMetaType<std::map<Targets::TargetMemoryAddress, Widgets::ByteItem*>>();
}
void ConstructHexViewerByteItems::run(TargetController::TargetControllerConsole&) {
void ConstructHexViewerByteItems::run(Services::TargetControllerService&) {
const auto memorySize = this->memoryDescriptor.size();
const auto startAddress = this->memoryDescriptor.addressRange.startAddress;

View File

@@ -37,7 +37,7 @@ namespace Bloom
void byteItems(std::map<Targets::TargetMemoryAddress, Widgets::ByteItem*> byteItemsByAddress);
protected:
void run(TargetController::TargetControllerConsole&) override;
void run(Services::TargetControllerService&) override;
private:
std::map<Targets::TargetMemoryAddress, Widgets::ByteItem*> byteItemsByAddress;

View File

@@ -2,9 +2,9 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
void GetTargetDescriptor::run(TargetControllerConsole& targetControllerConsole) {
emit this->targetDescriptor(targetControllerConsole.getTargetDescriptor());
void GetTargetDescriptor::run(TargetControllerService& targetControllerService) {
emit this->targetDescriptor(targetControllerService.getTargetDescriptor());
}
}

View File

@@ -23,6 +23,6 @@ namespace Bloom
void targetDescriptor(Targets::TargetDescriptor targetDescriptor);
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
void run(Services::TargetControllerService& targetControllerService) override;
};
}

View File

@@ -2,9 +2,9 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
void GetTargetState::run(TargetControllerConsole& targetControllerConsole) {
emit this->targetState(targetControllerConsole.getTargetState());
void GetTargetState::run(TargetControllerService& targetControllerService) {
emit this->targetState(targetControllerService.getTargetState());
}
}

View File

@@ -23,6 +23,6 @@ namespace Bloom
void targetState(Targets::TargetState state);
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
void run(Services::TargetControllerService& targetControllerService) override;
};
}

View File

@@ -4,13 +4,13 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
void InsightWorkerTask::execute(TargetControllerConsole& targetControllerConsole) {
void InsightWorkerTask::execute(TargetControllerService& targetControllerService) {
try {
this->state = InsightWorkerTaskState::STARTED;
emit this->started();
this->run(targetControllerConsole);
this->run(targetControllerService);
this->state = InsightWorkerTaskState::COMPLETED;
emit this->completed();

View File

@@ -4,7 +4,7 @@
#include <QString>
#include "TaskGroup.hpp"
#include "src/TargetController/TargetControllerConsole.hpp"
#include "src/Services/TargetControllerService.hpp"
namespace Bloom
{
@@ -29,7 +29,7 @@ namespace Bloom
return TaskGroups();
};
void execute(TargetController::TargetControllerConsole& targetControllerConsole);
void execute(Services::TargetControllerService& targetControllerService);
signals:
/**
@@ -56,6 +56,6 @@ namespace Bloom
void finished();
protected:
virtual void run(TargetController::TargetControllerConsole& targetControllerConsole) = 0;
virtual void run(Services::TargetControllerService& targetControllerService) = 0;
};
}

View File

@@ -2,9 +2,9 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
void ReadProgramCounter::run(TargetControllerConsole& targetControllerConsole) {
emit this->programCounterRead(targetControllerConsole.getProgramCounter());
void ReadProgramCounter::run(TargetControllerService& targetControllerService) {
emit this->programCounterRead(targetControllerService.getProgramCounter());
}
}

View File

@@ -23,6 +23,6 @@ namespace Bloom
void programCounterRead(Targets::TargetProgramCounter programCounter);
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
void run(Services::TargetControllerService& targetControllerService) override;
};
}

View File

@@ -2,9 +2,9 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
void ReadStackPointer::run(TargetControllerConsole& targetControllerConsole) {
emit this->stackPointerRead(targetControllerConsole.getStackPointer());
void ReadStackPointer::run(TargetControllerService& targetControllerService) {
emit this->stackPointerRead(targetControllerService.getStackPointer());
}
}

View File

@@ -23,6 +23,6 @@ namespace Bloom
void stackPointerRead(Targets::TargetStackPointer stackPointer);
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
void run(Services::TargetControllerService& targetControllerService) override;
};
}

View File

@@ -8,12 +8,12 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
void ReadTargetMemory::run(TargetControllerConsole& targetControllerConsole) {
void ReadTargetMemory::run(TargetControllerService& targetControllerService) {
using Targets::TargetMemorySize;
const auto& targetDescriptor = targetControllerConsole.getTargetDescriptor();
const auto& targetDescriptor = targetControllerService.getTargetDescriptor();
const auto memoryDescriptorIt = targetDescriptor.memoryDescriptorsByType.find(this->memoryType);
if (memoryDescriptorIt == targetDescriptor.memoryDescriptorsByType.end()) {
@@ -39,7 +39,7 @@ namespace Bloom
Targets::TargetMemoryBuffer data;
for (std::uint32_t i = 0; i < readsRequired; i++) {
auto dataSegment = targetControllerConsole.readMemory(
auto dataSegment = targetControllerService.readMemory(
this->memoryType,
this->startAddress + static_cast<Targets::TargetMemoryAddress>(readSize * i),
(this->size - data.size()) >= readSize

View File

@@ -35,7 +35,7 @@ namespace Bloom
void targetMemoryRead(Targets::TargetMemoryBuffer buffer);
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
void run(Services::TargetControllerService& targetControllerService) override;
private:
Targets::TargetMemoryType memoryType;

View File

@@ -2,9 +2,9 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
void ReadTargetRegisters::run(TargetControllerConsole& targetControllerConsole) {
emit this->targetRegistersRead(targetControllerConsole.readRegisters(this->descriptors));
void ReadTargetRegisters::run(TargetControllerService& targetControllerService) {
emit this->targetRegistersRead(targetControllerService.readRegisters(this->descriptors));
}
}

View File

@@ -24,7 +24,7 @@ namespace Bloom
void targetRegistersRead(Targets::TargetRegisters registers);
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
void run(Services::TargetControllerService& targetControllerService) override;
private:
Targets::TargetRegisterDescriptors descriptors;

View File

@@ -2,9 +2,9 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
void RefreshTargetPinStates::run(TargetControllerConsole& targetControllerConsole) {
emit this->targetPinStatesRetrieved(targetControllerConsole.getPinStates(this->variantId));
void RefreshTargetPinStates::run(TargetControllerService& targetControllerService) {
emit this->targetPinStatesRetrieved(targetControllerService.getPinStates(this->variantId));
}
}

View File

@@ -25,7 +25,7 @@ namespace Bloom
void targetPinStatesRetrieved(Bloom::Targets::TargetPinStateMapping pinStatesByNumber);
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
void run(Services::TargetControllerService& targetControllerService) override;
private:
int variantId;

View File

@@ -12,13 +12,13 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
RetrieveMemorySnapshots::RetrieveMemorySnapshots(Targets::TargetMemoryType memoryType)
: memoryType(memoryType)
{}
void RetrieveMemorySnapshots::run(TargetControllerConsole& targetControllerConsole) {
void RetrieveMemorySnapshots::run(TargetControllerService& targetControllerService) {
emit this->memorySnapshotsRetrieved(this->getSnapshots(this->memoryType));
}

View File

@@ -20,7 +20,7 @@ namespace Bloom
void memorySnapshotsRetrieved(std::vector<MemorySnapshot> snapshots);
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
void run(Services::TargetControllerService& targetControllerService) override;
private:
Targets::TargetMemoryType memoryType;

View File

@@ -2,9 +2,9 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
void SetTargetPinState::run(TargetControllerConsole& targetControllerConsole) {
targetControllerConsole.setPinState(this->pinDescriptor, this->pinState);
void SetTargetPinState::run(TargetControllerService& targetControllerService) {
targetControllerService.setPinState(this->pinDescriptor, this->pinState);
}
}

View File

@@ -22,7 +22,7 @@ namespace Bloom
};
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
void run(Services::TargetControllerService& targetControllerService) override;
private:
Targets::TargetPinDescriptor pinDescriptor;

View File

@@ -2,9 +2,9 @@
namespace Bloom
{
using TargetController::TargetControllerConsole;
using Services::TargetControllerService;
void WriteTargetRegister::run(TargetControllerConsole& targetControllerConsole) {
targetControllerConsole.writeRegisters({this->targetRegister});
void WriteTargetRegister::run(TargetControllerService& targetControllerService) {
targetControllerService.writeRegisters({this->targetRegister});
}
}

View File

@@ -21,7 +21,7 @@ namespace Bloom
};
protected:
void run(TargetController::TargetControllerConsole& targetControllerConsole) override;
void run(Services::TargetControllerService& targetControllerService) override;
private:
Targets::TargetRegister targetRegister;