From 19c847d44a7a8c88d343ab193e63466a6427fa1e Mon Sep 17 00:00:00 2001 From: JoePfeiffer Date: Tue, 8 Mar 2022 08:35:29 -0700 Subject: [PATCH 1/8] Change default stage separation from next stage ignition to current stage motor burnout. For parallel stages, this is much more likely to be the user's intent. The previous behavior caused stage separation the moment of ignition, so the booster set essentially flew as a second, independent rocket. With this change, the parallel stage stays with the center stack until the ejection charge files (note that OR treats a rocket with a -0 ejection delay as having an ejection charge at motor burnout). Note that this change to the default behavior is also applied to axial stages, but is also appropriate in that case. For the vast majority of low power rockets, the booster burnout ignites the next stage, so "next stage ignition" and "current stage ejection charge" are simultaneous. For high power rockets, the next stage ignition has to be customized anyway. --- .../rocketcomponent/StageSeparationConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/StageSeparationConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/StageSeparationConfiguration.java index 31ee0c893..d7ef82824 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/StageSeparationConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/StageSeparationConfiguration.java @@ -98,7 +98,7 @@ public class StageSeparationConfiguration implements FlightConfigurableParameter private static final Translator trans = Application.getTranslator(); - private SeparationEvent separationEvent = SeparationEvent.UPPER_IGNITION; + private SeparationEvent separationEvent = SeparationEvent.EJECTION; private double separationDelay = 0; private final List configListeners = new LinkedList<>(); From 5ac829ea78f920e6bf332c3b1fc1d5b34c7a4090 Mon Sep 17 00:00:00 2001 From: JoePfeiffer Date: Wed, 9 Mar 2022 11:01:18 -0700 Subject: [PATCH 2/8] Check for active upper stage before dropping booster If there are multiple independent motor clusters in a stage, each of them can attempt a separation event. When the second event happens, there is no longer an active upper stage, so the separation results in a simulation branch with no active stages. This causes a NaN exception as the mass is 0. --- .../BasicEventSimulationEngine.java | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java b/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java index e128cae5f..69fdf3d3d 100644 --- a/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java +++ b/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java @@ -425,24 +425,28 @@ public class BasicEventSimulationEngine implements SimulationEngine { } case STAGE_SEPARATION: { - // Record the event. - currentStatus.getFlightData().addEvent(event); - RocketComponent boosterStage = event.getSource(); final int stageNumber = boosterStage.getStageNumber(); - - // Mark the status as having dropped the booster - currentStatus.getConfiguration().clearStage( stageNumber); - - // Prepare the simulation branch - SimulationStatus boosterStatus = new SimulationStatus(currentStatus); - boosterStatus.setFlightData(new FlightDataBranch(boosterStage.getName(), FlightDataType.TYPE_TIME)); - // Mark the booster status as only having the booster. - boosterStatus.getConfiguration().setOnlyStage(stageNumber); - toSimulate.push(boosterStatus); - log.info(String.format("==>> @ %g; from Branch: %s ---- Branching: %s ---- \n", - currentStatus.getSimulationTime(), - currentStatus.getFlightData().getBranchName(), boosterStatus.getFlightData().getBranchName())); + + if (currentStatus.getConfiguration().isStageActive(stageNumber-1)) { + // Record the event. + currentStatus.getFlightData().addEvent(event); + + // Mark the status as having dropped the booster + currentStatus.getConfiguration().clearStage( stageNumber); + + // Prepare the simulation branch + SimulationStatus boosterStatus = new SimulationStatus(currentStatus); + boosterStatus.setFlightData(new FlightDataBranch(boosterStage.getName(), FlightDataType.TYPE_TIME)); + // Mark the booster status as only having the booster. + boosterStatus.getConfiguration().setOnlyStage(stageNumber); + toSimulate.push(boosterStatus); + log.info(String.format("==>> @ %g; from Branch: %s ---- Branching: %s ---- \n", + currentStatus.getSimulationTime(), + currentStatus.getFlightData().getBranchName(), boosterStatus.getFlightData().getBranchName())); + } else { + log.debug("upper stage is not active; not performing separation"); + } break; } From 5dcbb11f41ea146bcdd41db8bbaf480916f3dcdc Mon Sep 17 00:00:00 2001 From: thzero Date: Thu, 10 Mar 2022 12:21:23 -0600 Subject: [PATCH 3/8] missing close html tokens --- swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java index 452a617dc..3878ad53e 100644 --- a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java +++ b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java @@ -75,7 +75,8 @@ public class AboutDialog extends JDialog { "OpenRocket gratefully acknowledges our use of the following databases:
" + "
" + "Rocket Motor Data (" + href("https://www.thrustcurve.org/") + ")
" + - "Enhanced components database for OpenRocket" + href("https://github.com/dbcook/openrocket-database/") + ")
"; + "Enhanced components database for OpenRocket" + href("https://github.com/dbcook/openrocket-database/") + ")" + + ""; private String href(String url) { return "" + url + ""; From 653618e83e26b722c4a5e12a5eb0491b57155425 Mon Sep 17 00:00:00 2001 From: thzero Date: Thu, 10 Mar 2022 12:24:10 -0600 Subject: [PATCH 4/8] consistent url formatting --- .../openrocket/gui/dialogs/AboutDialog.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java index 3878ad53e..945e35dd5 100644 --- a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java +++ b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java @@ -58,28 +58,28 @@ public class AboutDialog extends JDialog { "Sibo Van Gool (Dutch)
" + "
" + "See all contributors at
" + - href("https://github.com/openrocket/openrocket/graphs/contributors") + "
" + + href("https://github.com/openrocket/openrocket/graphs/contributors", false) + "
" + "
" + "OpenRocket utilizes the following libraries:
" + "
" + - "MiG Layout (" + href("http://www.miglayout.com/") + ")
" + - "JFreeChart (" + href("http://www.jfree.org/jfreechart/") + ")
" + - "iText (" + href("http://www.itextpdf.com/") + ")
" + - "exp4j (" + href("http://projects.congrace.de/exp4j/index.html") + ")
" + - "JOGL (" + href("http://jogamp.org/jogl/www/") + ")
" + - "Guava (" + href("https://github.com/google/guava") + ")
" + - "Opencsv (" + href("http://opencsv.sourceforge.net/") + ")
" + - "Simple Logging Facade for Java (" + href("http://www.slf4j.org/") + ")
" + - "Java library for parsing and rendering CommonMark (" + href("https://github.com/commonmark/commonmark-java") + ")
" + + "MiG Layout " + href("http://www.miglayout.com/", true) + "
" + + "JFreeChart " + href("http://www.jfree.org/jfreechart/", true) + "
" + + "iText " + href("http://www.itextpdf.com/", true) + "
" + + "exp4j " + href("http://projects.congrace.de/exp4j/index.html", true) + "
" + + "JOGL " + href("http://jogamp.org/jogl/www/", true) + "
" + + "Guava " + href("https://github.com/google/guava", true) + "
" + + "Opencsv " + href("http://opencsv.sourceforge.net/", true) + "
" + + "Simple Logging Facade for Java " + href("http://www.slf4j.org/", true) + "
" + + "Java library for parsing and rendering CommonMark " + href("https://github.com/commonmark/commonmark-java", true) + "
" + "
" + "OpenRocket gratefully acknowledges our use of the following databases:
" + "
" + - "Rocket Motor Data (" + href("https://www.thrustcurve.org/") + ")
" + - "Enhanced components database for OpenRocket" + href("https://github.com/dbcook/openrocket-database/") + ")" + - ""; + "Rocket Motor Data " + href("https://www.thrustcurve.org/", true) + "
" + + "Enhanced components database for OpenRocket" + href("https://github.com/dbcook/openrocket-database/", true) + + ""; - private String href(String url) { - return "" + url + ""; + private String href(String url, boolean delimiters) { + return (delimiters ? "(" : "") + "" + url + "" + (delimiters ? ")" : ""); } public AboutDialog(JFrame parent) { From fa9c33deb258633a59c40d20e18eed30c3ced0c2 Mon Sep 17 00:00:00 2001 From: thzero Date: Thu, 10 Mar 2022 12:28:22 -0600 Subject: [PATCH 5/8] code formatting cleanup --- .../openrocket/gui/dialogs/AboutDialog.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java index 945e35dd5..1371bf645 100644 --- a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java +++ b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java @@ -57,25 +57,24 @@ public class AboutDialog extends JDialog { "Polish Rocketry Society / \u0141ukasz & Alex Kazanski (Polish)
" + "Sibo Van Gool (Dutch)
" + "
" + - "See all contributors at
" + - href("https://github.com/openrocket/openrocket/graphs/contributors", false) + "
" + + "See all contributors at
" + href("https://github.com/openrocket/openrocket/graphs/contributors", false) + "
" + "
" + "OpenRocket utilizes the following libraries:
" + "
" + - "MiG Layout " + href("http://www.miglayout.com/", true) + "
" + - "JFreeChart " + href("http://www.jfree.org/jfreechart/", true) + "
" + - "iText " + href("http://www.itextpdf.com/", true) + "
" + - "exp4j " + href("http://projects.congrace.de/exp4j/index.html", true) + "
" + - "JOGL " + href("http://jogamp.org/jogl/www/", true) + "
" + - "Guava " + href("https://github.com/google/guava", true) + "
" + - "Opencsv " + href("http://opencsv.sourceforge.net/", true) + "
" + - "Simple Logging Facade for Java " + href("http://www.slf4j.org/", true) + "
" + + "MiG Layout " + href("http://www.miglayout.com", true) + "
" + + "JFreeChart " + href("http://www.jfree.org/jfreechart", true) + "
" + + "iText " + href("http://www.itextpdf.com", true) + "
" + + "exp4j " + href("http://projects.congrace.de/exp4j/index.html", true) + "
" + + "JOGL " + href("http://jogamp.org/jogl/www", true) + "
" + + "Guava " + href("https://github.com/google/guava", true) + "
" + + "Opencsv " + href("http://opencsv.sourceforge.net", true) + "
" + + "Simple Logging Facade for Java " + href("http://www.slf4j.org/", true) + "
" + "Java library for parsing and rendering CommonMark " + href("https://github.com/commonmark/commonmark-java", true) + "
" + "
" + "OpenRocket gratefully acknowledges our use of the following databases:
" + "
" + - "Rocket Motor Data " + href("https://www.thrustcurve.org/", true) + "
" + - "Enhanced components database for OpenRocket" + href("https://github.com/dbcook/openrocket-database/", true) + + "Rocket Motor Data " + href("https://www.thrustcurve.org", true) + "
" + + "Enhanced components database for OpenRocket" + href("https://github.com/dbcook/openrocket-database", true) + ""; private String href(String url, boolean delimiters) { From a2ac3c778468de164808de3468dfc6b10fddb7e8 Mon Sep 17 00:00:00 2001 From: thzero Date: Thu, 10 Mar 2022 17:45:24 -0600 Subject: [PATCH 6/8] url formatting --- swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java index 1371bf645..b81869135 100644 --- a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java +++ b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java @@ -68,7 +68,7 @@ public class AboutDialog extends JDialog { "JOGL " + href("http://jogamp.org/jogl/www", true) + "
" + "Guava " + href("https://github.com/google/guava", true) + "
" + "Opencsv " + href("http://opencsv.sourceforge.net", true) + "
" + - "Simple Logging Facade for Java " + href("http://www.slf4j.org/", true) + "
" + + "Simple Logging Facade for Java " + href("http://www.slf4j.org", true) + "
" + "Java library for parsing and rendering CommonMark " + href("https://github.com/commonmark/commonmark-java", true) + "
" + "
" + "OpenRocket gratefully acknowledges our use of the following databases:
" + From 7b8176956f9800f1be34dc0f0967ecdb1bb1af7d Mon Sep 17 00:00:00 2001 From: thzero Date: Thu, 10 Mar 2022 17:46:57 -0600 Subject: [PATCH 7/8] missing opensource dependencies --- swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java index b81869135..2c5f99927 100644 --- a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java +++ b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java @@ -70,6 +70,8 @@ public class AboutDialog extends JDialog { "Opencsv " + href("http://opencsv.sourceforge.net", true) + "
" + "Simple Logging Facade for Java " + href("http://www.slf4j.org", true) + "
" + "Java library for parsing and rendering CommonMark " + href("https://github.com/commonmark/commonmark-java", true) + "
" + + "RSyntaxTextArea " + href("http://bobbylight.github.io/RSyntaxTextArea", true) + "
" + + "yasson " + href("https://eclipse-ee4j.github.io/yasson", true) + "
" + "
" + "OpenRocket gratefully acknowledges our use of the following databases:
" + "
" + From a38ab015d51a0c7e3808f442d3a8bc70db95dadd Mon Sep 17 00:00:00 2001 From: thzero Date: Thu, 10 Mar 2022 17:49:50 -0600 Subject: [PATCH 8/8] consistent url formatting --- .../openrocket/gui/dialogs/AboutDialog.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java index 2c5f99927..0496d774b 100644 --- a/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java +++ b/swing/src/net/sf/openrocket/gui/dialogs/AboutDialog.java @@ -57,30 +57,30 @@ public class AboutDialog extends JDialog { "Polish Rocketry Society / \u0141ukasz & Alex Kazanski (Polish)
" + "Sibo Van Gool (Dutch)
" + "
" + - "See all contributors at
" + href("https://github.com/openrocket/openrocket/graphs/contributors", false) + "
" + + "See all contributors at
" + href("https://github.com/openrocket/openrocket/graphs/contributors", false, false) + "
" + "
" + "OpenRocket utilizes the following libraries:
" + "
" + - "MiG Layout " + href("http://www.miglayout.com", true) + "
" + - "JFreeChart " + href("http://www.jfree.org/jfreechart", true) + "
" + - "iText " + href("http://www.itextpdf.com", true) + "
" + - "exp4j " + href("http://projects.congrace.de/exp4j/index.html", true) + "
" + - "JOGL " + href("http://jogamp.org/jogl/www", true) + "
" + - "Guava " + href("https://github.com/google/guava", true) + "
" + - "Opencsv " + href("http://opencsv.sourceforge.net", true) + "
" + - "Simple Logging Facade for Java " + href("http://www.slf4j.org", true) + "
" + - "Java library for parsing and rendering CommonMark " + href("https://github.com/commonmark/commonmark-java", true) + "
" + - "RSyntaxTextArea " + href("http://bobbylight.github.io/RSyntaxTextArea", true) + "
" + - "yasson " + href("https://eclipse-ee4j.github.io/yasson", true) + "
" + + "MiG Layout" + href("http://www.miglayout.com", true, true) + "
" + + "JFreeChart" + href("http://www.jfree.org/jfreechart", true, true) + "
" + + "iText" + href("http://www.itextpdf.com", true, true) + "
" + + "exp4j" + href("http://projects.congrace.de/exp4j/index.html", true, true) + "
" + + "JOGL" + href("http://jogamp.org/jogl/www", true, true) + "
" + + "Guava" + href("https://github.com/google/guava", true, true) + "
" + + "Opencsv" + href("http://opencsv.sourceforge.net", true, true) + "
" + + "Simple Logging Facade for Java" + href("http://www.slf4j.org", true, true) + "
" + + "Java library for parsing and rendering CommonMark" + href("https://github.com/commonmark/commonmark-java", true, true) + "
" + + "RSyntaxTextArea" + href("http://bobbylight.github.io/RSyntaxTextArea", true, true) + "
" + + "yasson" + href("https://eclipse-ee4j.github.io/yasson", true, true) + "
" + "
" + "OpenRocket gratefully acknowledges our use of the following databases:
" + "
" + - "Rocket Motor Data " + href("https://www.thrustcurve.org", true) + "
" + - "Enhanced components database for OpenRocket" + href("https://github.com/dbcook/openrocket-database", true) + + "Rocket Motor Data" + href("https://www.thrustcurve.org", true, true) + "
" + + "Enhanced components database for OpenRocket" + href("https://github.com/dbcook/openrocket-database", true, true) + ""; - private String href(String url, boolean delimiters) { - return (delimiters ? "(" : "") + "" + url + "" + (delimiters ? ")" : ""); + private String href(String url, boolean delimiters, boolean leadingSpace) { + return (leadingSpace ? " " : "") + (delimiters ? "(" : "") + "" + url + "" + (delimiters ? ")" : ""); } public AboutDialog(JFrame parent) {