2478 Commits

Author SHA1 Message Date
Daniel_M_Williams
644404b070 [fix] Adds duplicate guard when add a 'ComponentChangeListener' to the rocket 2020-04-06 21:25:54 -04:00
Daniel Williams
58eb9fff90
Merge pull request #601 from teyrana/fix/600/split-fins-cp
[Request Review] Corrects the cp calculations for Split-fin rockets.  Fixes #600.
2020-04-05 20:54:31 -04:00
Daniel_M_Williams
ebf4d35299 [fix] refactors Testrockets to clone existing fins from Alpha III, instead of replacing with new ones 2020-04-05 20:54:14 -04:00
Daniel_M_Williams
b24184afc7 [fix] Adds 4-fin splits to unittests 2020-04-05 20:54:14 -04:00
Daniel_M_Williams
b8172305f8 [test] adds test to verify that splitting fins reproduces the same results 2020-04-05 20:54:14 -04:00
Daniel_M_Williams
67f806492e [cleanup] cleans up the TestRockets.java class
- Shares the configuration ID numbers

- moves to new setAngleOffset function
2020-04-05 20:54:14 -04:00
Daniel Williams
43f51afc6e
Merge pull request #616 from wolsen/issue-615-high-cpu
Don't revalidate/repaint component in Ruler.updateSize()
2020-04-05 14:36:13 -04:00
Billy Olsen
adf3101315 Don't revalidate/repaint component in Ruler.updateSize()
Analysis from Justin Hanney indicates that the CPU is constantly
processing paint events in the ScaleScrollPane.Ruler. Change the
updateSize method to not revalidate and repaint since the
paintComponent method also invokes the updateSize to ensure it is
drawing components of the right size.

This change also refactors the ChangeListener implementation to
have the RulerClass implement the method instead of using an
anonymous class for event handling when ruler units change.

Additionally, this change adds a revalidate call to the scrollPane
to fix an issue where the ruler is not repainted when switching views
from 3D to 2D.

