167 Commits

Author SHA1 Message Date
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
Daniel_M_Williams
77bb060d25 MERGE with commit f8cfebe... 2016-01-09 17:11:20 -05:00
Daniel_M_Williams
60395b32a3 [Major] Fixing Cp Unittests
Implemented unit tests for aerodynamic calculators:
- (new) SymmetricComponentCalcTest
- (new) FinSetCalcTest
- (fixed) BarrowmanCalculatorTest
  -- seems like bad truth values
2016-01-03 13:54:59 -05:00
Daniel_M_Williams
3f9be1387d [BugFix] Fixed Continuity Test
- Reimplemented the continuity test in BarrowmanCalculator
- Added corresponding unit tests, too
2016-01-01 22:05:13 -05:00
Daniel_M_Williams
513e74fd15 Merge with commit f8cfebe from kruland2607/openrocket 2016-01-01 16:04:33 -05:00
Kevin Ruland
f8cfebe5f5 Fix the motor cg computation. Partial fix to barrowman aero. 2015-12-31 09:57:36 -06:00
Daniel_M_Williams
206214e47a [BugFix] Fixed MassCalculator Unit Tests
- Added debug statements to MassCalculator, enabled by a 'debug' flag
- Adjusted values in MassCalculatorTest
  -- added additional unit test cases
