Improved containment of target package widget functionality - it's now less tightly coupled.
This commit is contained in:
@@ -24,8 +24,7 @@ namespace Bloom
|
||||
public:
|
||||
InsightWorkerTaskState state;
|
||||
|
||||
InsightWorkerTask() = default;
|
||||
InsightWorkerTask(QObject* parent): QObject(parent) {};
|
||||
InsightWorkerTask(): QObject(nullptr) {};
|
||||
|
||||
void execute(TargetControllerConsole& targetControllerConsole);
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace Bloom
|
||||
void run(TargetControllerConsole& targetControllerConsole) override;
|
||||
|
||||
public:
|
||||
ReadTargetRegisters(const Targets::TargetRegisterDescriptors& descriptors, QObject* parent):
|
||||
InsightWorkerTask(nullptr), descriptors(descriptors) {}
|
||||
ReadTargetRegisters(const Targets::TargetRegisterDescriptors& descriptors):
|
||||
InsightWorkerTask(), descriptors(descriptors) {}
|
||||
|
||||
signals:
|
||||
void targetRegistersRead(Targets::TargetRegisters registers);
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "RefreshTargetPinStates.hpp"
|
||||
|
||||
using namespace Bloom;
|
||||
|
||||
void RefreshTargetPinStates::run(TargetControllerConsole& targetControllerConsole) {
|
||||
emit this->targetPinStatesRetrieved(targetControllerConsole.getPinStates(this->variantId));
|
||||
}
|
||||
27
src/Insight/InsightWorker/Tasks/RefreshTargetPinStates.hpp
Normal file
27
src/Insight/InsightWorker/Tasks/RefreshTargetPinStates.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#include "InsightWorkerTask.hpp"
|
||||
#include "src/Targets/TargetVariant.hpp"
|
||||
#include "src/Targets/TargetPinDescriptor.hpp"
|
||||
|
||||
namespace Bloom
|
||||
{
|
||||
class RefreshTargetPinStates: public InsightWorkerTask
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
int variantId;
|
||||
|
||||
protected:
|
||||
void run(TargetControllerConsole& targetControllerConsole) override;
|
||||
|
||||
public:
|
||||
RefreshTargetPinStates(int variantId): InsightWorkerTask(), variantId(variantId) {}
|
||||
|
||||
signals:
|
||||
void targetPinStatesRetrieved(Bloom::Targets::TargetPinStateMappingType pinStatesByNumber);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user