Merge pull request #2078 from JoePfeiffer/fix-2024

Eliminate option to save "some" simulation data
This commit is contained in:
Joe Pfeiffer 2023-02-26 10:03:46 -07:00 committed by GitHub
commit 02c47408e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 78 additions and 210 deletions

View File

@ -1340,11 +1340,7 @@ StorageOptChooser.lbl.Simdatatostore = Simulated data to store:
StorageOptChooser.rdbut.Allsimdata = All simulated data
StorageOptChooser.lbl.longA1 = <html>Store all simulated data.<br>
StorageOptChooser.lbl.longA2 = This can result in very large files!
StorageOptChooser.rdbut.Every = Every
StorageOptChooser.lbl.longB1 = <html>Store plottable values approximately this far apart.<br>
StorageOptChooser.lbl.longB2 = Larger values result in smaller files.
StorageOptChooser.lbl.seconds = seconds
StorageOptChooser.rdbut.Onlyprimfig = Only primary figures
StorageOptChooser.rdbut.Onlysummarydata = Only summary data
StorageOptChooser.lbl.longC1 = <html>Store only the values shown in the summary table.<br>
StorageOptChooser.lbl.longC2 = This results in the smallest files.
StorageOptChooser.lbl.longD1 = An estimate on how large the resulting file would be with the present options.
@ -1886,6 +1882,7 @@ Warning.PODSET_FORWARD = In-line podset forward of parent airframe component
Warning.PODSET_OVERLAP = In-line podset overlaps parent airframe component
Warning.THICK_FIN = Thick fins may not simulate accurately.
Warning.JAGGED_EDGED_FIN = Jagged-edged fin predictions may be inaccurate.
Warning.ZERO_AREA_FIN = Fins with zero area will not affect aerodynamics
Warning.LISTENERS_AFFECTED = Listeners modified the flight simulation
Warning.RECOVERY_DEPLOYMENT_WHILE_BURNING = Recovery device opened while motor still burning.
Warning.FILE_INVALID_PARAMETER = Invalid parameter encountered, ignoring.

View File

@ -1303,11 +1303,7 @@ StorageOptChooser.lbl.Simdatatostore = :بيانات مُحاكاة للتخزي
StorageOptChooser.rdbut.Allsimdata = جميع البيانات المحاكاة
StorageOptChooser.lbl.longA1 = <html>.تخزين جميع البيانات المحاكاة<br>
StorageOptChooser.lbl.longA2 = !يمكن أن ينتج عن ذلك ملفات كبيرة جدًا
StorageOptChooser.rdbut.Every = كل
StorageOptChooser.lbl.longB1 = <html>.قم بتخزين القيم القابلة للرسم على مخطط بياني على مسافة متباعدة تقريبًا<br>
StorageOptChooser.lbl.longB2 = .القيم الأكبر ينتج عنها ملفات أصغر
StorageOptChooser.lbl.seconds = ثواني
StorageOptChooser.rdbut.Onlyprimfig = المحاكاة الأولية فقط
StorageOptChooser.rdbut.Onlysummarydata = المحاكاة الأولية فقط
StorageOptChooser.lbl.longC1 = <html>.قم بتخزين القيم المعروضة في جدول الملخص فقط<br>
StorageOptChooser.lbl.longC2 = .ينتج عن هذا أصغر الملفات
StorageOptChooser.lbl.longD1 = .تقدير لمدى حجم الملف الناتج مع الخيارات الحالية

View File

@ -921,10 +921,6 @@ StorageOptChooser.lbl.Simdatatostore = Simulacn
StorageOptChooser.rdbut.Allsimdata = V\u0161echny data ze simulace
StorageOptChooser.lbl.longA1 = <html>Ulo\u017Eí v\u0161echny simulacní data.<br>
StorageOptChooser.lbl.longA2 = Výsledek mu\u017Ee vyústit ve velmi velké soubory!
StorageOptChooser.rdbut.Every = Ka\u017Edý
StorageOptChooser.lbl.longB1 = <html>Store plottable values approximately this far apart.<br>
StorageOptChooser.lbl.longB2 = Vet\u0161í hodnoty vyústí v men\u0161í soubory.
StorageOptChooser.lbl.seconds = sekundy
StorageOptChooser.rdbut.Onlyprimfig = Pouze hlavní grafy
StorageOptChooser.lbl.longC1 = <html>Ulo\u017E pouze hodnoty ukázané v prehledu.<br>
StorageOptChooser.lbl.longC2 = This results in the smallest files.

View File

