Use existing method for finding component with ID
This commit is contained in:
parent
82b9ab89c7
commit
8f3fe0e44a
@ -148,12 +148,7 @@ class FlightDataBranchHandler extends AbstractElementHandler {
|
|||||||
Rocket rocket = context.getOpenRocketDocument().getRocket();
|
Rocket rocket = context.getOpenRocketDocument().getRocket();
|
||||||
sourceID = attributes.get("source");
|
sourceID = attributes.get("source");
|
||||||
if (sourceID != null) {
|
if (sourceID != null) {
|
||||||
for (RocketComponent child : rocket.getAllChildren()) {
|
source = rocket.findComponent(sourceID);
|
||||||
if (child.getID().equals(sourceID)) {
|
|
||||||
source = child;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
branch.addEvent(new FlightEvent(type, time, source));
|
branch.addEvent(new FlightEvent(type, time, source));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user