51 Commits

Author SHA1 Message Date
Sampo Niskanen
9ed7836999 Remove invalid unit test 2012-09-16 12:39:45 +00:00
Sampo Niskanen
308203c9c9 Remove dependency on java.text.Normalize 2012-08-27 19:46:44 +00:00
Sampo Niskanen
31ace7b312 Material localization support 2012-08-25 20:10:58 +00:00
Kevin Ruland
ab4c14d3a0 Fix correctness and threading issue in new Manufacturer lookup mechanism. It was incorrect because the Manufacturer objects should be registered under the searchNames. The threading correctness is only an issue in the Manufacturer.get(String) method when the name does not exist. This is handled by using external locking mechanism. Added a unit test which exposed the problem looking for the manufacturer "Contrail_Rockets". 2012-08-24 20:31:13 +00:00
Kevin Ruland
ba1c0fd2fa Removed FIXME comment since I'm convinced the test case is correct. Recall these tests were originally in a main loop. 2012-08-23 02:37:51 +00:00
Sampo Niskanen
ceeade06b4 Negative number test 2012-08-13 20:47:29 +00:00
Kevin Ruland
43b269c0f4 Change the implementation of ArrayUtils.range to include the stop value if it is a multiple of step. 2012-08-10 20:03:21 +00:00
Kevin Ruland
301067e301 Added unit tests and fixed rounding problem in ArrayUtils.range(). 2012-08-10 19:09:27 +00:00
Kevin Ruland
a5c3c1ac76 Rework the CustomExpression evaluation to use SimulationListeners. Removed the OpenRocketDocument member variable from the Simulation object. 2012-08-08 02:24:40 +00:00
Richard Graham
3d5ae6752a Big update to custom expression feature.
- supports range and index subexpressions and many new operators
 - switched to my patched version of exp4j to support all this.
 - expressions belong to rocket document. Accessed from analysis menu.
 - expression importing from file
 - datatypes section defined in file for storing datatypes other than internal ones
 - flightdatatype fix to forget outdated types
 - many GUI fixes to custom expressions
 - new unitgroups supported. Auto unit detection for SI units in custom expressions.

Had to carefully merge loading/saving code with Kevins recent de-localization update. Hopefully changes to materials saving kept but switched datatype access to just using symbol as the key.

Hopefully can get the changes to exp4j upstream so we don't need to keep using this patched version.
2012-08-05 23:59:54 +00:00
Kevin Ruland
77e3652249 De-localize Material and FlightDataType objects when persisting in ork files. Added a String key to each of these objects which holds on to a unique identifier which is stored in the ork file. User defined Materials are given a key which is defined as "UserDefined." + name.
The construction pattern for Material has changed so explicitly passing in the userDefined boolean is no longer required.  Instead there are two different factory methods to be used.  Direct construction of Material derived classes is no longer allowed.

The persistence mechanism for Materials in perferences has changed.  It will now persist the key and name but still supports reading old format.

