From aa5545a97310fa053e3baf257c53e250685c3114 Mon Sep 17 00:00:00 2001 From: Daniel_M_Williams Date: Sat, 10 Jun 2017 22:25:54 -0400 Subject: [PATCH] [fix] both pods and boosters now obey the 'auto-radius' option - update ParallelStage#update to use the parent-class which contains 'getOuterRadius' --- .../openrocket/rocketcomponent/ParallelStage.java | 6 +++--- .../net/sf/openrocket/rocketcomponent/PodSet.java | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/ParallelStage.java b/core/src/net/sf/openrocket/rocketcomponent/ParallelStage.java index 274fc9872..7c0681ab4 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/ParallelStage.java +++ b/core/src/net/sf/openrocket/rocketcomponent/ParallelStage.java @@ -218,11 +218,11 @@ public class ParallelStage extends AxialStage implements FlightConfigurableCompo super.update(); if( this.autoRadialPosition ){ - AxialStage parentStage = (AxialStage)this.parent; - if( null == parentStage ){ + ComponentAssembly parentAssembly = (ComponentAssembly)this.parent; + if( null == parentAssembly ){ this.radialPosition_m = this.getOuterRadius(); }else{ - this.radialPosition_m = this.getOuterRadius() + parentStage.getOuterRadius(); + this.radialPosition_m = this.getOuterRadius() + parentAssembly.getOuterRadius(); } } } diff --git a/core/src/net/sf/openrocket/rocketcomponent/PodSet.java b/core/src/net/sf/openrocket/rocketcomponent/PodSet.java index 50d417708..87128953f 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/PodSet.java +++ b/core/src/net/sf/openrocket/rocketcomponent/PodSet.java @@ -238,4 +238,17 @@ public class PodSet extends ComponentAssembly implements RingInstanceable { fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE); } + @Override + protected void update(){ + super.update(); + + if( this.autoRadialPosition){ + ComponentAssembly parentAssembly = (ComponentAssembly)this.parent; + if( null == parentAssembly ){ + this.radialPosition_m = this.getOuterRadius(); + }else{ + this.radialPosition_m = this.getOuterRadius() + parentAssembly.getOuterRadius(); + } + } + } }