- Fixed implementations in MassCalculator
- Implemented getPosition() and getX() in MotorConfiguration
- added motor to test rocket Estes Alpha 3 in TestRockets
2015-12-26 14:57:17 -05:00
Daniel_M_Williams
c649292f56 'fixed' ComponentCompareTest (removed; because the test is superflous 2015-12-25 19:36:24 -05:00
Daniel_M_Williams
711f71e2c8 Fixed TestRocketOptimizationFunction unit tests 2015-12-25 13:33:46 -05:00
Daniel_M_Williams
efd1656fc8 [Major] Re-Implemented Rocket configuration list
# FlightConfigurations behave differently than the ...ParameterSet instance
  - Rockets no longer have a defaultConfig, but have a selectedConfiguration
  - therefore these function were completely re-implemented native to the Rocket class
  - FlightConfigurationTest verifies this functionality
  - simplified several function calls through the code base
  - added convenience methods for getting the config[] to the UI
# expanded RocketTest to verify Rocket.copyWithOriginalID():
  - rocket is cloned, so non-trivial members must be cloned as well.
2015-12-23 22:32:52 -05:00
Daniel_M_Williams
f59ebdd06e [Major] Re-Implemented ..ParameterSet to represent the default more simply
- the default value is now simply an entry in the map
  - size() returns only the number of overrides
  - getIds() returns only the ids of overrides
- added ParemeterSetTest to test FlightConfigurableParameterSet
- removed (already defanged) event handling functions from MotorConfig
- removed (already defanged) event handling functions from DeploymentConfig
- removed (already defanged) event handling functions from IgnitionConfig
- FlightConfigurableParameter no longer extends ChangeSet
- fully parameterized DoubleModel to <T extends Enum<T> >
- fully parameterized EnumModel to <T extends Enum<T> >
2015-12-23 00:21:09 -05:00
Daniel_M_Williams
612f64fa4c [Bugfix] Merge with commit 4c00a206531968aab2e048ea4f9ef7e27e12dd52 2015-12-22 21:17:35 -05:00
Daniel_M_Williams
bc906c6652 [Bugfix] moved ConfigurationTest to FlightConfigurationTest
- in FlightConfiguration:
  -- adjusted functions to consistently refer to <x>ActiveMotors()
  -- corresponding functions now act the same way
- removed '.release()' calls from FlightConfiguration
2015-12-20 22:21:33 -05:00
Daniel_M_Williams
3f4cf696c1 [Bugfix] Test Patch which replaces event-passing in FlightConfiguration with a simple 'update()'
- listener lists removed from FlightConfiguration
- listener lists removed from MotorConfiguration
- added update() calles to Rocket FlightConfigurationSet, other configs
- merged FlightConfigurable into FlightConfigurableParameterSet
- Fixed ParallelStageTest
- updated some function calls in/to FlightConfiguration
2015-12-20 21:47:13 -05:00
Daniel_M_Williams
8e2d4f1b95 minor unit test fixes: pstage, finset 2015-12-20 12:21:21 -05:00
Daniel_M_Williams
b6c30a59ba fixed extra capitalization of FlightConfigurationId 2015-12-16 20:19:32 -05:00
Daniel_M_Williams
c3b2316cbf fixed ParallelStageTest 2015-12-15 22:10:12 -05:00
Daniel_M_Williams
f1eb3d75d8 fixed LaunchLugTest 2015-12-15 22:08:11 -05:00
Kevin Ruland
66f1e0b901 Rename some classes for clarity. 2015-12-14 22:46:36 -06:00
Kevin Ruland
e89754bbb2 Fix RocketTest.testCopyFrom. 2015-12-14 21:45:48 -06:00
Kevin Ruland
d840f302ba Only write back through version 1.6. Added test motor to support
OpenRocketSaverTest.
2015-12-14 21:40:51 -06:00
Kevin Ruland
b998bd30c5 Rebase and fix MotorMountHandler. 2015-12-14 21:02:02 -06:00
Daniel_M_Williams
3537748005 Merge branch 'master' of https://github.com/openrocket/openrocket into parallel_staging 2015-12-14 20:14:52 -05:00
Daniel_M_Williams
fb278b3566 fixed FinSetTest 2015-12-14 20:13:51 -05:00
Kevin Ruland
9edf111a56 Changed Unit to go at most 3 digits (I think java changed something in
the number formatting code).  Exclude some methods from ComponentCompare
test which were added recently.
2015-12-13 14:08:57 -06:00
Daniel_M_Williams
729effd690 [Bugfix] Merged FlightConfiguration MotorInstanceConfiguration
fixed ignition configuration load / save
2015-12-03 21:44:34 -05:00
Daniel_M_Williams
890d390b4b [Refactor]ed SimpleStack class to JDK 'ArrayDeque' class 2015-12-03 13:40:21 -05:00
Daniel_M_Williams
82e3a7ff1c [Feature] Implemented more RailButton code:
RailButtons can be loaded, and edited, but not really displayed.
    - data entry has defined file parameters, but needs some debugging.
    - added icons for component creation.  The button just needs to be uncommented
    - display works, but only for rotation = 0;
       - requires a new type of shape drawing.  Not inherently hard, just tedious.
2015-11-22 22:28:51 -05:00
Daniel_M_Williams
e3250c9a91 added exploratory code for non-axisymmetric CPs 2015-11-22 10:12:30 -05:00
Daniel_M_Williams
2501bc2b8f [Bugfix] Enabled auto-positioning of parallel stages
AutoRadialOffset is a boolean flag on parallel stages
    - when enabled, the radialOffset is automatically
    - auto radius is based on the max radius of contained components
2015-11-21 10:02:16 -05:00
Daniel_M_Williams
ec5a3119c5 [Bugfix] Fixed Core Positioning Code
- Launch Lugs correctly position themselves
    (used to default to the centerline of the rocket)
    added LaunchLugTest class
- Booster Sets automatically adjust radial distance
    - based on own, and others' body radius.
- Refactored shiftCoordinates(...) => getInstanceLocations()
2015-11-19 17:53:28 -05:00
Daniel_M_Williams
afe56365f4 Added BarrowmanCalculator tests 2015-11-18 12:05:36 -05:00
Daniel_M_Williams
ee887cae08 [Bugfix] Tested/Fixed Mass Override Calculation Code
- MassCalculator class:
    fixed mass
    fixed CG x-value overrides
- MassCalculatorTest class:
    added tests for:
        setOverrideMass(...)
        setOverrideCGX(...)
2015-11-17 10:04:30 -05:00
Daniel_M_Williams
9d78d823b6 cleaned up extra debug statements 2015-11-15 11:23:20 -05:00
Daniel_M_Williams
4c7c3be9f7 [Bugfix] Verify / Fix Mass Calculation Code
- MassCalculator class:
    Debug toggle will print debug-level output to stderr
    fixed / reimplemented:
        getCG(...) -> getCM( FlightConfiguration, MassCalcType);
        -> getRotationalInertia( FlightConfiguration, MassCalcType);
        -> getLongitudinalInertia( FlightConfiguration, MassCalcType);
- MassData class:
    can now add MassData classes
    Instanced componets w/children:
       take into account component mass...
    propellantMass field is vague: no indication whether it's include in the inertia or not.
    longitudinalInertia => rollMOI (?)
    rotationalInertia => yaw / pitch MOI (?)
    assorted other fixes
- added unit test classes:
    ... .masscalc.MassCalculatorTest;
    ... .masscalc.MassDataTest;
2015-11-14 11:19:08 -05:00