When the events STAGE_SEPARATION and EJECTION_CHARGE are both triggered by
BURNOUT, both events occur simultaneously and either can be inserted
in EventQueue first. If STAGE_SEPARATION is inserted first, the
filter in BasicEventSimulationEngine.java ignoring events from
components that are no longer attached to the rocket drops ignores
EJECTION_CHARGE. If second stage IGNITION is triggered by
EJECTION_CHARGE it is filtered out, and second stage IGNITION fails to
happen. This can be seen in the following snippet of a log file:
10592 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Handling event FlightEvent[type=BURNOUT,time=1.03,source=Body tube,data=B4]
10592 DEBUG [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - detected Motor Burnout for motor B4@ 1.03 on stage 1: Stage
10592 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Obtained event from queue: FlightEvent[type=STAGE_SEPARATION,time=1.03,source=Stage,data=null]
10592 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Remaining EventQueue = [FlightEvent[type=EJECTION_CHARGE,time=1.0311458852237796,source=Stage,data=B4], FlightEvent[type=ALTITUDE,time=1.0311458852237796,source=Rocket,data=[25.502739793351193;25.603323566419885]]]
10592 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Handling event FlightEvent[type=STAGE_SEPARATION,time=1.03,source=Stage,data=null]
10592 INFO [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - ==>> @ 1.03115; from Branch: Sustainer ---- Branching: Stage ----
10593 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Obtained event from queue: FlightEvent[type=EJECTION_CHARGE,time=1.0311458852237796,source=Stage,data=B4]
10593 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Remaining EventQueue = [FlightEvent[type=ALTITUDE,time=1.0311458852237796,source=Rocket,data=[25.502739793351193;25.603323566419885]]]
10593 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Ignoring event from unattached componenent
10593 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Obtained event from queue: FlightEvent[type=ALTITUDE,time=1.0311458852237796,source=Rocket,data=[25.502739793351193;25.603323566419885]]
10593 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Remaining EventQueue = []
10593 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Handling event FlightEvent[type=ALTITUDE,time=1.0311458852237796,source=Rocket,data=[25.502739793351193;25.603323566419885]]
10593 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Taking simulation step at t=1.0311458852237796 altitude 25.603323566419885
10593 TRACE [pool-4-thread-1] n.s.o.s.RK4SimulationStepper - Too small time step 0.0014030377018961126 (limiting factor 5), using 0.0025 instead.
10593 TRACE [pool-4-thread-1] n.s.o.s.RK4SimulationStepper - Thrust = 0.0
Note here that there was no IGNITION in the sustainer branch, and the
Thrust is 0.0 at the end of the snippet.
Moving the test for ignition events ahead of the filter assures the
IGNITION is scheduled, as seen in this log file snippet:
8994 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Obtained event from queue: FlightEvent[type=BURNOUT,time=1.03,source=Body tube,data=B4]
8994 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Remaining EventQueue = [FlightEvent[type=ALTITUDE,time=1.0302951181945657,source=Rocket,data=[25.478255057184594;25.5788943164009]]]
8994 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Handling event FlightEvent[type=BURNOUT,time=1.03,source=Body tube,data=B4]
8994 DEBUG [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - detected Motor Burnout for motor B4@ 1.03 on stage 1: Stage
8994 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Obtained event from queue: FlightEvent[type=STAGE_SEPARATION,time=1.03,source=Stage,data=null]
8994 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Remaining EventQueue = [FlightEvent[type=EJECTION_CHARGE,time=1.0302951181945657,source=Stage,data=B4], FlightEvent[type=ALTITUDE,time=1.0302951181945657,source=Rocket,data=[25.478255057184594;25.5788943164009]]]
8994 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Handling event FlightEvent[type=STAGE_SEPARATION,time=1.03,source=Stage,data=null]
8995 INFO [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - ==>> @ 1.03030; from Branch: Sustainer ---- Branching: Stage ----
8995 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Obtained event from queue: FlightEvent[type=EJECTION_CHARGE,time=1.0302951181945657,source=Stage,data=B4]
8995 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Remaining EventQueue = [FlightEvent[type=ALTITUDE,time=1.0302951181945657,source=Rocket,data=[25.478255057184594;25.5788943164009]]]
8995 INFO [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Queueing Ignition Event for: Body tube/334ebb79 / A8 - Armed @: 1.0302951181945657
8995 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Ignoring event from unattached componenent
8995 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Obtained event from queue: FlightEvent[type=IGNITION,time=1.0302951181945657,source=Body tube,data=A8]
8995 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Remaining EventQueue = [FlightEvent[type=ALTITUDE,time=1.0302951181945657,source=Rocket,data=[25.478255057184594;25.5788943164009]]]
8996 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Handling event FlightEvent[type=IGNITION,time=1.0302951181945657,source=Body tube,data=A8]
8996 INFO [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Igniting motor: Body tube/334ebb79 / A8 - Armed @1.0302951181945657
8996 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Obtained event from queue: FlightEvent[type=ALTITUDE,time=1.0302951181945657,source=Rocket,data=[25.478255057184594;25.5788943164009]]
8996 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Remaining EventQueue = [FlightEvent[type=BURNOUT,time=1.7602951181945656,source=Body tube,data=A8]]
8996 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Handling event FlightEvent[type=ALTITUDE,time=1.0302951181945657,source=Rocket,data=[25.478255057184594;25.5788943164009]]
8996 TRACE [pool-4-thread-1] n.s.o.s.BasicEventSimulationEngine - Taking simulation step at t=1.0302951181945657 altitude 25.5788943164009
8996 TRACE [pool-4-thread-1] n.s.o.s.RK4SimulationStepper - Too small time step 0.0012514398786730699 (limiting factor 5), using 0.0025 instead.
8996 TRACE [pool-4-thread-1] n.s.o.s.RK4SimulationStepper - Thrust = 0.015609756097560644
Here, the IGNITION does take place, and Thrust is non-zero.
Displaying a plot of the flight, and saving CSV files, shows a normal
two-stage flight profile.
This commit does two things:
(1) adds a little more logging, in particular logging what event has been
obtained from EventQueue and logging when that event is ignored.
(2) moves the motor ignition events test ahead of the filter, as
described above.
createSimulationForConfiguration() assumed addConfiguration() and
copyConfiguration() would set the new configuration as selected, but
they didn't resulting in simulation based on old configuration, not new
one. Fixed.
addConfiguration() and copyConfiguration() had enough common code that
consolidating them and createSimulationForConfiguration() seemed like a
good idea.
Let FlightConfiguration.copy() create new ID for consistency with
constructor.
Formerly just used delay value directly, resulting in huge delay for
plugged motors; now uses motor.getDesignation so it translates to "P" as
expected.
Changed name of toMotorDesription method to toMotorDesignation to match
usage of getDesignation() in ThrustCurveMotor.java
Changed toMotorDesignation to use motor.getDesignation
- Allows more precise and flexible control of component positions
- file format:
-- maintains compatability with previous major release (15.04)
-- may not accept file formats from unstable development branches in-between major releases
(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
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'
- moved 'instancecount' and 'instanceseparation' loading from CenteringRing to RadiusRingComponent
- enables both Bulkhead and CenteringRing to load those tags from .ork file
- Adjusted masscalculater code to not double-count instances (when mass > 0, and instance > 1 )
- RingComponents now correctly calculate their mass again
- introduced interfaces for different types of positionable components:
-- AnglePositionable
-- AxialPositionable
-- RadiusPositionable
- RingInstanceable now includes these other interfaces, making explicit the expectations of
any implementing subclass.
- RingInstanceable now indicates its angles as an array instead of returning angles one-at-a-time
-- commit includes updates to match this new API
- Added getAssembly() method to RocketComponent, to simplify instancing code