@ -979,11 +979,7 @@ StorageOptChooser.lbl.Simdatatostore = Zu speichernde Simulationsdaten:
StorageOptChooser.rdbut.Allsimdata = Alle Simulationsdaten
StorageOptChooser.lbl.longA1 = <html>Speichert alle Simulationsdaten.<br>
StorageOptChooser.lbl.longA2 = Dies kann sehr große Dateien erzeugen!
StorageOptChooser.rdbut.Every = Alle Simulationsdaten
StorageOptChooser.lbl.longB1 = <html>Speicher plotbare Daten in etwa diesem Abstand.<br>
StorageOptChooser.lbl.longB2 = Größere Werte erzeugen kleinere Dateien.
StorageOptChooser.lbl.seconds = Sekunden
StorageOptChooser.rdbut.Onlyprimfig = Nur die wichtigsten Werte
StorageOptChooser.rdbut.Onlysummarydata = Nur die wichtigsten Werte
StorageOptChooser.lbl.longC1 = <html>Speichert nur die Werte, die in der Zusammenfassung stehen.<br>
StorageOptChooser.lbl.longC2 = Dies ergibt die kleinsten Dateien
StorageOptChooser.checkbox.Compfile = Datei komprimieren

View File

@ -1071,15 +1071,11 @@ StorageOptChooser.lbl.Simdatatostore = Datos de las simulaciones a guardar:
StorageOptChooser.lbl.UsingComp = Usando la compresi\u00f3n reducimos el tama\u00f1o de los archivos.
StorageOptChooser.lbl.longA1 = <html>Almacenar todos los datos simulados.<br>
StorageOptChooser.lbl.longA2 = Esto puede generar archivos muy grandes
StorageOptChooser.lbl.longB1 = <html>Almacenar los valores de impresi\u00f3n de este apartado.<br>
StorageOptChooser.lbl.longB2 = Genera valores grandes en archivos m\u00e1s peque\u00f1os.
StorageOptChooser.lbl.longC1 = <html>Almacenar s\u00f3lo los valores en la tabla resumen.<br>
StorageOptChooser.lbl.longC2 = Estos resultados se guardan en archivos mas peque\u00f1os.
StorageOptChooser.lbl.longD1 = Con las opciones actuales puede realizarse una estamci\u00f3n del tama\u00f1o final del archivo.
StorageOptChooser.lbl.seconds = Segundos
StorageOptChooser.rdbut.Allsimdata = Todos los datos simulados
StorageOptChooser.rdbut.Every = Todo
StorageOptChooser.rdbut.Onlyprimfig = S\u00f3lo figuras principales
StorageOptChooser.rdbut.Onlysummarydata = S\u00f3lo figuras principales
StorageOptChooser.ttip.Saveopt = Guardar opciones
Streamer.Streamer = Banderola

View File

@ -1064,15 +1064,11 @@ StorageOptChooser.lbl.Simdatatostore = Donn\u00E9es simul\u00E9es \u00E0 stocker
StorageOptChooser.lbl.UsingComp = Utiliser la compression r\u00E9duit significativement la taille du fichier.
StorageOptChooser.lbl.longA1 = <html>Enregistrer toutes les donn\u00E9es des simulations.<br>
StorageOptChooser.lbl.longA2 = Cela peut entra\u00EEner de tr\u00E8s gros fichiers!
StorageOptChooser.lbl.longB1 = <html>Store plottable values approximately this far apart.<br>
StorageOptChooser.lbl.longB2 = Des valeurs plus grandes produisent des fichiers plus petits.
StorageOptChooser.lbl.longC1 = <html>Stocker seulement les valeurs montr\u00E9es dans le tableau r\u00E9capitulatif.<br>
StorageOptChooser.lbl.longC2 = Cela produira des fichiers plus petit.
StorageOptChooser.lbl.longD1 = Une estimation sur la taille qu'aurait le fichier r\u00E9sultant avec les options actuelles.
StorageOptChooser.lbl.seconds = secondes
StorageOptChooser.rdbut.Allsimdata = Toutes les donn\u00E9es des simulations
StorageOptChooser.rdbut.Every = Every
StorageOptChooser.rdbut.Onlyprimfig = Seuls les chiffres primaires
StorageOptChooser.rdbut.Onlysummarydata = Seuls les chiffres primaires
StorageOptChooser.ttip.Saveopt = Options de sauvegarde
! Streamer

View File

