Removed tight coupling of target pin widgets with Insight window - moved target pin state toggling into an InsightWorker task.

This commit is contained in:
Nav
2021-09-04 18:03:45 +01:00
parent 1bc881e9ae
commit 85ef2c57e1
15 changed files with 114 additions and 85 deletions

View File

@@ -28,10 +28,6 @@ void InsightWorker::startup() {
std::bind(&InsightWorker::onTargetResumedEvent, this, std::placeholders::_1)
);
this->eventListener->registerCallbackForEventType<Events::TargetPinStatesRetrieved>(
std::bind(&InsightWorker::onTargetPinStatesRetrievedEvent, this, std::placeholders::_1)
);
this->eventListener->registerCallbackForEventType<Events::TargetIoPortsUpdated>(
std::bind(&InsightWorker::onTargetIoPortsUpdatedEvent, this, std::placeholders::_1)
);
@@ -81,14 +77,6 @@ void InsightWorker::requestPinStates(int variantId) {
this->targetControllerConsole.requestPinStates(variantId);
}
void InsightWorker::requestPinStateUpdate(
int variantId,
Bloom::Targets::TargetPinDescriptor pinDescriptor,
Bloom::Targets::TargetPinState pinState
) {
this->targetControllerConsole.setPinState(variantId, pinDescriptor, pinState);
}
void InsightWorker::onTargetStoppedEvent(const Events::TargetExecutionStopped& event) {
/*
* When we report a target halt to Insight, Insight will immediately seek more data from the target (such as GPIO
@@ -125,10 +113,6 @@ void InsightWorker::onTargetResumedEvent(const Events::TargetExecutionResumed& e
emit this->targetStateUpdated(TargetState::RUNNING);
}
void InsightWorker::onTargetPinStatesRetrievedEvent(const Events::TargetPinStatesRetrieved& event) {
emit this->targetPinStatesUpdated(event.variantId, event.pinSatesByNumber);
}
void InsightWorker::onTargetIoPortsUpdatedEvent(const Events::TargetIoPortsUpdated& event) {
emit this->targetIoPortsUpdated();
}