Handling programming mode enabled/disabled events in Insight
This commit is contained in:
@@ -45,6 +45,14 @@ namespace Bloom
|
||||
std::bind(&InsightWorker::onTargetRegistersWrittenEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<Events::ProgrammingModeEnabled>(
|
||||
std::bind(&InsightWorker::onProgrammingModeEnabledEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<Events::ProgrammingModeDisabled>(
|
||||
std::bind(&InsightWorker::onProgrammingModeDisabledEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventDispatchTimer = new QTimer(this);
|
||||
QObject::connect(this->eventDispatchTimer, &QTimer::timeout, this, &InsightWorker::dispatchEvents);
|
||||
this->eventDispatchTimer->start(5);
|
||||
@@ -161,6 +169,14 @@ namespace Bloom
|
||||
}
|
||||
}
|
||||
|
||||
void InsightWorker::onProgrammingModeEnabledEvent(const Events::ProgrammingModeEnabled& event) {
|
||||
emit this->programmingModeEnabled();
|
||||
}
|
||||
|
||||
void InsightWorker::onProgrammingModeDisabledEvent(const Events::ProgrammingModeDisabled& event) {
|
||||
emit this->programmingModeDisabled();
|
||||
}
|
||||
|
||||
void InsightWorker::executeTasks() {
|
||||
auto task = std::optional<InsightWorkerTask*>();
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@ namespace Bloom
|
||||
void targetControllerSuspended();
|
||||
void targetControllerResumed(const Bloom::Targets::TargetDescriptor& targetDescriptor);
|
||||
void targetRegistersWritten(const Bloom::Targets::TargetRegisters& targetRegisters, const QDateTime& timestamp);
|
||||
void programmingModeEnabled();
|
||||
void programmingModeDisabled();
|
||||
|
||||
private:
|
||||
EventListenerPointer eventListener = std::make_shared<EventListener>("InsightWorkerEventListener");
|
||||
@@ -65,6 +67,8 @@ namespace Bloom
|
||||
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);
|
||||
|
||||
void executeTasks();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user