From 74d636bf33a4f530c18675de2621f8074a797947 Mon Sep 17 00:00:00 2001 From: Wes Cravens Date: Wed, 23 Mar 2016 13:23:40 -0500 Subject: [PATCH] Add concurrent mass info for both with and without motor configuration --- core/resources/l10n/messages.properties | 4 +-- core/resources/l10n/messages_cs.properties | 4 +-- core/resources/l10n/messages_de.properties | 4 +-- core/resources/l10n/messages_es.properties | 4 +-- core/resources/l10n/messages_fr.properties | 4 +-- core/resources/l10n/messages_it.properties | 4 +-- core/resources/l10n/messages_ja.properties | 4 +-- core/resources/l10n/messages_pl.properties | 4 +-- core/resources/l10n/messages_pt.properties | 4 +-- core/resources/l10n/messages_ru.properties | 6 ++-- core/resources/l10n/messages_uk_UA.properties | 4 +-- core/resources/l10n/messages_zh_CN.properties | 4 +-- .../gui/figureelements/RocketInfo.java | 29 +++++++++++-------- .../gui/scalefigure/RocketPanel.java | 1 + 14 files changed, 43 insertions(+), 37 deletions(-) diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties index 72f5c27ab..a92227a17 100644 --- a/core/resources/l10n/messages.properties +++ b/core/resources/l10n/messages.properties @@ -1518,8 +1518,8 @@ TCurveMotor.ttip.emptyMass = Empty mass: ! RocketInfo RocketInfo.lengthLine.Length = Length RocketInfo.lengthLine.maxdiameter = , max. diameter -RocketInfo.massText1 = Mass with motors -RocketInfo.massText2 = Mass with no motors +RocketInfo.massWithMotors = Mass with motors +RocketInfo.massWithoutMotors = Mass with no motors RocketInfo.at = at M= RocketInfo.cgText = CG: RocketInfo.cpText = CP: diff --git a/core/resources/l10n/messages_cs.properties b/core/resources/l10n/messages_cs.properties index b3ba6f04e..cc77e423b 100644 --- a/core/resources/l10n/messages_cs.properties +++ b/core/resources/l10n/messages_cs.properties @@ -1222,8 +1222,8 @@ TCurveMotorCol.LENGTH = D ! RocketInfo RocketInfo.lengthLine.Length = Délka RocketInfo.lengthLine.maxdiameter = , max. prumer -RocketInfo.massText1 = Hmotnost s motory -RocketInfo.massText2 = Hmotnost bez motoru +RocketInfo.massWithMotors = Hmotnost s motory +RocketInfo.massWithoutMotors = Hmotnost bez motoru RocketInfo.at = v M= RocketInfo.cgText = Te\u017Eí\u0161te: RocketInfo.cpText = Centrum tlaku: diff --git a/core/resources/l10n/messages_de.properties b/core/resources/l10n/messages_de.properties index 753563197..49ce7885b 100644 --- a/core/resources/l10n/messages_de.properties +++ b/core/resources/l10n/messages_de.properties @@ -1281,8 +1281,8 @@ TCurveMotorCol.LENGTH = L ! RocketInfo RocketInfo.lengthLine.Length = Länge RocketInfo.lengthLine.maxdiameter = , max. Durchmesser -RocketInfo.massText1 = Masse mit Motoren -RocketInfo.massText2 = Masse ohne Motoren +RocketInfo.massWithMotors = Masse mit Motoren +RocketInfo.massWithoutMotors = Masse ohne Motoren RocketInfo.at = bei M= RocketInfo.cgText = CG: RocketInfo.cpText = CP: diff --git a/core/resources/l10n/messages_es.properties b/core/resources/l10n/messages_es.properties index 9b05add89..591e52d72 100644 --- a/core/resources/l10n/messages_es.properties +++ b/core/resources/l10n/messages_es.properties @@ -887,8 +887,8 @@ RocketInfo.cpText = CP: ! RocketInfo RocketInfo.lengthLine.Length = Longitud: RocketInfo.lengthLine.maxdiameter = , Di\u00e1metro m\u00e1ximo: -RocketInfo.massText1 = Masa con motores: -RocketInfo.massText2 = Masa sin motores: +RocketInfo.massWithMotors = Masa con motores: +RocketInfo.massWithoutMotors = Masa sin motores: RocketInfo.stabText = Estabilidad: RocketInfo.velocityValue = N/A diff --git a/core/resources/l10n/messages_fr.properties b/core/resources/l10n/messages_fr.properties index c50fff088..128cb9141 100644 --- a/core/resources/l10n/messages_fr.properties +++ b/core/resources/l10n/messages_fr.properties @@ -878,8 +878,8 @@ RocketInfo.cpText = CP: ! RocketInfo RocketInfo.lengthLine.Length = Longueur RocketInfo.lengthLine.maxdiameter = , diam\u00E8tre max. -RocketInfo.massText1 = Masse avec moteurs -RocketInfo.massText2 = Masse sans moteurs +RocketInfo.massWithMotors = Masse avec moteurs +RocketInfo.massWithoutMotors = Masse sans moteurs RocketInfo.stabText = Stabilit\u00E9: RocketInfo.velocityValue = N/A diff --git a/core/resources/l10n/messages_it.properties b/core/resources/l10n/messages_it.properties index a6441d2e6..984674366 100644 --- a/core/resources/l10n/messages_it.properties +++ b/core/resources/l10n/messages_it.properties @@ -1285,8 +1285,8 @@ TCurveMotorCol.LENGTH = Lunghezza ! RocketInfo RocketInfo.lengthLine.Length = Lunghezza RocketInfo.lengthLine.maxdiameter = , max. diametro -RocketInfo.massText1 = Massa CON motori -RocketInfo.massText2 = Massa SENZA motori +RocketInfo.massWithMotors = Massa CON motori +RocketInfo.massWithoutMotors = Massa SENZA motori RocketInfo.at = a M= RocketInfo.cgText = CG: RocketInfo.cpText = CP: diff --git a/core/resources/l10n/messages_ja.properties b/core/resources/l10n/messages_ja.properties index 635895bb1..9ac720d0e 100644 --- a/core/resources/l10n/messages_ja.properties +++ b/core/resources/l10n/messages_ja.properties @@ -1343,8 +1343,8 @@ TCurveMotor.ttip.emptyMass = \u7A7A\u865A\u8CEA\u91CF\uFF1A ! RocketInfo RocketInfo.lengthLine.Length = \u9577\u3055 RocketInfo.lengthLine.maxdiameter = , \u6700\u5927\u76F4\u5F84 -RocketInfo.massText1 = \u30E2\u30FC\u30BF\u30FC\u8FBC\u307F\u91CD\u91CF -RocketInfo.massText2 = \u30E2\u30FC\u30BF\u30FC\u7121\u3057\u91CD\u91CF +RocketInfo.massWithMotors = \u30E2\u30FC\u30BF\u30FC\u8FBC\u307F\u91CD\u91CF +RocketInfo.massWithoutMotors = \u30E2\u30FC\u30BF\u30FC\u7121\u3057\u91CD\u91CF RocketInfo.at = at M= RocketInfo.cgText = CG: RocketInfo.cpText = CP: diff --git a/core/resources/l10n/messages_pl.properties b/core/resources/l10n/messages_pl.properties index d58ccec52..783b36b41 100644 --- a/core/resources/l10n/messages_pl.properties +++ b/core/resources/l10n/messages_pl.properties @@ -1226,8 +1226,8 @@ ! RocketInfo RocketInfo.lengthLine.Length = D\u0142ugo\u015B\u0107 RocketInfo.lengthLine.maxdiameter = , maks. \u015Brednica - RocketInfo.massText1 = Masa z silnikami - RocketInfo.massText2 = Masa bez silników + RocketInfo.massWithMotors = Masa z silnikami + RocketInfo.massWithoutMotors = Masa bez silników RocketInfo.at = przy M RocketInfo.cgText = \u015AC: RocketInfo.cpText = \u015AP: diff --git a/core/resources/l10n/messages_pt.properties b/core/resources/l10n/messages_pt.properties index 043926126..fa5b1aead 100644 --- a/core/resources/l10n/messages_pt.properties +++ b/core/resources/l10n/messages_pt.properties @@ -862,8 +862,8 @@ RocketInfo.cpText = CP: # RocketInfo RocketInfo.lengthLine.Length = Tamanho RocketInfo.lengthLine.maxdiameter = , di\u00e2metro m\u00e1x. -RocketInfo.massText1 = Massa com motores -RocketInfo.massText2 = Massa sem motores +RocketInfo.massWithMotors = Massa com motores +RocketInfo.massWithoutMotors = Massa sem motores RocketInfo.stabText = Estabilidade: RocketInfo.velocityValue = N/D diff --git a/core/resources/l10n/messages_ru.properties b/core/resources/l10n/messages_ru.properties index 8e3ed1787..224e26691 100644 --- a/core/resources/l10n/messages_ru.properties +++ b/core/resources/l10n/messages_ru.properties @@ -1435,8 +1435,8 @@ TCurveMotor.ttip.emptyMass = \u041c\u0430\u0441\u0441\u0430 \u0431\u0435\u0437 \ ! RocketInfo RocketInfo.lengthLine.Length = \u0414\u043b\u0438\u043d\u0430 RocketInfo.lengthLine.maxdiameter = , \u043c\u0430\u043a\u0441. \u0434\u0438\u0430\u043c\u0435\u0442\u0440 -RocketInfo.massText1 = \u041c\u0430\u0441\u0441\u0430 \u0441 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f\u043c\u0438 -RocketInfo.massText2 = \u041c\u0430\u0441\u0441\u0430 \u0431\u0435\u0437 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 +RocketInfo.massWithMotors = \u041c\u0430\u0441\u0441\u0430 \u0441 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f\u043c\u0438 +RocketInfo.massWithoutMotors = \u041c\u0430\u0441\u0441\u0430 \u0431\u0435\u0437 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 RocketInfo.at = \u041f\u0440\u0438 M RocketInfo.cgText = \u0426\u0422: RocketInfo.cpText = \u0426\u0414: @@ -1891,4 +1891,4 @@ SeparationSelectionDialog.opt.override = \u0418\u0437\u043c\u0435\u043d\u0438\u0 MotorConfigurationPanel.description = \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0438 \u0438 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0436\u0438\u0433\u0430\u043d\u0438\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u043b\u0435\u0442\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.
\u041a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439: \u0423\u043a\u0430\u0436\u0438\u0442\u0435, \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439.
\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439: \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u0438 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0436\u0438\u0433\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f. -MotorDescriptionSubstitutor.description = \u0414\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \ No newline at end of file +MotorDescriptionSubstitutor.description = \u0414\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 diff --git a/core/resources/l10n/messages_uk_UA.properties b/core/resources/l10n/messages_uk_UA.properties index e08bdba37..a1ca5c98b 100644 --- a/core/resources/l10n/messages_uk_UA.properties +++ b/core/resources/l10n/messages_uk_UA.properties @@ -1440,8 +1440,8 @@ TCurveMotor.ttip.emptyMass = Empty mass: ! RocketInfo RocketInfo.lengthLine.Length = Length RocketInfo.lengthLine.maxdiameter = , max. diameter -RocketInfo.massText1 = Mass with motors -RocketInfo.massText2 = Mass with no motors +RocketInfo.massWithMotors = Mass with motors +RocketInfo.massWithoutMotors = Mass with no motors RocketInfo.at = at M= RocketInfo.cgText = CG: RocketInfo.cpText = CP: diff --git a/core/resources/l10n/messages_zh_CN.properties b/core/resources/l10n/messages_zh_CN.properties index 11b77c7ee..364cddaac 100644 --- a/core/resources/l10n/messages_zh_CN.properties +++ b/core/resources/l10n/messages_zh_CN.properties @@ -952,8 +952,8 @@ RocketInfo.cpText = CP(\u538B\u5FC3): ! RocketInfo RocketInfo.lengthLine.Length = \u957F\u5EA6 RocketInfo.lengthLine.maxdiameter = , \u6700\u5927\u76F4\u5F84 -RocketInfo.massText1 = \u542B\u53D1\u52A8\u673A\u7684\u603B\u8D28\u91CF -RocketInfo.massText2 = \u4E0D\u542B\u53D1\u52A8\u673A\u7684\u51C0\u8D28\u91CF +RocketInfo.massWithMotors = \u542B\u53D1\u52A8\u673A\u7684\u603B\u8D28\u91CF +RocketInfo.massWithoutMotors = \u4E0D\u542B\u53D1\u52A8\u673A\u7684\u51C0\u8D28\u91CF RocketInfo.stabText = \u7A33\u5B9A\u6027: RocketInfo.velocityValue = N/A diff --git a/swing/src/net/sf/openrocket/gui/figureelements/RocketInfo.java b/swing/src/net/sf/openrocket/gui/figureelements/RocketInfo.java index d4bcc4d01..30032c1d5 100644 --- a/swing/src/net/sf/openrocket/gui/figureelements/RocketInfo.java +++ b/swing/src/net/sf/openrocket/gui/figureelements/RocketInfo.java @@ -47,6 +47,7 @@ public class RocketInfo implements FigureElement { private double cg = 0, cp = 0; private double length = 0, diameter = 0; private double mass = 0; + private double massWithoutMotors = 0; private double aoa = Double.NaN, theta = Double.NaN, mach = Application.getPreferences().getDefaultMach(); private WarningSet warnings = null; @@ -150,25 +151,29 @@ public class RocketInfo implements FigureElement { trans.get("RocketInfo.lengthLine.maxdiameter") +" " + UnitGroup.UNITS_LENGTH.getDefaultUnit().toStringUnit(diameter)); - String massText; - if (configuration.hasMotors()) - //// Mass with motors - massText = trans.get("RocketInfo.massText1") +" "; - else - //// Mass with no motors - massText = trans.get("RocketInfo.massText2") +" "; - - massText += UnitGroup.UNITS_MASS.getDefaultUnit().toStringUnit(mass); - - GlyphVector massLine = createText(massText); + String massTextWithMotors; + String massTextWithoutMotors; + + /// Mass with no motors + massTextWithoutMotors = trans.get("RocketInfo.massWithoutMotors") +" "; + massTextWithoutMotors += UnitGroup.UNITS_MASS.getDefaultUnit().toStringUnit(massWithoutMotors); + + GlyphVector massLineWithoutMotors = createText(massTextWithoutMotors); - g2.setColor(Color.BLACK); g2.drawGlyphVector(name, x1, y1); g2.drawGlyphVector(lengthLine, x1, y1+line); g2.drawGlyphVector(massLine, x1, y1+2*line); + if( configuration.hasMotors() ) { + //// Mass with motors + massTextWithMotors = trans.get("RocketInfo.massWithMotors") + " "; + massTextWithMotors += UnitGroup.UNITS_MASS.getDefaultUnit().toStringUnit(mass); + GlyphVector massLineWithMotors = createText(massTextWithMotors); + g2.drawGlyphVector(massLineWithMotors, x1, y1+3*line); + } + } diff --git a/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java b/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java index d011ea5ec..fc501dbbe 100644 --- a/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java +++ b/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java @@ -652,6 +652,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change extraText.setLength(length); extraText.setDiameter(diameter); extraText.setMass(cg.weight); + extraText.setMassWithoutMotors( massCalculator.getCG( configuration, MassCalcType.NO_MOTORS ).weight ); extraText.setWarnings(warnings);