Skip to content

Conversation

@SiboVG
Copy link
Member

@SiboVG SiboVG commented Mar 19, 2023

This PR fixes #875 and implements RASAero II file (.CDX1) importing. Almost all RASAero components are compatible with OR, although sometimes through the use of inline pods), except for some special stuff like special fin cross sections (see #1626) and protrusions on body tubes. RASAero also uses per-simulation based rocket weight and CG (override).

In short, the following information is imported:

  • Rocket components
    • Surface finished are also imported
  • Recovery devices
  • Simulations
    • Launch site settings are also imported for each sim
    • Motors found in the OR database are also imported
  • Comments of the rocket

An immense shoutout to @hcraigmiller for very thorough testing of this PR, and also for doing some preliminary coding in the past (e.g. creating the icons).


Importing can be done in a dedicated menu item:
image

or in the File > Open menu:
image

Demo:

Screen.Recording.2023-03-19.at.20.53.32.mp4

I have written some basic unit tests, but haven't implemented parameter checking for every imported component type, or checking e.g. each possible combination of recovery device importing (there are edge cases). As said before, @hcraigmiller has already done a great deal of testing, so I'm fairly confident that the importing should be stable and correct. So, I will just created a new issue request for extending the unit tests after this PR is merged. (Remind me to do so in case I forget)

If you want additional information on the importing, I advise you to ask @hcraigmiller, as I'm a bit busy at work right now.

Useful later for using the file name as the rocket name
Could probably be elaborated more for the separate handlers... I'm just sick of RASAero importing at this point
Apparently RASAero doesn't support recovery devices in other stages
# Conflicts:
#	core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java
#	core/src/net/sf/openrocket/rocketcomponent/SymmetricComponent.java
#	core/test/net/sf/openrocket/rocketcomponent/SymmetricComponentVolumeTest.java
#	swing/src/net/sf/openrocket/gui/main/BasicFrame.java
#	swing/src/net/sf/openrocket/gui/util/Icons.java
@hcraigmiller
Copy link
Collaborator

@SiboVG, consensus reached:
Rules Recovery Device Placement

With corrections by @JoePfeiffer due to my continuous brain fart as to the vent band rule...

@SiboVG
Copy link
Member Author

SiboVG commented Mar 21, 2023

@SiboVG, consensus reached: Rules Recovery Device Placement

With corrections by @JoePfeiffer due to my continuous brain fart as to the vent band rule...

Alright, thanks! Will correct it soon.

@JoePfeiffer
Copy link
Contributor

Almost! If there are exactly three body tubes (ie no payload section and no vent band) and two recovery devices, device 1 is in tube 2 and device 2 is in tube 1.

@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Mar 21, 2023

Addition requested by @JoePfeiffer:
Rules Recovery Device Placement

That should be it ... in your court @SiboVG.

@SiboVG
Copy link
Member Author

SiboVG commented Mar 21, 2023

Phew, I'm gonna have a beer once this PR is merged.

@JoePfeiffer
Copy link
Contributor

Looks good! Thanks for your patience with my nit picking @hcraigmiller and @SiboVG .

Is it waiting on anything else?

@SiboVG
Copy link
Member Author

SiboVG commented Mar 22, 2023

The new rules should be in place now.

@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Mar 22, 2023

Errors:

VBC = Vent Band Count
VBP = Vent Band Position (BT count from top)

1 RECOVERY DEVICE

1 Body Tubes, VBC=0: Correct.

2 Body Tubes, VBC=0: Recovery Device 1 is positioned in BT-2 (Recovery Device 1 should be in BT-1).

3 Body Tubes, VBC=0: Correct.

4+ Body Tubes, VBC=0: Recovery Device 1 is positioned in BT-3 (Recovery Device 1 should be in BT-2).

3+ Body Tubes, VBC=1, VBP=2: Recovery Device 1 is positioned below the vent band (it should be above the vent band).

2 RECOVERY DEVICES

1 Body Tubes, VBC=0: Correct.

2 Body Tubes, VBC=0: Recovery Device 1 (deployment at apogee) is positioned over the top of Recovery Device 2 near the top of the first body tube (Recovery Device 1 should be in the second body tube).

3 Body Tubes, VBC=0: Recovery Device 1 (deployment at apogee) is positioned over the top of Recovery Device 2 near the top of the first body tube (Recovery Device 1 should be in the second body tube).

