58 Commits

Author SHA1 Message Date
Kevin Ruland
e9060272e4 Created a GeneralRocketSaver object which is analogous to GeneralRocketLoader. Based on the StorageOptions, it determines how to save the file using a RocksimSaver or OpenRocketSaver as appropriate. Modified RocksimSaver and OpenRocketSaver so they only operate on OutputStreams. Removed methods from RocketSaver interface which operated on File. Fixed bug in DecalRegistry where it wouldn't handle absolute filenames. Fixed bug in BasicFrame where it would display ugly stuff for the filename. 2012-10-23 16:19:37 -05:00
Bill Kuker
4fe9dc4eef Fix to provide a FileInfo to the GeneralRocketLoader 2012-10-23 16:13:49 -05:00
Kevin Ruland
05d1b91d90 Sizable commit with lots of changes to support decals in openrocket files. Added support for zip container support. Changed Decal to hold a String instead of URL. Refactored GeneralRocketLoader out of the RocketLoader hierarchy so the GeneralRocketLoader knows about files and RocketLoader only knows about streams. Changed the OpenRocket file format to 1.6 and added <appearance> and it's children for ambient light and decals. Implemented a DecalRegistry which is a member of the OpenRocketDocument. This class is used to get InputStreams for decals by their names. 2012-10-23 15:54:45 -05:00
kruland2607
ecac762940 Break up the area/cg test cases and add some documentation describing
what they are doing.
2012-10-07 22:20:33 -05:00
kruland2607
4d77c817d8 Merged changes fixing NaN when computing fin CG. 2012-10-07 22:18:53 -05:00
kruland2607
9c3fce4517 Added couple of simple unit tests for computing area and cg for
Trapezoidal and Free Form FinSets.
2012-10-07 22:18:06 -05:00
Sampo Niskanen
506dc0c9b7 Unit rounding fine-tuning 2012-09-28 19:42:11 +00:00
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