Previously, updateFigure was overridden in RocketFigure in order to
ensure that all component shapes were added to the rocket prior to
calling the paintComponent method. This is superfluous as the
paintComponent method already adds the shapes prior to rendering.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
NoseCones aren't rendered correctly when printing/exporting as PDF
due to the scaleFactor not being honored correctly in TransitionShapes.
There was a good refactor to move some of the scaling pieces out,
however the PrintableNoseCone didn't benefit from these changes.
This restores part of the scaleFactor bits to the TransitionShapes
in order to get the printing to correctly work again. This code should
be transitioned to the new method for scaling.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Stages need to be activated correctly in order to properly
calculate the mass for all components that contribute to
the current launch scenario.
This change ensures that all of the stages from the top-most
stage to the currently active stage are set as activated when
stage mass is being calculated.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Fix the number of motors that are reported. A previous change made
the MotorMount.getMotorCount() return the number of motors which
have been configured. However, according to the javadocs of the
MotorMount interface, the getMotorCount() method is supposed to
return the number of motors that a MotorMount can take for
configuring it. This restores the InnerTube and BodyTube getMotorCount
behavior and adds a new getMotorConfigurationCount() method to
provide the new behavior.
Additionally, the stageMass calculations in the DesignReport were
using a deprecated method which does not return proper component
weights. Change this to use the MassCalculator.calculateLaunch(...)
method, which is consistent with the RocketPanel behavior.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Clean up some of the code in DesignReport, including some
refactoring TODOs in the addMotorData method.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Some refactoring of the code for the RocketFigure class caused
changes which prevent the rocket from being rendered correctly
when printing a report or exporting as PDF. The issue was due
to shapes not being added to the rocket and pixel dimensions
being incorrect for the logic in the DesignReport.
This change ensures that rocket shapes are added when the
RocketFigure's updateFigure method is called. It also modifies
the PrintFigure to expose some of the underlying geometries of
the subject_bounds, which are necessary for the pixel and drawing
calculations used in the DesignReport.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Correct the logic for detecting if a motor has an invalid
FlightConfigurationId and throw an IllegalStateException only in the
case that it has an error.
Additionally, fix the lookup for the stageMass. The wrong value was
passed to the MassCalculator.getCGAnalysis(..) which resulted in
a NullPointerException.
Fixes#531
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Commit a7c0cb2 removed the OrangeExtensions-1.2.jar file from the
swing project, but failed to remove it from the eclipse classpath.
This fixes that.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Previous refactoring of the event listeners lost notifications
to classes which care about changes to the DoubleModel. One
such example is the UnitSelector. Ensure that all the
ChangeEventListeners and StateChangeEventListeners are called
when the setValue method is invoked.
Closes#553
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Update the eclipse .classpath files to point to the new and updated
jar files that were merged as part of the recent upgrade to Java 11/
Java 13 commits.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Add unit tests to cover some of the FlightData object and
some of the calculations. This specifically covers the bits
for FlightData.getGroundHitVelocity() where the ground hit
velocity is calculated from a FlightDataBranch consisting
of a series of data points and events occuring during flight.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
The ground hit velocity is calculated by taking the last recorded
total velocity for the flight data and using that as the ground
hit velocity if the last altitude measurement is less than 10 m.
This method worked until commit f11a3e4 introduced the ability to
track and report all events that happened after a GROUND_HIT event.
That commit introduced a GroundStepper that will step between the
GROUND_HIT event and the SIMULATION_END event and will always
add a measurement to the flight data to record the rocket being on
the ground.
A better way of measuring the ground hit velocity is to interpolate
the velocity at the time the GROUND_HIT event, as that would actually
be the appropriate ground hit velocity.
Closes#576
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
The switch to using JOGL uses the current JPEGs, but these textures
cannot be read using the GL.GL_RGBA format which is eventually
propigated to the user by an error dialog showing a NullPointerException
for the texture which failed to load. Using GL.GL_RGB as the format when
loading the textures will resolve the texture loading issue, but the
images are inverted due to differences between AWT and JOGL
interpretation of where the image starts (top left vs bottom left).
Change instead to use the AWTTextureIO class to create the textures
which solves both problems - the loading of the texture as well as
presenting the image in the appropriate orientation.
Closes#573
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Adds back the instance options in the previous commit for specifying
instance details about rail buttons. This change adds it back but
slightly tweaks the layout and location in order to keep the config
panel in a 2 column arrangement.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Add two new material types for rail buttons, delrin and nylon.
The material densities are pulled from wikipedia and cross-referenced
with Dupont's material database.
Additionally, set Delrin as the default material for RailButtons.
Closes#554
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Allow rail buttons to define presets. This change doesn't actually add
any default presets to the library, but enables the ability to add some
preset options for rail buttons.
Partially Closes#554
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>