4 Body Tubes, VBC=0: Correct.

5 Body Tubes, VBC=0: Correct.

6 Body Tubes, VBC=0: Correct.

3 Body Tubes, VBC=1, VBP=2: Recovery Device 1 (deployment at apogee) is positioned over the top of Recovery Device 2 near the top of the body tube immediately above (Recovery Device 1 should be below) the first body tube of less than .8 calibers.

4 Body Tubes, VBC=1, VBP=2: Recovery Device 1 (deployment at apogee) is positioned over the top of Recovery Device 2 near the top of the body tube immediately above (Recovery Device 1 should be below) the first body tube of less than .8 calibers.

IF BTC=>5 then (incorrectly) Recovery Device 1 is always placed in BT-2 and Recovery Device 2 is always placed in BT-3.

5 Body Tubes, VBC=1, VBP=2: Recovery Device 2 is positioned in BT-2 the vent band (should be BT-1 above the vent band).

5 Body Tubes, VBC=1, VBP=3: Recovery Device 1 is positioned in BT-3 the vent band (it should be below the vent band).

5 Body Tubes, VBC=1, VBP=4: Recovery Device 1 is positioned in BT-2 (should be BT-3) and the vent band Recovery Device 1 is positioned in BT-3 (should be BT-4)

@SiboVG
Copy link
Member Author

SiboVG commented Mar 22, 2023

Sorry, there was a small logic error that cause issues with recovery device 1.

5 Body Tubes, VBC=1, VBP=2: Recovery Device 2 is positioned in BT-2 the vent band (should be BT-1 above the vent band).

5 Body Tubes, VBC=1, VBP=3: Recovery Device 1 is positioned in BT-3 the vent band (it should be below the vent band).

5 Body Tubes, VBC=1, VBP=4: Recovery Device 1 is positioned in BT-2 (should be BT-3) and the vent band Recovery Device 1 is positioned in BT-3 (should be BT-4)

Okay, I thought from your image that once you have 4+ body tubes, I should ignore the VB. I'll adjust it.

@SiboVG
Copy link
Member Author

SiboVG commented Mar 22, 2023

I hope it's correct this time.

@hcraigmiller
Copy link
Collaborator

Errors:
Rules Recovery Device Placement 1645

@SiboVG
Copy link
Member Author

SiboVG commented Mar 23, 2023

Errors: Rules Recovery Device Placement 1645

That's a bit odd, the logical appears to be correct at first sight. Could you maybe send me the .CDX1 file of one of the faulty tests @hcraigmiller?

@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Mar 23, 2023

Here are all of the files. the file names are shown on the spreadsheet (correct and incorrect).

RASAero2.RecoveryDevicePlacement.zip

@SiboVG
Copy link
Member Author

SiboVG commented Mar 23, 2023

Okay, I actually think my previous commit fixed the issue. I used an ArrayList, which can sometimes mess up the ordering of the items. Care to try again @hcraigmiller?

@SiboVG
Copy link
Member Author

SiboVG commented Mar 23, 2023

Oh yeah, and I love how organized you are 😍.

@hcraigmiller
Copy link
Collaborator

One more time:
Rules Recovery Device Placement 1649

Not sure what happened, went from correct to ncorrect.

@SiboVG
Copy link
Member Author

SiboVG commented Mar 23, 2023

One more time: Rules Recovery Device Placement 1649

Not sure what happened, went from correct to ncorrect.

Ah, that was a typo in the code... Should be done now.

@hcraigmiller hcraigmiller merged commit 2fb29cb into openrocket:unstable Mar 23, 2023
@SiboVG SiboVG deleted the issue-875 branch March 23, 2023 03:18
@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Mar 23, 2023

Alright, that merge was accidental. All of the placements are correct. Should the merge be left or reverted?

@SiboVG
Copy link
Member Author

SiboVG commented Mar 23, 2023

Alright, that merge was accidental. All of the placements are correct. Should the merge be left or reverted?

Recovery device placement was the final check for this PR, so it's okay to leave it.

@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Mar 23, 2023

I hit the revert button before I asked. How do I clear it?
Untitled

@SiboVG
Copy link
Member Author

SiboVG commented Mar 23, 2023

I hit the revert button before I asked. How do I clear it? Untitled

I deleted the revert branch, it's fine now. I went to the openrocket repo (not your own), then clicked on the branches
image

and there you can delete the revert branch:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RASAero import

4 participants