From: rodinia814 Date: Sun, 24 Oct 2010 01:58:38 +0000 (+0000) Subject: DGP - added Radial Angle to launch lug on Rocksim import X-Git-Tag: upstream/1.1.4^2~12 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=e86c584b8adccd32ff6b1536ffdb3ff408970f9d;p=debian%2Fopenrocket DGP - added Radial Angle to launch lug on Rocksim import git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@92 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/src/net/sf/openrocket/file/rocksim/LaunchLugHandler.java b/src/net/sf/openrocket/file/rocksim/LaunchLugHandler.java index 049feedd..d459618d 100644 --- a/src/net/sf/openrocket/file/rocksim/LaunchLugHandler.java +++ b/src/net/sf/openrocket/file/rocksim/LaunchLugHandler.java @@ -64,6 +64,9 @@ class LaunchLugHandler extends PositionDependentHandler { if ("Material".equals(element)) { setMaterialName(content); } + if ("RadialAngle".equals(element)) { + lug.setRadialDirection(Double.parseDouble(content)); + } if ("FinishCode".equals(element)) { lug.setFinish(RocksimFinishCode.fromCode(Integer.parseInt(content)).asOpenRocket()); } diff --git a/test/net/sf/openrocket/file/rocksim/RocksimLoaderTest.java b/test/net/sf/openrocket/file/rocksim/RocksimLoaderTest.java index 9b33319d..1ea1f989 100644 --- a/test/net/sf/openrocket/file/rocksim/RocksimLoaderTest.java +++ b/test/net/sf/openrocket/file/rocksim/RocksimLoaderTest.java @@ -8,6 +8,8 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import net.sf.openrocket.document.OpenRocketDocument; +import net.sf.openrocket.rocketcomponent.BodyTube; +import net.sf.openrocket.rocketcomponent.LaunchLug; import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Stage; @@ -156,6 +158,10 @@ public class RocksimLoaderTest extends TestCase { assertTrue(stage2.isCGOverridden()); assertEquals(0.4d, stage2.getOverrideCG().x); + BodyTube bt = (BodyTube)stage2.getChild(0); + LaunchLug ll = (LaunchLug)bt.getChild(6); + assertEquals(1.22d, ll.getRadialDirection()); + assertEquals(2, stage3.getChildCount()); assertEquals("Transition", stage3.getChild(0).getName()); assertEquals("Body tube", stage3.getChild(1).getName()); diff --git a/test/net/sf/openrocket/file/rocksim/rocksimTestRocket3.rkt b/test/net/sf/openrocket/file/rocksim/rocksimTestRocket3.rkt index a7c46dae..df1788c2 100644 --- a/test/net/sf/openrocket/file/rocksim/rocksimTestRocket3.rkt +++ b/test/net/sf/openrocket/file/rocksim/rocksimTestRocket3.rkt @@ -722,7 +722,7 @@ 13056 37.185 -0. +3.14 file=()|position=(0,0,0)|origin=(0.5,0.5,0.5)|scale=(1,1,1)|repeat=(1)|interpolate=(0)|flipr(0)|flips(0)|flipt=(0)|preventseam=(1) 1. 0. @@ -1312,7 +1312,7 @@ 13056 37.185 -0. +1.22 file=()|position=(0,0,0)|origin=(0.5,0.5,0.5)|scale=(1,1,1)|repeat=(1)|interpolate=(0)|flipr(0)|flips(0)|flipt=(0)|preventseam=(1) 1. 0.