401 Commits

Author SHA1 Message Date
Daniel_M_Williams
51418e34bc [fixes #387] Fixes one source of off-axis CP error 2018-12-01 13:05:21 -05:00
Daniel_M_Williams
72c6f1d64d [fixes #471] Refactoring FreeformFinSet to accept root points outside of the base. (which generates bridge-points on-load) 2018-11-26 13:53:51 -05:00
Daniel_M_Williams
8ab739a304 [fix] Fixed RocketComponent::setAfter() => added unittest in TestRocket => fixed IntegrationTest 2018-10-27 16:10:31 -04:00
Daniel_M_Williams
166d358c14 [Feature] Freeform Fins may not be attched to variable-shaped body components
- Fins may be attached to Transitions (and subclass NoseCones )

  [Fix] FinSet now implements the Ring-Instanceable interface
  [Refactor] Rocket inherits from ComponentAssembly instead of RocketComponent
  [Fix][Refactor] Fin tabs are now correctly validated upon change
  [Fix] Fin tabs are now corrected to be no-bigger-than their fins
  [Refactor] FinSet.getBodyRadius(..) now requires an argument
  [Fix] restricted fin tab positioning to be strictly top/middle/bottom
  [Refactor] Reimplement FreeformFinSet.setPoint(...)
  [Fix] Prevent Freeform Fins movement past parent's top/front
  [bugfix] Fins are now addable to transitions from the GUI
  [Fix] Fins, Transitions are now drawn correctly in fin-design window
  [Minor] Added makeV2 rocket to TestRockets

  [fix] getRootPoints() impl & test
2018-10-27 14:41:01 -04:00
Daniel_M_Williams
b268d3aa59 [refactor] RocketComponent positioning is now centralized in AxialMethod class
- also relaxed visibility for Component::setAxialMethod(...)
2018-10-27 14:41:01 -04:00
Daniel_M_Williams
8656dd287d [fix] Fixes repeated bug in Presets/Material Loading -- inconsistent test criteria 2018-09-09 12:37:29 -04:00
Daniel_M_Williams
8dc851e1db [fix] cleanup up unused imports in core/test/net/sf/openrocket/rocketcomponent/* 2018-09-03 22:51:00 -04:00
Daniel_M_Williams
e4b6b25a8b [fixes #419] Adding new points to FreeformFins are now placed at the mouse cursor 2018-08-26 17:31:46 -04:00
Daniel_M_Williams
f3dbceba37 [refactor] separated FinSet Tests into files corresponding to FinSet, TrapezoidalFinSet, and FreeformFinSet 2018-08-26 17:27:41 -04:00
Daniel_M_Williams
fab167abdc [fix] Fixes the way BarrowmanCalculator handles instancing, particularly for ComponentAssemblies 2018-08-26 16:59:01 -04:00
Daniel_M_Williams
e6b788cb0b [test] Moved fins from core-body to booster-body; (they are now doubly-instanced); adjusted tests to accept this. 2018-08-26 16:59:01 -04:00
Daniel_M_Williams
7e5ab5de32 [fix] Revert patch 6289aef0... which introduced simulation anomalies 2018-08-26 16:59:01 -04:00
Daniel_M_Williams
1418cb902b [fixes #431] Fins default to instance count / fin count == 1
- Fixed init bug
- added unittests for fin count loading/saving/creation
2018-08-26 16:59:01 -04:00
Daniel_M_Williams
20473dbf82 [fix] file version 108 now correctly loads angle-offsets for all ComponentAssemblies 2018-02-03 10:52:44 -05:00
Daniel_M_Williams
4a874b6ba9 [fix] Fixed OpenRocketSaverTest: minimum file version is now 108 2018-01-27 20:35:49 -05:00
Daniel_M_Williams
0498900078 [feat] Added Positioning methods and interfaces for Axial, Radius, and Angle directions
- also added minor angle-wrapping function to MathUtil
2018-01-21 12:06:25 -05:00
Daniel_M_Williams
23d7397fa6 [refactor] Pods and ParallelStages are now attached to BodyTubes *only* 2018-01-13 14:35:16 -05:00
Daniel_M_Williams
20eff575f4 [fix] Fix MassCalculator Unittests.
(Effectively a re-write of the MassCalculation code)
- renamed some mass calculator accesor methods
- MassData, InertiaMatrix refactored into 'RigidBody' class

- refactors out cache code to separate wrapper class
- calculations now use the Transform class to translate masses, CM, and MOI

- new class: MassCalculation
  - contains relevant context for a given calculation: tree-root, type, time, config
  - contains most actual calculation code
  - calculations are tracked with a context class: MassCalculation
2017-12-25 20:56:11 -05:00
Daniel_M_Williams
6289aef0ef [fix] Fixed aerodynamic unittests
-changed FinSetCalc to output per-instance CNa
2017-12-25 20:56:11 -05:00
Daniel_M_Williams
1fac8818b5 [fix][test] Fixed filename sanitation issue in OpenRocketSaverTest 2017-12-25 20:56:11 -05:00
Daniel_M_Williams
b84de68575 [fix][test] Fixed RocketTest, FlightConfigurationTest 2017-12-25 20:56:11 -05:00
Daniel_M_Williams
356ec09094 [fix][unittest] Fixed RocketTest (required fix to RocketComponent#getInstanceLocations()) 2017-12-25 20:56:11 -05:00
Daniel_M_Williams
23a488db48 [Resolves #369] Fixes 3d rendering for instanced components
This is a relatively major refactor / rewrite of the 3d rendering code.

- components geometries are rendered recursively
- components inherit parents' transformations ( translation, rotation)
- implemented Transformation#toGLMatrix()
  -- openrocket transformations can be directly fed into Java OpenGL

- added: FinSet#getBoundingBox()
- improved documentation on RocketComponent Location methods

- Refactor RocketRenderer:
  - render component trees recursively
  - removed RocketRendere#isDrawn(c) -- return true in all implementations

- Refactor ComponentRenderer
  - renamed variables to be more descriptive
  - changed RocketComponent#toAbsolute(...) => RocketComponent#getComponentLocations()
- Adjust FinRender Code:
  - Render Single Fin Instance at-a-time
  - takes in an angle for the instance
  - assumes the fin is already at it's desired position.
  - renames 'fs' -> 'finSet'
2017-11-05 17:56:14 -05:00
Daniel_M_Williams
9456c3a14a [fix][test] Expanded Transformation unit tests 2017-11-05 11:11:16 -05:00
Daniel_M_Williams
eb72329c58 [fix][refactor] simplified rocketfigure drawing code
Fixes Issues:
- https://github.com/openrocket/openrocket/issues/366
- https://github.com/openrocket/openrocket/issues/323

- RocketFigure no longer draws specific stages:
  Starts drawing rocket, and then propogates location, angle/transformation downwards
  - fixed active/inactive visibility toggling
  - Fixed Drowing Bounds for RocketFigure
    - Fix: FlightConfiguration#getBounds()
    - Fix: FinSet#getComponentBounds()
    - Fix: InnerTube#getInstanceCount()
    - Add: Coordinate#MIN, Coordinate#MAX
    - Add: net.sf.openrocket.util.BoundingBox

- RocketComponent:
  - implement: #getInstanceLocations() // relative to parent component
  - implement #getInstanceAngles()
  - implement: #getComponentLocations()  (Refactor/rename of #getLocations() )

- Implement <x>#getInstanceOffsets() // relative to component-reference-point
  - FinSet
  - PodSet
  - ParallelStage
  - RailButton
  - InnerTube:

- fixed drawing shapes:
  - TubeShapes
  - BodyTube
  - Launch Lug
  - RingComponent (InnerTube, EngineBlock, Coupler)
  - Finset
  - Transition
  - Rail Button
2017-10-28 13:41:51 -04:00
Daniel_M_Williams
3e869e015b [Fix] Modified masscalc test for different active stages. 2016-12-23 18:32:15 -05:00
Kevin Ruland
f2d76e3b2b Merge remote-tracking branch 'upstream/master' into unstable 2016-10-23 13:50:08 -05:00
Kevin Ruland
d3240ec1a4 Merge remote-tracking branch 'upstream/unstable' into unstable 2016-10-23 13:16:06 -05:00
Daniel_M_Williams
02aefc6b6e [fix] Fixed RocketTest Failure 2016-10-22 22:58:41 -04:00
Kevin Ruland
6532743c3f Revising previous commit to include the missing files. 2016-10-10 19:50:17 -05:00
kruland2607
05d439bd1e Merge pull request #280 from teyrana/axialoffsetfix
[Refactor] Replaced redundant method: 'PositionValue(...)' with 'AxialOffset(...)'
2016-10-07 19:28:17 -05:00
Daniel_M_Williams
c1e2ed0c28 [Refactor] Replaced redundant method: 'PositionValue(...)' with 'AxialOffset(...)'
- These two methods did the same thing, so this patch removes the former from RocketComponent and descendants
- Wherever used, "PositionValue(...)" was replace with "AxialOffset(...)"
- Removed some extraneous redirect definitions of PositionValue(...)
- Fixed some UI references to the old method
2016-09-28 10:05:35 -04:00
Daniel_M_Williams
9d07aaff5c [Minor] Removed dead / debug code from mass calculation code 2016-09-28 09:51:35 -04:00
Luiz Victor Linhares Rocha
a126d76e3a fixes false negative tests for comma decimal locale 2016-09-28 00:06:17 -03:00
Daniel_M_Williams
04c0914d0a [bugfix] Overhauled MassCalculator Methods.
- Rocket total mass is split into 'dryMass' and 'propellantMass'
    -- each mass type has a corresponding calculation method in MassCalculator
  - Calculating Inertias and Center-of-Mass FOR MOTORS assume:
    - time-invariant x-coordinate
    - time-decreasing density
  - mass correctly tracks propellant usage, as measured by thrustCurves
  - elimated MassCalcType enum: was not actually solving a problem.
     - simply use motorTime: 0 for launch Double.MAX_VALUE for burnout
     - NO_MOTORS is represented by a configuration without attached motors
       -- try:  "rocket.setSelectedConfiguration( rocket.getEmptyConfiguration())"
     - 'dry mass' vs 'total mass': 90% of the time, a caller wanted 'total mass'
     - total_mass = dry_mass + propellant_mass
     - mass @ simulation time wasn't represented by the enum, had existing overloads anyway
  - get vs calculate methods:
    -- gets revalidate the cache, then retreive specific information
    -- calculate simple calculate the desired information, and ignore the cache.
       --- I'm particularly confident about cache reliability:
           particularly as it doesn't account for changing time during simulation.
  - reduced / simplified debugging messages
2016-07-01 16:26:02 -04:00
Daniel_M_Williams
56463b02fc [Bugfix] ThrustCurve motor interpolation fixed. 2016-06-25 11:11:28 -04:00
Daniel_M_Williams
7b2e195392 [Cleanup] Cleaned up the ThrustCurveMotor class Interface
- Cleaned up the ThrustCurveMotor api interface
  -- Converted 'getTimePoints().length' -> 'getSampleSize()'
  -- Unified ThrustCurveMotor gets to the form getXXXX(double motorTime)
  -- Restricted access for several methods from public -> protected
- Updated ThrustCurveMotorTest.java
2016-06-25 11:09:45 -04:00
Kevin Ruland
a5b083ade7 Use actual burn time for determination of burnout event. Compute
average thrust while simulating.
2016-06-07 20:54:10 -05:00
Daniel_M_Williams
b02e164bce [bugfix] RocketPanel configuration list now updates changes
- Pulled JComboBoxModel<FlightConfiguration> into its own class: ConfigurationModel
  -- removed Rocket.toConfigArray() --> getFlightConfigurationByIndex(int,bool)
-Refactored document.getDefaultConfiguration -> getSelected...
  -- because that's what it does. Default is a different thing.
-minor: minor spelling errors and unused fields/functions
2016-04-24 14:04:15 -04:00
Daniel_M_Williams
345d5952c6 [Refine] Copying a FlightConfiguration in the UI now updates correctly.
- involved adjusting clone() -> copy(...) in FlightConfigurableParameters
2016-04-24 14:03:48 -04:00
Daniel_M_Williams
d7faf0d273 [Refine] Refining Configuration Fixes
- Rocket.getSelectedConfiguration will now create a new
  configuration if only the default config exists
  -- added additional unit tests for this behavior in: FLightConfigurationTest
- added test for saving ver 1.08 files to OpenRocketSaverTest
- Converted : "private static final long serialVersionUID ..." declarations to:
  "@SuppressWarnings("serial")"
- cleaned up some other random errors:
  -- tightened excessive permission modifiers -- public ->
  -- change some methods from 'public' to '/*package-local*/'
2016-04-24 14:02:32 -04:00
Daniel_M_Williams
5b687b5bcc [Bugfix] Fixes a few configuration bugs.
- Fixes out-of-date javadoc comments
- Fixes FlightConfigurationTest
  -- fixes TestRocket instantiation.
- Simplified FlightConfiguration class function API
-
2016-04-24 14:02:29 -04:00
Daniel_M_Williams
366cd6473f [Bugfix] Updated verification numbers in BarrowmanCalculatorTest 2016-04-03 12:34:42 -04:00
Daniel_M_Williams
d0cb8ab99f [Bugfix / Refactor] Further Simulation Bugfixes / Streamlining
- Fixed bugs in the simulation event handling:
  -- removed extraneous BURNOUT checks
  -- added MotorClusterState.burnOut(..) update calls on BURNOUT event
  -- added MotorClusterState.expend(..) update calls on EJECTION_CHARGE event
- MotorInstanceId -> MotorConfigurationId (to reflect actual usage)
  -- removed name field (unnecessary)
- changed FlightConfiguration behavior to cache ALL motors, and return active motors as requested
  -- updated corresponding active-motor-list updating through to the simulation layers
2016-03-11 19:16:41 -05:00
Daniel_M_Williams
f6d9ad0487 [Bugfix / Refactor] Fixing simulation bugs and oddities.
- *Adjusted event handling in BasicEventSimulationEngine*
  -- combined redundant event-handling for IGNITION FlightEvent
  -- adjusted parameters for throwing IGNITION FlightEvents
- Added validation method internal to FlightEvent class.
  -- documents assumptions about classes are expected for what types of flight events.
- renamed MotorState -> MotorSimulation -> MotorClusterState
- renamed MotorState enums -> ThrustState
- Adjusted MotorConfigurations to be init-linked to a mount, and FCID
  -- these are final member fields, and required for construction. And immutable.
- moved IgnitionEvent to motor package
- Adjusted MotorInstanceId to represent a motorCluster key
  -- wraps a UUID, and uniquely keyed to its: mount, FCID
- fixed AxialStage methods isLaunchStage() and getPreviousStage()
- added methods to MotorMount interface to reduce extraneous, always-true casts
- various miscellaneous fixes to reflect method changes
- various test fixes
  -- added test to verify 'getPreviousStage()' method
2016-03-11 19:13:28 -05:00
Daniel_M_Williams
28689825a4 [Refactor ] Refactored motor state in preparation for debugging the simulation itself
- Created MotorState as an enum describing discrete states a motor may be in
- moved ThrustCurveMotorState info back into MotorSimulation
  -- MotorSimulation will be used by the simulation code.
  -- tracks simulation-time info, such as event times, and current state ( <MotorState> )
- MotorConfiguration no longer have any knowledge about their simulation info
- moved functionality (BUT NOT STATE) into ThrustCurveMotor
  -- can query about thrust(t), mass(t), cgx(t)
2016-03-11 19:13:28 -05:00
Daniel_M_Williams
438f58c438 [Bugfix] Fixed MassCalculator Issues - Instancing, CGx & CM Override
- Fixed Bug in MassCalculator
  -- demonstrated by MassCalculatorTest.testBoosterTotalCM() et al.
  -- errors: 1) under-counts instanced children
             2) erroneously required component have children before instancing mass
  -- N.B. This method is ripe for refactoring, to make it MUCH cleaner....
- Updated numbers on MassCalculator Unit Tests
- Added Test for motor configuration multiplicity (FlightConfigurationTest)
2016-03-11 19:13:23 -05:00
Daniel_M_Williams
2215d41cc2 [Test] added Transition Test file. 2016-03-11 17:31:33 -05:00
Daniel_M_Williams
39420ddfc0 [Bugfix] Cleaned up simulation and configuration Ids loading
- Simulations now load the configuration ids corresponding to it's file entry.
  - involved removing redundand flightconfig id fields
    - FROM simulation conditions and simulation options
    - TO "Simulation"
- Distilled some unit tests to use all rockets from the TestRocket class.
- Fixed a few warnings
2016-01-19 00:03:25 -05:00
Daniel_M_Williams
e51f7a2827 [Minor] Cleaned up warnings
- Mostly un-parameterized generics
- adding 'serialVersionUID' member fields where javac complained
2016-01-17 11:58:06 -05:00