Automatically trigger refreshing of register widgets, in the TargetRegistersPane, upon a registers written event

This commit is contained in:
Nav
2021-09-11 20:45:06 +01:00
parent 12a7d58b59
commit 63a080d821
4 changed files with 43 additions and 0 deletions

View File

@@ -32,6 +32,10 @@ void InsightWorker::startup() {
std::bind(&InsightWorker::onTargetIoPortsUpdatedEvent, this, std::placeholders::_1)
);
this->eventListener->registerCallbackForEventType<Events::RegistersWrittenToTarget>(
std::bind(&InsightWorker::onTargetRegistersWrittenEvent, this, std::placeholders::_1)
);
this->eventDispatchTimer = new QTimer(this);
this->connect(this->eventDispatchTimer, &QTimer::timeout, this, &InsightWorker::dispatchEvents);
this->eventDispatchTimer->start(5);
@@ -117,6 +121,10 @@ void InsightWorker::onTargetIoPortsUpdatedEvent(const Events::TargetIoPortsUpdat
emit this->targetIoPortsUpdated();
}
void InsightWorker::onTargetRegistersWrittenEvent(const Events::RegistersWrittenToTarget& event) {
emit this->targetRegistersWritten(event.descriptors);
}
void InsightWorker::onTargetControllerStateReported(const Events::TargetControllerStateReported& event) {
if (this->lastTargetControllerState == TargetControllerState::ACTIVE
&& event.state == TargetControllerState::SUSPENDED