The example files have been regenerated, but will need to be regenerated again prior to an official build in order to get the version string correct.
2012-07-31 21:20:55 +00:00
Kevin Ruland
c6a9f17179 Merge branches/froyo_12.03 to head. 2012-07-18 14:42:27 +00:00
Kevin Ruland
357f370096 Extract Transformation.main to junit test. 2012-07-12 02:44:32 +00:00
Kevin Ruland
310e35293a Extract Quaternion.main to junit test. 2012-07-10 18:52:13 +00:00
Kevin Ruland
f08ad83e5f Extract PolyInterpolator.main into Junit test case. 2012-07-10 18:42:35 +00:00
Kevin Ruland
44b1593955 Pull LinearInterpolator.main() into a JUnit test. 2012-07-10 17:53:34 +00:00
Kevin Ruland
f191e47f5b Extract Base64.main() as a unit test. 2012-07-10 17:08:39 +00:00
Sampo Niskanen
723539619c Component preset updates 2012-06-18 19:48:57 +00:00
Richard Graham
71b36bc481 - Implemented copying of custom expressions to other simulations in expression builder dialog. Note the small changes to various files are to allow simulations access to parent document.
- Switched to unicode char escapes
- Removed dynamic setting of flightdatatype priority
- Now hiding up down arrows in custom expression pane when unusable
- Localized custom expression operator discriptions.
2012-06-11 04:47:49 +00:00
Doug Pedrick
eb0cfe141e Added ruler graphic to printed output; improvements to layout and margins in printing; bug fix in PrintUnit; other
minor printing related cleanup.
2012-05-28 04:28:26 +00:00
Kevin Ruland
4abceb9185 Minor modification to test case which makes setting breakpoints easier. No functional or assert changes. 2012-05-23 14:38:36 +00:00
Kevin Ruland
0302130c11 My assessment of why IntegrationTest was failing was incorrect. After perusing the history I found that in repository revision 599, I introduced changes to the computation of Transition volume which accounted for the volume of the shoulders as well as the body of the transition. This change broke the computation of CG. This commit reverts IntegrationTest and adds some cg tests to SymmetricComponentVolumeTest which contains the values produced by the old code. A future commit will correct SymmetricComponent.getCG and all these tests will work again. 2012-05-23 14:23:01 +00:00
Kevin Ruland
e10ff31830 Fix IntegrationTest which was broken when the nose cone / transition volume and area computations were corrected. 2012-05-22 20:50:45 +00:00
Kevin Ruland
953082ea05 Fix BaseComponentDTOTest to point to an image file which actually exists. 2012-05-22 20:40:18 +00:00
Kevin Ruland
254e5670da Fix ComponentCompare and ComponentCompareTest. ComponentCompare needed to not verify the getMotorMounts method which was recently added. ComponentCompareTest needed to extend BaseTestCase so the materials db was initialized. 2012-05-22 20:39:29 +00:00
Kevin Ruland
32ad0c1df6 Change the textual representation of fractional units to use Unicode superscripts and subscripts. Unfortunately, the default fonts included with iText do not have these characters mapped so we needed to switch to a new true type font DejaVu. Added the DejaVuSerif font definition to the resources and modified the pdf writing process to use this font. Because this font is slightly wider, the column headings in the DesignReport had to be made smaller. Finally, had to modify the ExpressionParser to convert the unicode chars to real digits in order to have the expression parser be able to work with this representation. 2012-05-22 18:36:04 +00:00
Kevin Ruland
f42e6fa85a Remove the old FractionUtil class containing the parser since we're using exp4j now. 2012-05-22 18:32:21 +00:00
Sampo Niskanen
9552b2de86 Expression parser updates 2012-05-22 04:11:25 +00:00
Kevin Ruland
bd680c7e14 Added support for Unit 'in/64' which is inches with fractional representation. DoubleModel has one FIXME indicating that we need to reenable min & max in the abstract spinner model. 2012-05-10 02:48:07 +00:00
Kevin Ruland
5cd524e675 Renamed the PresetTest helper class to PresetAssertHelper. This keeps ant unittest from carping about a *Test.java file which contains no tests. 2012-05-08 18:13:52 +00:00
Kevin Ruland
370dfd0e18 Change the InvalidComponentPresetException so it reports all errors found in a preset instead of just the first. Changed all the test cases to ensure the proper errors are reported. 2012-05-06 13:27:30 +00:00
Kevin Ruland
3792528e01 Added LaunchLug, Streamer and Parachute ComponentPresets. 2012-05-01 17:40:55 +00:00
Doug Pedrick
45dae98850 Support for base64 images in .orc; performance improvement to the JAXBContext 2012-04-28 03:16:42 +00:00
Kevin Ruland
3f4f712472 When a component preset for NOSE_CONE or TRANSITION has filled set to true, then the shoulders are assumed to be filled as well. 2012-04-24 21:21:33 +00:00
Kevin Ruland
4731a7345d Change the implementation of Transition getComponentVolume to include the volumes of the shoulders as well as the main body. This means that Transition no longer needs to override getComponentMass since the default implementation of density * volume now works correctly.
Added helper function to RocketComponent to compute the volume of a ring component by computing the "mass" with density of 1.0.
2012-04-24 18:24:22 +00:00
Kevin Ruland
40b28eeb3a Added test cases for computing volumes & masses of nc & transitions with shoulders. 2012-04-23 21:32:04 +00:00
Kevin Ruland
b2d3589104 Fixed problems in computation of SymmetricComponent.integrate found by new unit tests. There were two problems with the previous code. First due to rounding errors, it was possible during the last iteration, the right end point (x+l) was beyond the overall length of the component. This resulted in a zero 0 being used for r2 throwing off the overall computation of volume. The second problem was for hollow components. The test for when to switch from using filled to hollow was incorrect because it was comparing r to thickness. However, thickness is normal to the surface of the component so this test overestimated the total volume of the component.
After making these computation changes, the tests for the density computation in  NoseConePresetTests and TransitionPresetTests could be tightened.
2012-04-23 17:51:50 +00:00
Kevin Ruland
27411395f9 Change nose cone preset to use Aft Outer Diameter, Aft Shoulder Length, and Aft Shoulder Diameter to be consistent with Transitions. Added a bunch of unit tests and correct behavior of the rocketcomponent setters to clear the preset appropriately. Modified the temporary csv data files to use the "aft" specifiers. 2012-04-22 20:26:22 +00:00
Kevin Ruland
d8821bcfdb Changed Unit.toString to use 0.### format for pretty small numbers ( 0.0005 < . < 0.095). Modified the unit test to have explicit tests for rounding to the correct value at the correct position (for round to even rule). 2012-04-20 18:54:47 +00:00
Kevin Ruland
b6307745ca Pulled unit tests for Unit.toString from Unit.main into a real unit test. 2012-04-20 15:45:24 +00:00
Sampo Niskanen
9c6b275e84 Change toLowerCase() to toLowerCase(Locale.ENGLISH) 2012-03-27 11:42:31 +00:00
Sampo Niskanen
8f6fa2121c Remove test dependency on Swing 2012-03-17 20:35:21 +00:00
Sampo Niskanen
dabfa28b9d Fix tests 2012-03-10 21:12:33 +00:00
Sampo Niskanen
7401254c4b motor loading refactoring 2012-01-29 18:13:23 +00:00
Doug Pedrick
b5642117ce DGP - bug fix for MassObject/Shock Cord 2012-01-23 03:39:47 +00:00
Kevin Ruland
c3cfb2e781 Persist the Velocity at launch rod clearance in ork file. Added to column in SimulationPanel. Added computation of Velocity at deployment in FlightData. Persist Velocity at deployment in ork file and added to SimulationPanel and DesignReport.
Added l10n message keys for new column in SimulationPanel.

Added function MathUtil.interpolate which does linear interpolation of intermediate values.  This is used in FlightData for computing Velocity at deployment and Velocity at launch rod clearance.
2012-01-17 02:46:49 +00:00
Kevin Ruland
398f302dfc Change handling of Motor Digests. The computed digest value is now stored as a member variable in the ThrustCurveMotor and avaliable through the getDigest() method. getDigest() was added to the Motor interface. All references to MotorDigest.digestMotor() were removed from the application.
The android db now stores the digest.  Also changed persistance mechanism for delays to store as comma delimited string.

The TestMotorLoader is now failing because the digests have changed.
2012-01-15 02:46:13 +00:00
Kevin Ruland
8d90a540e8 Fix unit test setup which has probably been broken since the ExceptionHandler was refactored to a static object stored in the Applicaiton. 2012-01-15 02:29:34 +00:00
Doug Pedrick
d6c730cfa4 DGP - support for clusters(import and export); added thickness to tube coupler; cleanup and refactoring 2012-01-10 02:13:18 +00:00
Doug Pedrick
453b7629d9 DGP - support for clusters(import and export); added thickness to tube coupler; cleanup and refactoring 2012-01-10 02:04:57 +00:00