Fixes #615

Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
2020-04-04 14:18:57 -07:00
Daniel Williams
faf770450c
Merge pull request #611 from openrocket/fix/606/fix-example-airstart
[fixes #606] Example rocket "High Power Airstart" had a missing motor.
2020-04-01 22:17:59 -04:00
Joe Pfeiffer
2081715e33
Merge pull request #610 from teyrana/fix/608/fin-count
[fixes #608] save all instance counts, even if equal to 1
2020-03-30 18:53:07 -06:00
Daniel_M_Williams
4ede3a8c60 [fix][example] Fixes 'High Power Airstart' -- with new motor: I211 2020-03-30 20:21:15 -04:00
Daniel_M_Williams
e56e47e83d [fix] save all instance counts, even if ==1 (because different components have different default instance counts 2020-03-30 20:14:21 -04:00
Daniel Williams
370f457a85
Merge pull request #607 from wolsen/jogl-update
Upgrade jogl libraries to 2.4.0-rc-20200306
2020-03-29 19:55:22 -04:00
Daniel Williams
18a8caa5b7
Merge pull request #603 from JoePfeiffer/fix-568
[Fixes 568] Consider all instances of components when calculating drag
2020-03-29 19:53:46 -04:00
JoePfeiffer
06d101c775 remove old 3FNC rocket; not needed since using Alpha III as base for
pods test
2020-03-29 10:13:08 -06:00
Billy Olsen
4e167a5599 Upgrade jogl libraries to 2.4.0-rc-20200306
Update the jogl libraries.

Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
2020-03-28 18:59:46 -07:00
JoePfeiffer
ecc8a32891 Modify "fins on pods" test to use a modified Alpha III 2020-03-28 18:57:32 -06:00
Daniel Williams
7dbbb6c74d
Merge pull request #591 from wolsen/fix-print
[Fixes #531] Fix printing/export as pdf
2020-03-28 20:47:16 -04:00
JoePfeiffer
b1643e4d14 create a dumpRockets() method to save a rocket to a file, so we can open and inspect it in OR 2020-03-28 18:22:43 -06:00
JoePfeiffer
67d507c4b4 Revert "commented out an import to avoid "unused import" warnings due to code commented out"
This reverts commit 6f9c023b1eca18528fe7300c9cb09c27d164c361.
2020-03-28 18:11:12 -06:00
Billy Olsen
d98e2cb6f8 Remove unnecessary override of updateFigure in RocketFigure
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>
2020-03-28 16:49:36 -07:00
Billy Olsen
5977bfa95a Add scaleFactor back into some shapes
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>
2020-03-28 16:49:36 -07:00
Billy Olsen
5bf8a7af15 Update stage logic for DesignReport
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>
2020-03-28 16:49:36 -07:00
Billy Olsen
94534ee8f8 Fix number of motors and stageMass for DesignReport
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>
2020-03-28 16:49:36 -07:00
Billy Olsen
d5598d7380 Clean up some code in DesignReport
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>
2020-03-28 16:49:36 -07:00
Billy Olsen
ca64e9e82a Fix issues with drawing rocket diagram in print/pdf
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>
2020-03-28 16:49:36 -07:00
Billy Olsen
6dae530acc Fix IllegalStateException when export/print
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>
2020-03-28 16:49:36 -07:00
Daniel Williams
dee887479d
Merge pull request #566 from teyrana/fix_finset_angle_units
[review-requested][fix] Adds explicit Angle Unit Conversion to/from FinSet cant and base angles.
2020-03-28 18:13:36 -04:00
JoePfeiffer
6f9c023b1e commented out an import to avoid "unused import" warnings due to code commented out 2020-03-28 15:22:58 -06:00
JoePfeiffer
202bb5f1e4 style point -- moved a "continue;" to its own line for consistency 2020-03-28 15:05:10 -06:00
JoePfeiffer
00abce96ff Add unit test "testPhantomTubes" comparing a simple 3FNC rocket against the same rocket, implemented by replacing the fins by three pods, putting a 0-diameter body tube on each pod, and putting one fin on each pod. 2020-03-25 14:59:52 -06:00
JoePfeiffer
9845decb20 Adjust calculation of axial length (for fineness friction adjustment) to be from tip of rocket to aft-most axial component instead of simply adding all axial component lengths together. Necessary so body tubes on pods don't add to length incorrectly.
TODO:  I suspect we actually ought to be calculating the fineness of the tubes on each pod and adjusting friction on each of them accordinging.
2020-03-25 14:59:52 -06:00
JoePfeiffer
5e5ce3d06e Corrected calculateBaseDrag to iterate through all instances of components
Corrected getPreviousSymmetricComponent and getNextSymmetricComponent to
stop searching and return null when a PodSet is encountered in search (so it
only returns the previous/next component if it's a child of the same pod).
2020-03-25 14:59:52 -06:00
JoePfeiffer
dd3bda8d7e Corrected calculatePressureDrag() to iterate through all instances.
Note this required modifying the function to explicitly get the radius
of the forward symmetric component rather than simply iterating
and assuming components would appear in order (as was the case with
iterating through getActiveComponents()).
The getPreviousSymmetricComponent() method contains a warning that it
doesn't account for external pods, so this will probably need to be
revisited and that method modified.
2020-03-25 14:59:52 -06:00
JoePfeiffer
05185ff3d6 Correct calculatePressureDrag() to iterate through all instances. 2020-03-25 14:59:52 -06:00
JoePfeiffer
5483c3e659 Correct calculateFrictionDrag() to iterate through all instances of components 2020-03-25 14:59:52 -06:00
Daniel_M_Williams
465989f837 [fixes #565] Fixes display of canted fins 2020-03-22 11:07:55 -04:00
Daniel_M_Williams
d23d25ed15 [fix] Fixes error when loading FinSet angles 2020-03-22 11:07:55 -04:00
Daniel_M_Williams
af3d226b2b [fix #592] Fixes the 'Apocalypse with decals' example rocket 2020-03-21 20:53:40 -04:00
Daniel Williams
cd18c65088
Merge pull request #599 from wolsen/fix-eclipse-classpath
Remove OrangeExtensions-1.2.jar from eclipse classpath
2020-03-21 20:51:19 -04:00
Daniel_M_Williams
c4cff028b4 [fixes #540] Fins are now created with a default count of 3 2020-03-21 19:02:39 -04:00
Daniel_M_Williams
f6ea1fc35d [fix] Sets Fins to be created with 3 instances instead of one 2020-03-21 19:02:39 -04:00
Billy Olsen
c789da0389 Remove OrangeExtensions-1.2.jar from eclipse classpath
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>
2020-03-21 09:15:15 -07:00
JoePfeiffer
efe0d9e28d Added missing instanceNumber parameter to String.format() call in toString()
Added explicit call to component.toString() so intellij can print component name
2020-03-19 19:28:47 -04:00
Daniel_M_Williams
b620360da0 [fix] runs jar with default jdk 2020-03-19 19:07:54 -04:00
Daniel_M_Williams
5a1347aafb [fix] Sets Intellij compiler to simply be '11'-- the default, included one 2020-03-19 19:01:24 -04:00
Daniel_M_Williams
cc1e39900a [fix] updates the Boosters example rocket 2020-03-19 18:20:15 -04:00
Daniel_M_Williams
154df7bb34 [fix] updates the Pods example rocket 2020-03-19 18:20:15 -04:00
Neil
0f01a9c437 Address Integer().toString() and Double().toString() warnings. 2020-03-19 18:19:07 -04:00
Daniel_M_Williams
65a4698d37 [fix][Intellij] Intellij now correctly builds jars and tests with all the new libraries 2020-03-19 18:19:07 -04:00