From 736b1c1193e22df3ffcd5dacb5e803d68f831bb7 Mon Sep 17 00:00:00 2001 From: hcraigmiller <68821492+hcraigmiller@users.noreply.github.com> Date: Thu, 14 Apr 2022 03:05:29 -0700 Subject: [PATCH] [Fixes Issue #1292] Calculates per fin mass when splitting a set of fins with a mass override. If a set of fins has an overriden mass, then, if the set is split into individual fins, the overridden mass is divided by the number of fins in the set and the quotient is set as the mass override for each individual fin. --- core/src/net/sf/openrocket/rocketcomponent/FinSet.java | 7 +++++-- .../net/sf/openrocket/gui/configdialog/FinSetConfig.java | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/FinSet.java b/core/src/net/sf/openrocket/rocketcomponent/FinSet.java index a44fd13f7..4bd080a96 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FinSet.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FinSet.java @@ -28,8 +28,11 @@ public abstract class FinSet extends ExternalComponent implements AxialPositiona * Maximum allowed cant of fins. */ public static final double MAX_CANT_RADIANS = (15.0 * Math.PI / 180); - - public enum CrossSection { + + public void setOverrideMass() { + } + + public enum CrossSection { //// Square SQUARE(trans.get("FinSet.CrossSection.SQUARE"), 1.00), //// Rounded diff --git a/swing/src/net/sf/openrocket/gui/configdialog/FinSetConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/FinSetConfig.java index c375a0262..06dee6dc5 100644 --- a/swing/src/net/sf/openrocket/gui/configdialog/FinSetConfig.java +++ b/swing/src/net/sf/openrocket/gui/configdialog/FinSetConfig.java @@ -129,6 +129,7 @@ public abstract class FinSetConfig extends RocketComponentConfig { copy.setFinCount(1); copy.setBaseRotation(base + i * 2 * Math.PI / count); copy.setName(copy.getName() + " #" + (i + 1)); + copy.setOverrideMass(((FinSet) component).getOverrideMass()/((FinSet) component).getFinCount()); parent.addChild(copy, index + i); } }