From aec15658cdb2524f6a4303e1bbb65f85768b74c9 Mon Sep 17 00:00:00 2001 From: JoePfeiffer Date: Wed, 3 Jan 2024 10:53:58 -0700 Subject: [PATCH] Tumbling under thrust should be a sim abort, not a warning. Leaving the old warning in for backward compatibility.A .ork that triggered the warning will load cleanly. On rerunning the sims in the .ork the warning will go away and the sims will abort. --- core/resources/l10n/messages.properties | 1 + core/resources/l10n/messages_ar.properties | 2 +- core/resources/l10n/messages_nl.properties | 2 ++ core/resources/l10n/messages_ru.properties | 1 + core/resources/l10n/messages_uk_UA.properties | 3 ++- core/resources/l10n/messages_zh_CN.properties | 2 ++ core/src/net/sf/openrocket/logging/SimulationAbort.java | 5 ++++- .../sf/openrocket/simulation/BasicEventSimulationEngine.java | 2 +- 8 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties index 81b2b069d..de31b4d87 100644 --- a/core/resources/l10n/messages.properties +++ b/core/resources/l10n/messages.properties @@ -664,6 +664,7 @@ SimulationAbort.noLiftOff = Motor burnout without liftoff.
Use more (po SimulationAbort.activeLengthZero = Active airframe has length 0 SimulationAbort.noCP = Can't calculate Center of Pressure SimulationAbort.activeMassZero = Total mass of active stages is 0 +SimlationAbort.tumbleUnderThrust = Stage began to tumble under thrust. SimulationModifierTree.OptimizationParameters = Optimization Parameters diff --git a/core/resources/l10n/messages_ar.properties b/core/resources/l10n/messages_ar.properties index 363b0bd02..6f5416662 100644 --- a/core/resources/l10n/messages_ar.properties +++ b/core/resources/l10n/messages_ar.properties @@ -560,7 +560,7 @@ BasicEventSimulationEngine.error.NaNResult = .لم ينتج عن المحاكا RK4SimulationStepper.error.valuesTooLarge = .قيم المحاكاة تجاوزت الحدود. حاول تحديد خطوة زمنية أقصر - +SimulationAbort.tumbleUnderThrust = .بدأت المرحلة تتعثر تحت ضغط الدفع SimulationModifierTree.OptimizationParameters = معايير التحسين ! SimulationExportPanel diff --git a/core/resources/l10n/messages_nl.properties b/core/resources/l10n/messages_nl.properties index 2b45dbd5f..534b25dce 100644 --- a/core/resources/l10n/messages_nl.properties +++ b/core/resources/l10n/messages_nl.properties @@ -533,6 +533,8 @@ BasicEventSimulationEngine.error.NaNResult = Simulatie resulteerde in een waarde RK4SimulationStepper.error.valuesTooLarge = Simulatiewaarden overschreden limieten. Probeer een kortere tijdstap te kiezen. +SimulationAbort.tumbleUnderThrust = Trap begon te tuimelen onder stuwkracht. + SimulationModifierTree.OptimizationParameters = Optimalisatieparameters ! SimulationExportPanel diff --git a/core/resources/l10n/messages_ru.properties b/core/resources/l10n/messages_ru.properties index 6b4db81ef..67c595fa3 100644 --- a/core/resources/l10n/messages_ru.properties +++ b/core/resources/l10n/messages_ru.properties @@ -547,6 +547,7 @@ BasicEventSimulationEngine.error.NaNResult = \u0420\u0430\u0441\u0447\u0435\u044 RK4SimulationStepper.error.valuesTooLarge = \u0417\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0432 \u0440\u0430\u0441\u0447\u0435\u0442\u0430\u0445 \u043F\u0440\u0435\u0432\u044B\u0441\u0438\u043B\u0438 \u0433\u0440\u0430\u043D\u0438\u0446\u044B. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0432\u044B\u0431\u0440\u0430\u0442\u044C \u0431\u043E\u043B\u0435\u0435 \u043A\u043E\u0440\u043E\u0442\u043A\u0438\u0439 \u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u0448\u0430\u0433. +SimulationAbort.tumbleUnderThrust = \u0421\u0442\u0443\u043F\u0435\u043D\u044C \u043D\u0430\u0447\u0430\u043B\u0430 \u043A\u0443\u0432\u044B\u0440\u044C\u043A\u0430\u0442\u044C\u0441\u044F \u043F\u043E\u0434 \u0442\u044F\u0433\u043E\u0439. SimulationModifierTree.OptimizationParameters = \u041E\u043F\u0442\u0438\u043C\u0438\u0437\u0438\u0440\u0443\u0435\u043C\u044B\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B ! SimulationExportPanel diff --git a/core/resources/l10n/messages_uk_UA.properties b/core/resources/l10n/messages_uk_UA.properties index f39035f58..654e106ff 100644 --- a/core/resources/l10n/messages_uk_UA.properties +++ b/core/resources/l10n/messages_uk_UA.properties @@ -465,6 +465,8 @@ BasicEventSimulationEngine.error.NaNResult = Simulation resulted in not-a-number RK4SimulationStepper.error.valuesTooLarge = Simulation values exceeded limits. Try selecting a shorter time step. +SimulationAbort.tumbleUnderThrust =Stage began to tumble under thrust. + SimulationModifierTree.OptimizationParameters = Optimization Parameters ! SimulationExportPanel @@ -1530,7 +1532,6 @@ Warning.PARALLEL_FINS = Too many parallel fins Warning.SUPERSONIC = Body calculations may not be entirely accurate at supersonic speeds. Warning.RECOVERY_LAUNCH_ROD = Recovery device device deployed while on the launch guide. Warning.RECOVERY_HIGH_SPEED = Recovery device deployment at high speed -Warning.TUMBLE_UNDER_THRUST = Stage began to tumble under thrust. ! Scale dialog diff --git a/core/resources/l10n/messages_zh_CN.properties b/core/resources/l10n/messages_zh_CN.properties index f3c543eae..e71751995 100644 --- a/core/resources/l10n/messages_zh_CN.properties +++ b/core/resources/l10n/messages_zh_CN.properties @@ -824,6 +824,8 @@ PrintSettingsDialog.title = \u6253\u5370\u8BBE\u7F6E RK4SimulationStepper.error.valuesTooLarge = \u4EFF\u771F\u6570\u503C\u8D85\u51FA\u9650\u5236. \u8BF7\u7F29\u5C0F\u65F6\u95F4\u6B65\u957F. +SimulationAbort.tumbleUnderThrust = \u706B\u7BAD\u7EA7\u5728\u63A8\u529B\u4F5C\u7528\u4E0B\u5F00\u59CB\u503E\u8986. + RecoveryConfigurationPanel.table.deployment.default = \u9ED8\u8BA4 ({0}) RecoveryDevice.DeployEvent.ALTITUDE = \u6307\u5B9A\u4E0B\u964D\u9AD8\u5EA6 diff --git a/core/src/net/sf/openrocket/logging/SimulationAbort.java b/core/src/net/sf/openrocket/logging/SimulationAbort.java index 8d04fccdb..e692c3f4a 100644 --- a/core/src/net/sf/openrocket/logging/SimulationAbort.java +++ b/core/src/net/sf/openrocket/logging/SimulationAbort.java @@ -43,7 +43,10 @@ public class SimulationAbort extends Message { ACTIVELENGTHZERO(trans.get("SimulationAbort.activeLengthZero")), // The currently active components have a total mass of 0 - ACTIVEMASSZERO(trans.get("SimulationAbort.activeMassZero")); + ACTIVEMASSZERO(trans.get("SimulationAbort.activeMassZero")), + + // Stage is tumbling under thrust + TUMBLE_UNDER_THRUST(trans.get("SimulationAbort.tumbleUnderThrust")); private final String name; diff --git a/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java b/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java index 2bfd95c96..f9fd6d073 100644 --- a/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java +++ b/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java @@ -615,7 +615,7 @@ public class BasicEventSimulationEngine implements SimulationEngine { final boolean tooMuchThrust = currentStatus.getFlightData().getLast(FlightDataType.TYPE_THRUST_FORCE) > THRUST_TUMBLE_CONDITION; if (tooMuchThrust) { - currentStatus.getWarnings().add(Warning.TUMBLE_UNDER_THRUST); + currentStatus.abortSimulation(SimulationAbort.Cause.TUMBLE_UNDER_THRUST); } currentStatus.setTumbling(true);