@ -980,11 +980,7 @@ StorageOptChooser.lbl.Simdatatostore = Dati della simulazione da salvare:
StorageOptChooser.rdbut.Allsimdata = Tutti i dati della simulazione
StorageOptChooser.lbl.longA1 = <html>Salva tutti i dati della simulazione.<br>
StorageOptChooser.lbl.longA2 = Questo puo' produrre files molto grandi!
StorageOptChooser.rdbut.Every = Ogni
StorageOptChooser.lbl.longB1 = <html>Salva Store plottable values approximately this far apart.<br>
StorageOptChooser.lbl.longB2 = Valori grandi significano files piu' piccoli.
StorageOptChooser.lbl.seconds = secondi
StorageOptChooser.rdbut.Onlyprimfig = Solo figure primarie
StorageOptChooser.rdbut.Onlysummarydata = Solo figure primarie
StorageOptChooser.lbl.longC1 = <html>Salva solo i valori mostrati nella tabella riassuntiva.<br>
StorageOptChooser.lbl.longC2 = Questo produce i files piu' piccoli.
StorageOptChooser.checkbox.Compfile = Comprimi file

View File

@ -1010,11 +1010,7 @@ StorageOptChooser.lbl.Simdatatostore = \u30B7\u30DF\u30E5\u30EC\u30FC\u30B7\u30
StorageOptChooser.rdbut.Allsimdata = \u5168\u3066\u306E\u30B7\u30DF\u30E5\u30EC\u30FC\u30B7\u30E7\u30F3\u30C7\u30FC\u30BF
StorageOptChooser.lbl.longA1 = <html>\u5168\u3066\u306E\u30B7\u30DF\u30E5\u30EC\u30FC\u30B7\u30E7\u30F3\u30C7\u30FC\u30BF\u3092\u4FDD\u5B58<br>
StorageOptChooser.lbl.longA2 = \u3068\u3066\u3082\u5927\u304D\u306A\u30D5\u30A1\u30A4\u30EB\u306B\u306A\u308A\u307E\u3059
StorageOptChooser.rdbut.Every =
StorageOptChooser.lbl.longB1 = <html>\u8FD1\u4F3C\u3057\u3066\u4FDD\u5B58<br>
StorageOptChooser.lbl.longB2 = \u5927\u304D\u306A\u5024\u306B\u3059\u308B\u3068\u30D5\u30A1\u30A4\u30EB\u306F\u5C0F\u3055\u304F\u306A\u308B
StorageOptChooser.lbl.seconds = \u79D2\u6BCE
StorageOptChooser.rdbut.Onlyprimfig = \u4E3B\u8981\u306A\u5024\u306E\u307F
StorageOptChooser.rdbut.Onlysummarydata = \u4E3B\u8981\u306A\u5024\u306E\u307F
StorageOptChooser.lbl.longC1 = <html>\u8868\u306B\u66F8\u304B\u308C\u3066\u3044\u308B\u5024\u306E\u307F\u4FDD\u5B58<br>
StorageOptChooser.lbl.longC2 = \u30D5\u30A1\u30A4\u30EB\u306F\u4E00\u756A\u5C0F\u3055\u304F\u306A\u308B
StorageOptChooser.checkbox.Compfile = \u30D5\u30A1\u30A4\u30EB\u306E\u5727\u7E2E

View File

@ -1231,11 +1231,7 @@ StorageOptChooser.lbl.Simdatatostore = Gesimuleerde gegevens om op te slaan:
StorageOptChooser.rdbut.Allsimdata = Alle gesimuleerde gegevens
StorageOptChooser.lbl.longA1 = <html>Sla alle gesimuleerde gegevens op.<br>
StorageOptChooser.lbl.longA2 = Dit kan resulteren in zeer grote bestanden!
StorageOptChooser.rdbut.Every = Elke
StorageOptChooser.lbl.longB1 = <html>Sla plottable waarden ongeveer zo ver uit elkaar op.<br>
StorageOptChooser.lbl.longB2 = Grotere waarden resulteren in kleinere bestanden.
StorageOptChooser.lbl.seconds = seconden
StorageOptChooser.rdbut.Onlyprimfig = Alleen primaire figuren
StorageOptChooser.rdbut.Onlysummarydata = Alleen primaire figuren
StorageOptChooser.lbl.longC1 = <html>Sla alleen de waarden op die in de overzichtstabel staan.<br>
StorageOptChooser.lbl.longC2 = Dit resulteert in de kleinste bestanden.
StorageOptChooser.lbl.longD1 = Een schatting van hoe groot het resulterende bestand zou zijn met de huidige opties.

View File

