diff --git a/core/src/main/java/info/openrocket/core/simulation/FlightEvent.java b/core/src/main/java/info/openrocket/core/simulation/FlightEvent.java index 3e7f80b49..5802738b3 100644 --- a/core/src/main/java/info/openrocket/core/simulation/FlightEvent.java +++ b/core/src/main/java/info/openrocket/core/simulation/FlightEvent.java @@ -2,6 +2,7 @@ package info.openrocket.core.simulation; import info.openrocket.core.l10n.Translator; import info.openrocket.core.logging.SimulationAbort; +import info.openrocket.core.logging.Warning; import info.openrocket.core.rocketcomponent.AxialStage; import info.openrocket.core.rocketcomponent.MotorMount; import info.openrocket.core.rocketcomponent.RocketComponent; @@ -81,6 +82,11 @@ public class FlightEvent implements Comparable { */ TUMBLE(trans.get("FlightEvent.Type.TUMBLE")), + /** + * A warning was raised during the execution of the simulation + */ + SIM_WARN(trans.get("FlightEvent.Type.SIM_WARN")), + /** * It is impossible for the simulation proceed due to characteristics * of the rocket or flight configuration @@ -241,6 +247,11 @@ public class FlightEvent implements Comparable { } } break; + case SIM_WARN: + if (( null == this.data ) || ( ! ( this.data instanceof Warning ))) { + throw new IllegalStateException(type.name()+" events require Warning objects"); + } + break; case SIM_ABORT: if (( null == this.data ) || ( ! ( this.data instanceof SimulationAbort ))) { throw new IllegalStateException(type.name()+" events require SimulationAbort objects"); diff --git a/core/src/main/resources/l10n/messages.properties b/core/src/main/resources/l10n/messages.properties index 679525eac..d37baf6aa 100644 --- a/core/src/main/resources/l10n/messages.properties +++ b/core/src/main/resources/l10n/messages.properties @@ -2026,6 +2026,7 @@ FlightEvent.Type.STAGE_SEPARATION = Stage separation FlightEvent.Type.APOGEE = Apogee FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = Recovery device deployment FlightEvent.Type.GROUND_HIT = Ground hit +FlightEvent.Type.SIM_WARN = Warning FlightEvent.Type.SIM_ABORT = Simulation abort FlightEvent.Type.SIMULATION_END = Simulation end FlightEvent.Type.ALTITUDE = Altitude change diff --git a/core/src/main/resources/l10n/messages_ar.properties b/core/src/main/resources/l10n/messages_ar.properties index b2b80f334..c1909fc2f 100644 --- a/core/src/main/resources/l10n/messages_ar.properties +++ b/core/src/main/resources/l10n/messages_ar.properties @@ -1705,6 +1705,7 @@ FlightEvent.Type.STAGE_SEPARATION = فصل المرحلة FlightEvent.Type.APOGEE = الأوج FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = نشر جهاز الإسترداد FlightEvent.Type.GROUND_HIT = الإصطدام بالأرض +FlightEvent.Type.SIM_WARN = تحذير FlightEvent.Type.SIMULATION_END = نهاية المحاكاة FlightEvent.Type.ALTITUDE = تغيير الإرتفاع FlightEvent.Type.TUMBLE = هبوط diff --git a/core/src/main/resources/l10n/messages_de.properties b/core/src/main/resources/l10n/messages_de.properties index 102db8ece..884de7704 100644 --- a/core/src/main/resources/l10n/messages_de.properties +++ b/core/src/main/resources/l10n/messages_de.properties @@ -1259,6 +1259,7 @@ FlightEvent.Type.STAGE_SEPARATION = Stufentrennung FlightEvent.Type.APOGEE = Apogum FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = Auslsung des Bergungssystems FlightEvent.Type.GROUND_HIT = Landung +FlightEvent.Type.SIM_WARN = Warnung FlightEvent.Type.SIMULATION_END = Ende der Simulation FlightEvent.Type.ALTITUDE = Hhennderung diff --git a/core/src/main/resources/l10n/messages_es.properties b/core/src/main/resources/l10n/messages_es.properties index cacc19f7e..34ee25533 100644 --- a/core/src/main/resources/l10n/messages_es.properties +++ b/core/src/main/resources/l10n/messages_es.properties @@ -350,6 +350,7 @@ FlightEvent.Type.LAUNCH = Lanzamiento FlightEvent.Type.LAUNCHROD = Abandono de la Gu\u00eda de lanzamiento FlightEvent.Type.LIFTOFF = Despegue FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = Despliegue del sistema de recuperaci\u00f3n +FlightEvent.Type.SIM_WARN = Peligro, cohete inestable FlightEvent.Type.SIMULATION_END = Fin de la simulaci\u00f3n FlightEvent.Type.STAGE_SEPARATION = Separaci\u00f3n de etapa FlightEvent.Type.TUMBLE = Volteo diff --git a/core/src/main/resources/l10n/messages_fr.properties b/core/src/main/resources/l10n/messages_fr.properties index 41c03ef7c..97f61a95b 100644 --- a/core/src/main/resources/l10n/messages_fr.properties +++ b/core/src/main/resources/l10n/messages_fr.properties @@ -341,6 +341,7 @@ FlightEvent.Type.LAUNCH = Lancement FlightEvent.Type.LAUNCHROD = D\u00E9gagement de rampe de lancement FlightEvent.Type.LIFTOFF = D\u00E9collage FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = D\u00E9ploiement du dispositif de r\u00E9cup\u00E9ration +FlightEvent.Type.SIM_WARN = Avertissement FlightEvent.Type.SIMULATION_END = Fin de la simulation FlightEvent.Type.STAGE_SEPARATION = S\u00E9paration d'\u00E9tage FlightEvent.Type.TUMBLE = D\u00E9gringolade diff --git a/core/src/main/resources/l10n/messages_it.properties b/core/src/main/resources/l10n/messages_it.properties index 67271b83b..a5de1023a 100644 --- a/core/src/main/resources/l10n/messages_it.properties +++ b/core/src/main/resources/l10n/messages_it.properties @@ -1263,6 +1263,7 @@ FlightEvent.Type.STAGE_SEPARATION = Separazione degli stadi FlightEvent.Type.APOGEE = Apogeo FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = distacco del dispositivo di recupero FlightEvent.Type.GROUND_HIT = Atterraggio +FlightEvent.Type,SIM_WARN = Avvisi FlightEvent.Type.SIMULATION_END = Fine simulazione FlightEvent.Type.ALTITUDE = Cambio altitudine diff --git a/core/src/main/resources/l10n/messages_ja.properties b/core/src/main/resources/l10n/messages_ja.properties index 6bd18b21b..6d900fe52 100644 --- a/core/src/main/resources/l10n/messages_ja.properties +++ b/core/src/main/resources/l10n/messages_ja.properties @@ -1310,6 +1310,7 @@ FlightEvent.Type.STAGE_SEPARATION = \u30B9\u30C6\u30FC\u30B8\u5206\u96E2 FlightEvent.Type.APOGEE = \u6700\u9AD8\u5230\u9054\u70B9 FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = \u30EA\u30AB\u30D0\u30EA\u30FC\u88C5\u7F6E\u5C55\u958B FlightEvent.Type.GROUND_HIT = \u7740\u5730 +FlightEvent.Type.SIM_WARN = \u30A8\u30E9\u30FC FlightEvent.Type.SIMULATION_END = \u30B7\u30DF\u30E5\u30EC\u30FC\u30B7\u30E7\u30F3\u7D42\u4E86 FlightEvent.Type.ALTITUDE = \u59FF\u52E2\u5909\u66F4 diff --git a/core/src/main/resources/l10n/messages_nl.properties b/core/src/main/resources/l10n/messages_nl.properties index cc8da870e..668718cf9 100644 --- a/core/src/main/resources/l10n/messages_nl.properties +++ b/core/src/main/resources/l10n/messages_nl.properties @@ -1628,6 +1628,7 @@ FlightEvent.Type.STAGE_SEPARATION = Trap afscheiding FlightEvent.Type.APOGEE = Apogee FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = Terugvordering toestel uitrol FlightEvent.Type.GROUND_HIT = Grond geraakt +FlightEvent.Type.SIM_WARN = Waarschuwing FlightEvent.Type.SIMULATION_END = Simulatie-einde FlightEvent.Type.ALTITUDE = Hoogteverandering FlightEvent.Type.TUMBLE = Tuimelen diff --git a/core/src/main/resources/l10n/messages_pl.properties b/core/src/main/resources/l10n/messages_pl.properties index e8419cd44..62c137beb 100644 --- a/core/src/main/resources/l10n/messages_pl.properties +++ b/core/src/main/resources/l10n/messages_pl.properties @@ -1204,6 +1204,7 @@ ComponentInfo.EngineBlock = Blokada silnika unieruchamia silnik wewn\u01 FlightEvent.Type.APOGEE = Apogeum FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = Aktywacja uk\u0142adu odzysku FlightEvent.Type.GROUND_HIT = Uderzenie w ziemi\u0119 + FlightEvent.Type.SIM_WARN = Ostrze\u017Cenie FlightEvent.Type.SIMULATION_END = Koniec symulacji FlightEvent.Type.ALTITUDE = Zmiana wysoko\u015Bci diff --git a/core/src/main/resources/l10n/messages_pt.properties b/core/src/main/resources/l10n/messages_pt.properties index 1ae20d6f2..d16a1e07f 100644 --- a/core/src/main/resources/l10n/messages_pt.properties +++ b/core/src/main/resources/l10n/messages_pt.properties @@ -330,6 +330,7 @@ FlightEvent.Type.LAUNCH = Lan\u00e7amento FlightEvent.Type.LAUNCHROD = Folga da haste de lan\u00e7amento FlightEvent.Type.LIFTOFF = Decolagem FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = Implanta\u00e7\u00e3o de dispositivos de recupera\u00e7\u00e3o +FlightEvent.Type.SIM_WARN = Alerta FlightEvent.Type.SIMULATION_END = Final de simula\u00e7\u00e3o FlightEvent.Type.STAGE_SEPARATION = Separa\u00e7\u00e3o do est\u00e1gio FlightEvent.Type.TUMBLE = Tumbling diff --git a/core/src/main/resources/l10n/messages_ru.properties b/core/src/main/resources/l10n/messages_ru.properties index 30e644adf..51b54e2cd 100644 --- a/core/src/main/resources/l10n/messages_ru.properties +++ b/core/src/main/resources/l10n/messages_ru.properties @@ -1677,6 +1677,7 @@ FlightEvent.Type.STAGE_SEPARATION = \u0420\u0430\u0437\u0434\u0435\u043B\u0435\u FlightEvent.Type.APOGEE = \u0410\u043F\u043E\u0433\u0435\u0439 FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = \u0421\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u043D\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043C\u044B \u0441\u043F\u0430\u0441\u0435\u043D\u0438\u044F FlightEvent.Type.GROUND_HIT = \u041F\u0440\u0438\u0437\u0435\u043C\u043B\u0435\u043D\u0438\u0435 +FlightEvent.Type.SIM_WARN = \u041F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435 FlightEvent.Type.SIMULATION_END = \u041A\u043E\u043D\u0435\u0446 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 FlightEvent.Type.ALTITUDE = \u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435 \u0432\u044B\u0441\u043E\u0442\u044B FlightEvent.Type.TUMBLE = \u041E\u043F\u0440\u043E\u043A\u0438\u0434\u044B\u0432\u0430\u043D\u0438\u0435 diff --git a/core/src/main/resources/l10n/messages_uk_UA.properties b/core/src/main/resources/l10n/messages_uk_UA.properties index a7c2c7d09..9a48396a7 100644 --- a/core/src/main/resources/l10n/messages_uk_UA.properties +++ b/core/src/main/resources/l10n/messages_uk_UA.properties @@ -1401,6 +1401,7 @@ FlightEvent.Type.STAGE_SEPARATION = Stage separation FlightEvent.Type.APOGEE = Apogee FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = Recovery device deployment FlightEvent.Type.GROUND_HIT = Ground hit +FlightEvent.Type.SIM_WARN = Warning FlightEvent.Type.SIMULATION_END = Simulation end FlightEvent.Type.ALTITUDE = Altitude change FlightEvent.Type.TUMBLE = Tumbling diff --git a/core/src/main/resources/l10n/messages_zh_CN.properties b/core/src/main/resources/l10n/messages_zh_CN.properties index 81cf30543..3037edecd 100644 --- a/core/src/main/resources/l10n/messages_zh_CN.properties +++ b/core/src/main/resources/l10n/messages_zh_CN.properties @@ -367,6 +367,7 @@ FlightEvent.Type.LAUNCH = \u53D1\u5C04 FlightEvent.Type.LAUNCHROD = \u79BB\u67B6 FlightEvent.Type.LIFTOFF = \u8D77\u98DE FlightEvent.Type.RECOVERY_DEVICE_DEPLOYMENT = \u56DE\u6536\u88C5\u7F6E\u542F\u52A8 +FlightEvent.Type.SIM_WARN = \u8B66\u544A FlightEvent.Type.SIMULATION_END = \u4EFF\u771F\u7ED3\u675F FlightEvent.Type.STAGE_SEPARATION = \u7EA7\u95F4\u5206\u79BB FlightEvent.Type.TUMBLE = \u7FFB\u6EDA