Add 0-second delay suffic to RASAero motor export
This commit is contained in:
parent
a7c63260c5
commit
7cad04653d
@ -3,6 +3,7 @@ package net.sf.openrocket.file.rasaero;
|
|||||||
import net.sf.openrocket.logging.WarningSet;
|
import net.sf.openrocket.logging.WarningSet;
|
||||||
import net.sf.openrocket.motor.Manufacturer;
|
import net.sf.openrocket.motor.Manufacturer;
|
||||||
import net.sf.openrocket.motor.Motor;
|
import net.sf.openrocket.motor.Motor;
|
||||||
|
import net.sf.openrocket.motor.MotorConfiguration;
|
||||||
import net.sf.openrocket.motor.ThrustCurveMotor;
|
import net.sf.openrocket.motor.ThrustCurveMotor;
|
||||||
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
|
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
|
||||||
import net.sf.openrocket.rocketcomponent.ExternalComponent;
|
import net.sf.openrocket.rocketcomponent.ExternalComponent;
|
||||||
@ -378,9 +379,11 @@ public class RASAeroCommonConstants {
|
|||||||
* Format an OpenRocket motor as a RASAero motor.
|
* Format an OpenRocket motor as a RASAero motor.
|
||||||
* @param motors list of available RASAero motors
|
* @param motors list of available RASAero motors
|
||||||
* @param ORMotor OpenRocket motor
|
* @param ORMotor OpenRocket motor
|
||||||
|
* @param motorConfig motor configuration of the selected motor
|
||||||
* @return a RASAero String representation of a motor
|
* @return a RASAero String representation of a motor
|
||||||
*/
|
*/
|
||||||
public static String OPENROCKET_TO_RASAERO_MOTOR(List<ThrustCurveMotor> motors, Motor ORMotor, WarningSet warnings) {
|
public static String OPENROCKET_TO_RASAERO_MOTOR(List<ThrustCurveMotor> motors, Motor ORMotor, MotorConfiguration motorConfig,
|
||||||
|
WarningSet warnings) {
|
||||||
if (!(ORMotor instanceof ThrustCurveMotor)) {
|
if (!(ORMotor instanceof ThrustCurveMotor)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -388,8 +391,11 @@ public class RASAeroCommonConstants {
|
|||||||
for (ThrustCurveMotor motor : motors) {
|
for (ThrustCurveMotor motor : motors) {
|
||||||
if (ORMotor.getDesignation().equals(motor.getDesignation()) &&
|
if (ORMotor.getDesignation().equals(motor.getDesignation()) &&
|
||||||
((ThrustCurveMotor) ORMotor).getManufacturer().matches(motor.getManufacturer().getDisplayName())) {
|
((ThrustCurveMotor) ORMotor).getManufacturer().matches(motor.getManufacturer().getDisplayName())) {
|
||||||
return motor.getDesignation() +
|
String motorName = motor.getDesignation();
|
||||||
" (" + OPENROCKET_TO_RASAERO_MANUFACTURER(motor.getManufacturer()) + ")";
|
if (motorConfig.getEjectionDelay() == 0) {
|
||||||
|
motorName += "-0";
|
||||||
|
}
|
||||||
|
return motorName + " (" + OPENROCKET_TO_RASAERO_MANUFACTURER(motor.getManufacturer()) + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ public class SimulationDTO {
|
|||||||
switch (stageNr) {
|
switch (stageNr) {
|
||||||
// Sustainer
|
// Sustainer
|
||||||
case 0:
|
case 0:
|
||||||
setSustainerEngine(RASAeroCommonConstants.OPENROCKET_TO_RASAERO_MOTOR(motors, motorConfig.getMotor(), warnings));
|
setSustainerEngine(RASAeroCommonConstants.OPENROCKET_TO_RASAERO_MOTOR(motors, motorConfig.getMotor(), motorConfig, warnings));
|
||||||
setSustainerLaunchWt(stage.getSectionMass() * RASAeroCommonConstants.OPENROCKET_TO_RASAERO_WEIGHT);
|
setSustainerLaunchWt(stage.getSectionMass() * RASAeroCommonConstants.OPENROCKET_TO_RASAERO_WEIGHT);
|
||||||
|
|
||||||
// Calculate CG of sustainer
|
// Calculate CG of sustainer
|
||||||
@ -151,7 +151,7 @@ public class SimulationDTO {
|
|||||||
break;
|
break;
|
||||||
// Booster 1
|
// Booster 1
|
||||||
case 1:
|
case 1:
|
||||||
setBooster1Engine(RASAeroCommonConstants.OPENROCKET_TO_RASAERO_MOTOR(motors, motorConfig.getMotor(), warnings));
|
setBooster1Engine(RASAeroCommonConstants.OPENROCKET_TO_RASAERO_MOTOR(motors, motorConfig.getMotor(), motorConfig, warnings));
|
||||||
|
|
||||||
// Aggregate mass of sustainer and booster 1
|
// Aggregate mass of sustainer and booster 1
|
||||||
setBooster1LaunchWt(rocket.getChild(0).getSectionMass() + stage.getSectionMass()
|
setBooster1LaunchWt(rocket.getChild(0).getSectionMass() + stage.getSectionMass()
|
||||||
@ -171,7 +171,7 @@ public class SimulationDTO {
|
|||||||
break;
|
break;
|
||||||
// Booster 2
|
// Booster 2
|
||||||
case 2:
|
case 2:
|
||||||
setBooster2Engine(RASAeroCommonConstants.OPENROCKET_TO_RASAERO_MOTOR(motors, motorConfig.getMotor(), warnings));
|
setBooster2Engine(RASAeroCommonConstants.OPENROCKET_TO_RASAERO_MOTOR(motors, motorConfig.getMotor(), motorConfig, warnings));
|
||||||
|
|
||||||
// Aggregate mass of sustainer, booster 1 and booster 2
|
// Aggregate mass of sustainer, booster 1 and booster 2
|
||||||
setBooster2LaunchWt(rocket.getChild(0).getSectionMass() + rocket.getChild(1).getSectionMass() +
|
setBooster2LaunchWt(rocket.getChild(0).getSectionMass() + rocket.getChild(1).getSectionMass() +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user