@ -924,11 +924,7 @@ ComponentInfo.EngineBlock = <b>Blokada silnika</b> unieruchamia silnik wewn\u01
StorageOptChooser.rdbut.Allsimdata = Wszystkie dane symulacji:
StorageOptChooser.lbl.longA1 = <html>Zapisz wszystkie dane z symulacji.<br>
StorageOptChooser.lbl.longA2 = To mo\u017Ce bardzo zwi\u0119kszy\u0107 rozmiar plików!
StorageOptChooser.rdbut.Every = Co
StorageOptChooser.lbl.longB1 = <html>Zapisz warto\u015Bci daj\u0105ce si\u0119 przedstawi\u0107 na wykresie w powy\u017Cszych odst\u0119pach.<br>
StorageOptChooser.lbl.longB2 = Wi\u0119ksze warto\u015Bci przek\u0142adaj\u0105 si\u0119 na mniejsze pliki.
StorageOptChooser.lbl.seconds = sek.
StorageOptChooser.rdbut.Onlyprimfig = Tylko dane podstawowe
StorageOptChooser.rdbut.Onlysummarydata = Tylko dane podstawowe
StorageOptChooser.lbl.longC1 = <html>Zapisz tylko warto\u015Bci ukazane w tabeli podsumowuj\u0105cej symulacj\u0119.<br>
StorageOptChooser.lbl.longC2 = Przy tym ustawieniu pliki s\u0105 najmniejsze.
StorageOptChooser.checkbox.Compfile = Kompresuj plik

View File

@ -1040,15 +1040,11 @@ StorageOptChooser.lbl.Simdatatostore = Dados simulados para armazenar:
StorageOptChooser.lbl.UsingComp = Usando compress\u00e3o reduz o tamanho do arquivo significativamente.
StorageOptChooser.lbl.longA1 = <html>Armazenar todos os dados simulados.<br>
StorageOptChooser.lbl.longA2 = Isto pode resultar em a muito grandes!
StorageOptChooser.lbl.longB1 = <html>Armazene os valores aproximados para plotagem.<br>
StorageOptChooser.lbl.longB2 = Valores maiores resultar em arquivos menores.
StorageOptChooser.lbl.longC1 = <html>Armazenar apenas os valores mostrados na tabela de resumo.<br>
StorageOptChooser.lbl.longC2 = Isto resulta em arquivos menores.
StorageOptChooser.lbl.longD1 = Uma estimativa sobre o tamanho do arquivo resultante seria com as op\u00e7\u00f5es de presentes.
StorageOptChooser.lbl.seconds = segundos
StorageOptChooser.rdbut.Allsimdata = Todos os dados simulados
StorageOptChooser.rdbut.Every = Todo
StorageOptChooser.rdbut.Onlyprimfig = Somente figuras prim\u00e1rias
StorageOptChooser.rdbut.Onlysummarydata = Somente figuras prim\u00e1rias
StorageOptChooser.ttip.Saveopt = Salvar as Op\u00e7\u00f5es
# Streamer

View File

@ -1279,11 +1279,7 @@ StorageOptChooser.lbl.Simdatatostore = \u0421\u043E\u0445\u0440\u0430\u043D\u043
StorageOptChooser.rdbut.Allsimdata = \u0412\u0441\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u0430
StorageOptChooser.lbl.longA1 = <html>\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0432\u0441\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u043E\u0432.<br>
StorageOptChooser.lbl.longA2 = \u0420\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430 \u043C\u043E\u0436\u0435\u0442 \u043E\u043A\u0430\u0437\u0430\u0442\u044C\u0441\u044F \u043E\u0447\u0435\u043D\u044C \u0431\u043E\u043B\u044C\u0448\u0438\u043C!
StorageOptChooser.rdbut.Every = \u041A\u0430\u0436\u0434\u044B\u0435
StorageOptChooser.lbl.longB1 = <html>\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043D\u043D\u044B\u0439 \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u0438\u0431\u043B\u0438\u0437\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0441 \u0442\u0430\u043A\u043E\u0439 \u0447\u0430\u0441\u0442\u043E\u0442\u043E\u0439.<br>
StorageOptChooser.lbl.longB2 = \u0411\u043E\u043B\u044C\u0448\u0438\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0434\u0430\u044E\u0442 \u043C\u0435\u043D\u044C\u0448\u0438\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430.
StorageOptChooser.lbl.seconds = \u0441\u0435\u043A\u0443\u043D\u0434
StorageOptChooser.rdbut.Onlyprimfig = \u0422\u043E\u043B\u044C\u043A\u043E \u0441\u0445\u0435\u043C\u0443
StorageOptChooser.rdbut.Onlysummarydata = \u0422\u043E\u043B\u044C\u043A\u043E \u0441\u0445\u0435\u043C\u0443
StorageOptChooser.lbl.longC1 = <html>\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F, \u043F\u043E\u043A\u0430\u0437\u0430\u043D\u043D\u044B\u0435 \u0441\u0432\u043E\u0434\u043D\u043E\u0439 \u0442\u0430\u0431\u043B\u0438\u0446\u0435<br>
StorageOptChooser.lbl.longC2 = \u042D\u0442\u043E \u0434\u0430\u0435\u0442 \u043D\u0430\u0438\u043C\u0435\u043D\u044C\u0448\u0438\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430.
StorageOptChooser.lbl.longD1 = \u041F\u0440\u0438\u0431\u043B\u0438\u0437\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u043E\u0446\u0435\u043D\u043A\u0430 \u0440\u0430\u0437\u043C\u0435\u0440\u0430 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0438\u0440\u0443\u044E\u0449\u0435\u0433\u043E \u0444\u0430\u0439\u043B\u0430 \u0441 \u0434\u0430\u043D\u043D\u044B\u043C\u0438 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u043C\u0438.

