Moved refreshing of target pin states, upon an IO port update event, to target package widget class.
Functionality for the target package widget is now completely contained within the TargetPackageWidget class (and derivations).
This commit is contained in:
@@ -23,15 +23,11 @@ TargetPackageWidget::TargetPackageWidget(
|
|||||||
|
|
||||||
this->connect(
|
this->connect(
|
||||||
&(this->insightWorker),
|
&(this->insightWorker),
|
||||||
&InsightWorker::targetPinStatesUpdated,
|
&InsightWorker::targetIoPortsUpdated,
|
||||||
this,
|
this,
|
||||||
[this] (int variantId, const Targets::TargetPinStateMappingType& pinStatesByNumber) {
|
[this] {
|
||||||
if (variantId == this->targetVariant.id) {
|
if (this->targetState == TargetState::STOPPED) {
|
||||||
this->updatePinStates(pinStatesByNumber);
|
this->refreshPinStates();
|
||||||
|
|
||||||
if (this->targetState == TargetState::STOPPED && !this->isEnabled()) {
|
|
||||||
this->setDisabled(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -33,5 +33,9 @@ namespace Bloom::Widgets::InsightTargetWidgets
|
|||||||
public:
|
public:
|
||||||
TargetPackageWidget(Targets::TargetVariant targetVariant, InsightWorker& insightWorker, QWidget* parent);
|
TargetPackageWidget(Targets::TargetVariant targetVariant, InsightWorker& insightWorker, QWidget* parent);
|
||||||
virtual void refreshPinStates(std::optional<std::function<void(void)>> callback = std::nullopt);
|
virtual void refreshPinStates(std::optional<std::function<void(void)>> callback = std::nullopt);
|
||||||
|
|
||||||
|
virtual void setTargetState(Targets::TargetState targetState) {
|
||||||
|
this->targetState = targetState;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user