Introduced the TargetControllerConsole class to provide access to common functionality within the TargetController.

This commit is contained in:
Nav
2021-04-24 20:23:17 +01:00
parent 03a2bfab57
commit fa2a3f67db
10 changed files with 378 additions and 285 deletions

View File

@@ -43,10 +43,7 @@ void InsightWorker::startup() {
}
void InsightWorker::requestPinStates(int variantId) {
auto requestEvent = std::make_shared<Events::RetrieveTargetPinStates>();
requestEvent->variantId = variantId;
this->eventManager.triggerEvent(requestEvent);
this->targetControllerConsole.requestPinStates(variantId);
}
void InsightWorker::requestPinStateUpdate(
@@ -54,12 +51,7 @@ void InsightWorker::requestPinStateUpdate(
Bloom::Targets::TargetPinDescriptor pinDescriptor,
Bloom::Targets::TargetPinState pinState
) {
auto updateEvent = std::make_shared<Events::SetTargetPinState>();
updateEvent->variantId = variantId;
updateEvent->pinDescriptor = pinDescriptor;
updateEvent->pinState = pinState;
this->eventManager.triggerEvent(updateEvent);
this->targetControllerConsole.setPinState(variantId, pinDescriptor, pinState);
}
void InsightWorker::onTargetStoppedEvent(EventPointer<TargetExecutionStopped> event) {