View File

@ -1080,11 +1080,7 @@ StorageOptChooser.lbl.Simdatatostore = Simulated data to store:
StorageOptChooser.rdbut.Allsimdata = All simulated data
StorageOptChooser.lbl.longA1 = <html>Store all simulated data.<br>
StorageOptChooser.lbl.longA2 = This can result in very large files!
StorageOptChooser.rdbut.Every = Every
StorageOptChooser.lbl.longB1 = <html>Store plottable values approximately this far apart.<br>
StorageOptChooser.lbl.longB2 = Larger values result in smaller files.
StorageOptChooser.lbl.seconds = seconds
StorageOptChooser.rdbut.Onlyprimfig = Only primary figures
StorageOptChooser.rdbut.Onlysummarydata = Only summary data
StorageOptChooser.lbl.longC1 = <html>Store only the values shown in the summary table.<br>
StorageOptChooser.lbl.longC2 = This results in the smallest files.
StorageOptChooser.lbl.longD1 = An estimate on how large the resulting file would be with the present options.

View File

@ -1136,15 +1136,11 @@ StorageOptChooser.lbl.Saveopt = \u4FDD\u5B58\u9009\u9879
StorageOptChooser.lbl.Simdatatostore = \u4FDD\u5B58\u4EFF\u771F\u6570\u636E:
StorageOptChooser.lbl.longA1 = <html>\u4FDD\u5B58\u6240\u6709\u4EFF\u771F\u6570\u636E.<br>
StorageOptChooser.lbl.longA2 = \u6587\u4EF6\u4F53\u79EF\u4F1A\u5F88\u5927!
StorageOptChooser.lbl.longB1 = <html>\u6BCF\u9694\u6570\u4E2A\u6570\u636E\u4FDD\u5B58\u4E00\u6B21.<br>
StorageOptChooser.lbl.longB2 = \u95F4\u9694\u8D8A\u5927\u6587\u4EF6\u4F53\u79EF\u8D8A\u5C0F.
StorageOptChooser.lbl.longC1 = <html>\u4EC5\u4FDD\u7559\u7B80\u62A5\u8868\u683C\u4E2D\u663E\u793A\u7684\u6570\u636E.<br>
StorageOptChooser.lbl.longC2 = \u6587\u4EF6\u4F53\u79EF\u6700\u5C0F.
StorageOptChooser.lbl.longD1 = \u6839\u636E\u5F53\u524D\u8BBE\u7F6E\u6765\u4F30\u8BA1\u751F\u6210\u6587\u4EF6\u5927\u5927\u5C0F.
StorageOptChooser.lbl.seconds = \u79D2
StorageOptChooser.rdbut.Allsimdata = \u6240\u6709\u4EFF\u771F\u6570\u636E
StorageOptChooser.rdbut.Every = \u6BCF\u4E00\u4E2A
StorageOptChooser.rdbut.Onlyprimfig = \u4EC5\u4FDD\u7559\u4E3B\u8981\u6570\u636E
StorageOptChooser.rdbut.Onlysummarydata = \u4EC5\u4FDD\u7559\u4E3B\u8981\u6570\u636E
StorageOptChooser.ttip.Saveopt = \u4FDD\u5B58\u9009\u9879
! Streamer

View File

@ -382,6 +382,10 @@ public abstract class Warning {
////Jagged-edged fin predictions may be inaccurate.
public static final Warning JAGGED_EDGED_FIN = new Other(trans.get("Warning.JAGGED_EDGED_FIN"));
/** A <code>Warning</code> that the fins have a zero area. */
////Fins with no area will not affect aerodynamics
public static final Warning ZERO_AREA_FIN = new Other(trans.get("Warning.ZERO_AREA_FIN"));
/** A <code>Warning</code> that simulation listeners have affected the simulation */
////Listeners modified the flight simulation
public static final Warning LISTENERS_AFFECTED = new Other(trans.get("Warning.LISTENERS_AFFECTED"));

View File

@ -84,7 +84,9 @@ public class FinSetCalc extends RocketComponentCalc {
public void calculateNonaxialForces(FlightConditions conditions, Transformation transform,
AerodynamicForces forces, WarningSet warnings) {
if (span < 0.001) {
warnings.addAll(geometryWarnings);
if (finArea < MathUtil.EPSILON) {
forces.setCm(0);
forces.setCN(0);
forces.setCNa(0);
@ -96,12 +98,6 @@ public class FinSetCalc extends RocketComponentCalc {
forces.setCyaw(0);
return;
}
if ((bodyRadius > 0) && (thickness > bodyRadius / 2)){
// Add warnings (radius/2 == diameter/4)
warnings.add(Warning.THICK_FIN);
}
warnings.addAll(geometryWarnings);
//////// Calculate CNa. /////////
@ -241,18 +237,27 @@ public class FinSetCalc extends RocketComponentCalc {
Coordinate[] points = component.getFinPoints();
// Check for jagged edges
// Check geometry
geometryWarnings.clear();
boolean down = false;
for (int i = 1; i < points.length; i++) {
if ((points[i].y > points[i - 1].y + 0.001) && down) {
geometryWarnings.add(Warning.JAGGED_EDGED_FIN);
geometryWarnings.add(Warning.JAGGED_EDGED_FIN, component.toString());
break;
}
if (points[i].y < points[i - 1].y - 0.001) {
down = true;
}
}
if (finArea < MathUtil.EPSILON) {
geometryWarnings.add(Warning.ZERO_AREA_FIN, component.toString());
}
if ((bodyRadius > 0) && (thickness > bodyRadius / 2)){
// Add warnings (radius/2 == diameter/4)
geometryWarnings.add(Warning.THICK_FIN, component.toString());
}
// Calculate the chord lead and trail positions and length
@ -365,7 +370,6 @@ public class FinSetCalc extends RocketComponentCalc {
macLead *= dy;
area *= dy;
rollSum *= dy;
macLength /= area;
macSpan /= area;
macLead /= area;
@ -614,6 +618,11 @@ public class FinSetCalc extends RocketComponentCalc {
@Override
public double calculateFrictionCD(FlightConditions conditions, double componentCf, WarningSet warnings) {
// a fin with 0 area contributes no drag
if (finArea < MathUtil.EPSILON) {
return 0.0;
}
double cd = componentCf * (1 + 2 * thickness / macLength) * 2 * finArea / conditions.getRefArea();
return cd;
}
@ -622,6 +631,11 @@ public class FinSetCalc extends RocketComponentCalc {
public double calculatePressureCD(FlightConditions conditions,
double stagnationCD, double baseCD, WarningSet warnings) {
// a fin with 0 area contributes no drag
if (finArea < MathUtil.EPSILON) {
return 0.0;
}
double mach = conditions.getMach();
double cd = 0;

View File

@ -9,12 +9,9 @@ public class StorageOptions implements Cloneable {
ROCKSIM
}
public static final double SIMULATION_DATA_NONE = Double.POSITIVE_INFINITY;
public static final double SIMULATION_DATA_ALL = 0;
private FileType fileType = FileType.OPENROCKET;
private double simulationTimeSkip = SIMULATION_DATA_NONE;
private boolean saveSimulationData = false;
private boolean explicitlySet = false;
@ -26,12 +23,12 @@ public class StorageOptions implements Cloneable {
this.fileType = fileType;
}
public double getSimulationTimeSkip() {
return simulationTimeSkip;
public boolean getSaveSimulationData() {
return saveSimulationData;
}
public void setSimulationTimeSkip(double simulationTimeSkip) {
this.simulationTimeSkip = simulationTimeSkip;
public void setSaveSimulationData(boolean s) {
saveSimulationData = s;
}
public boolean isExplicitlySet() {

View File

@ -97,7 +97,7 @@ public class OpenRocketSaver extends RocketSaver {
if (!first)
writeln("");
first = false;
saveSimulation(s, options.getSimulationTimeSkip());
saveSimulation(s, options.getSaveSimulationData());
}
indent--;
writeln("</simulations>");
@ -173,13 +173,12 @@ public class OpenRocketSaver extends RocketSaver {
// Size per flight data point
int pointCount = 0;
double timeSkip = options.getSimulationTimeSkip();
if (timeSkip != StorageOptions.SIMULATION_DATA_NONE) {
if (options.getSaveSimulationData()) {
for (Simulation s : doc.getSimulations()) {
FlightData data = s.getSimulatedData();
if (data != null) {
for (int i = 0; i < data.getBranchCount(); i++) {
pointCount += countFlightDataBranchPoints(data.getBranch(i), timeSkip);
pointCount += countFlightDataBranchPoints(data.getBranch(i));
}
}
}
@ -317,11 +316,11 @@ public class OpenRocketSaver extends RocketSaver {
}
private void saveSimulation(Simulation simulation, double timeSkip) throws IOException {
private void saveSimulation(Simulation simulation, boolean saveSimulationData) throws IOException {
SimulationOptions cond = simulation.getOptions();
Simulation.Status simStatus;
simStatus = timeSkip != StorageOptions.SIMULATION_DATA_NONE ? simulation.getStatus() : Simulation.Status.NOT_SIMULATED;
simStatus = saveSimulationData ? simulation.getStatus() : Simulation.Status.NOT_SIMULATED;
writeln("<simulation status=\"" + enumToXMLName(simStatus) + "\">");
indent++;
@ -408,13 +407,11 @@ public class OpenRocketSaver extends RocketSaver {
}
// Check whether to store data
if (simulation.getStatus() == Simulation.Status.EXTERNAL) // Always store external data
timeSkip = 0;
if (timeSkip != StorageOptions.SIMULATION_DATA_NONE) {
if ((simulation.getStatus() == Simulation.Status.EXTERNAL) || // Always store external data
saveSimulationData) {
for (int i = 0; i < data.getBranchCount(); i++) {
FlightDataBranch branch = data.getBranch(i);
saveFlightDataBranch(branch, timeSkip);
saveFlightDataBranch(branch);
}
}
@ -474,9 +471,8 @@ public class OpenRocketSaver extends RocketSaver {
}
}
private void saveFlightDataBranch(FlightDataBranch branch, double timeSkip)
private void saveFlightDataBranch(FlightDataBranch branch)
throws IOException {
double previousTime = -100000;
if (branch == null)
return;
@ -540,25 +536,8 @@ public class OpenRocketSaver extends RocketSaver {
// Write the data
int length = branch.getLength();
if (length > 0) {
writeDataPointString(data, 0, sb);
previousTime = timeData.get(0);
}
for (int i = 1; i < length - 1; i++) {
if (timeData != null) {
if (Math.abs(timeData.get(i) - previousTime - timeSkip) < Math.abs(timeData.get(i + 1) - previousTime - timeSkip)) {
writeDataPointString(data, i, sb);
previousTime = timeData.get(i);
}
} else {
// If time data is not available, write all points
writeDataPointString(data, i, sb);
}
}
if (length > 1) {
writeDataPointString(data, length - 1, sb);
for (int i = 0; i < length; i++) {
writeDataPointString(data, i, sb);
}
indent--;
@ -566,11 +545,9 @@ public class OpenRocketSaver extends RocketSaver {
}
/* TODO: LOW: This is largely duplicated from above! */
private int countFlightDataBranchPoints(FlightDataBranch branch, double timeSkip) {
private int countFlightDataBranchPoints(FlightDataBranch branch) {
int count = 0;
double previousTime = -100000;
if (branch == null)
return 0;
@ -586,23 +563,8 @@ public class OpenRocketSaver extends RocketSaver {
return branch.getLength();
}
// Write the data
int length = branch.getLength();
if (length > 0) {
count++;
previousTime = timeData.get(0);
}
for (int i = 1; i < length - 1; i++) {
if (Math.abs(timeData.get(i) - previousTime - timeSkip) < Math.abs(timeData.get(i + 1) - previousTime - timeSkip)) {
count++;
previousTime = timeData.get(i);
}
}
if (length > 1) {
count++;
}
// Count the data
count += branch.getLength();
return count;
}

View File

@ -60,8 +60,8 @@ public class OpenRocketLoader extends AbstractRocketLoader {
config.applyPreloadedStageActiveness();
}
// Deduce suitable time skip
double timeSkip = StorageOptions.SIMULATION_DATA_NONE;
// If we saved data for a simulation before, we'll use that as our default option this time
boolean saveData = false;
for (Simulation s : doc.getSimulations()) {
s.syncModID(); // The config's modID can be out of sync with the simulation's after the whole loading process
if (s.getStatus() == Simulation.Status.EXTERNAL ||
@ -77,16 +77,12 @@ public class OpenRocketLoader extends AbstractRocketLoader {
List<Double> list = branch.get(FlightDataType.TYPE_TIME);
if (list == null)
continue;
double previousTime = Double.NaN;
for (double time : list) {
if (time - previousTime < timeSkip)
timeSkip = time - previousTime;
previousTime = time;
}
doc.getDefaultStorageOptions().setSaveSimulationData(true);
break;
}
timeSkip = Math.rint(timeSkip * 100) / 100;
doc.getDefaultStorageOptions().setSimulationTimeSkip(timeSkip);
doc.getDefaultStorageOptions().setExplicitlySet(false);
doc.getDefaultStorageOptions().setFileType(FileType.OPENROCKET);

View File

@ -137,7 +137,7 @@ public class OpenRocketSaverTest {
rocketDocs.add(TestRockets.makeTestRocket_for_estimateFileSize());
StorageOptions options = new StorageOptions();
options.setSimulationTimeSkip(0.05);
options.setSaveSimulationData(true);
// Save rockets, load, validate
for (OpenRocketDocument rocketDoc : rocketDocs) {
@ -151,7 +151,7 @@ public class OpenRocketSaverTest {
public void testSaveStageActiveness() {
OpenRocketDocument rocketDoc = TestRockets.makeTestRocket_v108_withDisabledStage();
StorageOptions options = new StorageOptions();
options.setSimulationTimeSkip(0.05);
options.setSaveSimulationData(true);
// Save rockets, load, validate
File file = saveRocket(rocketDoc, options);
@ -258,7 +258,7 @@ public class OpenRocketSaverTest {
OpenRocketDocument rocketDoc = TestRockets.makeTestRocket_v104_withSimulationData();
StorageOptions options = new StorageOptions();
options.setSimulationTimeSkip(0.05);
options.setSaveSimulationData(true);
long estimatedSize = saver.estimateFileSize(rocketDoc, options);

View File

@ -74,37 +74,9 @@ public class StorageOptionChooser extends JPanel {
buttonGroup.add(allButton);
allButton.addActionListener(actionUpdater);
this.add(allButton, "spanx, wrap rel");
//// Every
someButton = new JRadioButton(trans.get("StorageOptChooser.rdbut.Every"));
//// <html>Store plottable values approximately this far apart.<br>"
//// Larger values result in smaller files.
tip = trans.get("StorageOptChooser.lbl.longB1") +
trans.get("StorageOptChooser.lbl.longB2");
someButton.setToolTipText(tip);
buttonGroup.add(someButton);
someButton.addActionListener(actionUpdater);
this.add(someButton, "");
timeSpinner = new JSpinner(new SpinnerNumberModel(0.0, 0.0, 5.0, 0.1));
timeSpinner.setToolTipText(tip);
timeSpinner.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (artificialEvent)
return;
someButton.setSelected(true);
}
});
this.add(timeSpinner, "wmin 55lp");
//// seconds
JLabel label = new JLabel(trans.get("StorageOptChooser.lbl.seconds"));
label.setToolTipText(tip);
this.add(label, "wrap rel");
//// Only primary figures
noneButton = new JRadioButton(trans.get("StorageOptChooser.rdbut.Onlyprimfig"));
//// Only summary data
noneButton = new JRadioButton(trans.get("StorageOptChooser.rdbut.Onlysummarydata"));
//// <html>Store only the values shown in the summary table.<br>
//// This results in the smallest files.
noneButton.setToolTipText(trans.get("StorageOptChooser.lbl.longC1") +
@ -129,42 +101,20 @@ public class StorageOptionChooser extends JPanel {
public void loadOptions(StorageOptions opts) {
double t;
// Data storage radio button
t = opts.getSimulationTimeSkip();
if (t == StorageOptions.SIMULATION_DATA_ALL) {
if (opts.getSaveSimulationData()) {
allButton.setSelected(true);
t = DEFAULT_SAVE_TIME_SKIP;
} else if (t == StorageOptions.SIMULATION_DATA_NONE) {
noneButton.setSelected(true);
t = DEFAULT_SAVE_TIME_SKIP;
} else {
someButton.setSelected(true);
noneButton.setSelected(true);
}
// Time skip spinner
artificialEvent = true;
timeSpinner.setValue(t);
artificialEvent = false;
updateInfoLabel();
}
public void storeOptions(StorageOptions opts) {
double t;
if (allButton.isSelected()) {
t = StorageOptions.SIMULATION_DATA_ALL;
} else if (noneButton.isSelected()) {
t = StorageOptions.SIMULATION_DATA_NONE;
} else {
t = (Double)timeSpinner.getValue();
}
opts.setSimulationTimeSkip(t);
opts.setSaveSimulationData(allButton.isSelected());
opts.setExplicitlySet(true);
}

View File

@ -55,7 +55,7 @@ public class RockSimConverter {
try {
StorageOptions opts = new StorageOptions();
opts.setFileType(StorageOptions.FileType.OPENROCKET);
opts.setSimulationTimeSkip(StorageOptions.SIMULATION_DATA_NONE);
opts.setSaveSimulationData(false);
opts.setExplicitlySet(true);
GeneralRocketLoader loader = new GeneralRocketLoader(input);