[Bugfix] Fixed additional Translation, Configuration Issues
- Fixed translation messages - FlightConfiguration, MotorConfiguration - correctly display under debug & production - Fixed exception throw when adding empty-MotorConfiguration to a FlightConfig
This commit is contained in:
parent
2ee7464038
commit
a6990dddc5
@ -1477,7 +1477,10 @@ MotorMount.IgnitionEvent.short.EJECTION_CHARGE = Ejection charge
|
||||
MotorMount.IgnitionEvent.short.BURNOUT = Burnout
|
||||
MotorMount.IgnitionEvent.short.NEVER = Never
|
||||
|
||||
MotorMount.NoMotors = [No Motors Defined]
|
||||
FlightConfiguration.noMotors = No motors
|
||||
|
||||
MotorConfiguration.empty = None
|
||||
|
||||
|
||||
!ComponentIcons
|
||||
ComponentIcons.Stage = Axial Stage
|
||||
|
@ -41,13 +41,13 @@ public class RocketSaver extends RocketComponentSaver {
|
||||
}
|
||||
|
||||
|
||||
// Motor configurations
|
||||
// Flight configurations
|
||||
for (FlightConfigurationId fcid : rocket.getIds()) {
|
||||
FlightConfiguration flightConfig = rocket.getFlightConfiguration(fcid);
|
||||
if (fcid == null)
|
||||
continue;
|
||||
|
||||
// these are actually FlightConfigurationIds, buuuuuuuuuut backwards-compatible tags.
|
||||
// these are actually FlightConfigurationIds, but the old tag name is preserved for backwards-compatibility.
|
||||
String str = "<motorconfiguration configid=\"" + fcid.key + "\"";
|
||||
// if the configuration is the default, add the tag
|
||||
if ( rocket.getSelectedConfiguration().equals( flightConfig )){
|
||||
|
@ -1,10 +1,12 @@
|
||||
package net.sf.openrocket.motor;
|
||||
|
||||
import net.sf.openrocket.l10n.Translator;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameter;
|
||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||
import net.sf.openrocket.rocketcomponent.InnerTube;
|
||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||
import net.sf.openrocket.startup.Application;
|
||||
import net.sf.openrocket.util.Coordinate;
|
||||
import net.sf.openrocket.util.Inertia;
|
||||
|
||||
@ -14,8 +16,8 @@ import net.sf.openrocket.util.Inertia;
|
||||
*/
|
||||
public class MotorConfiguration implements FlightConfigurableParameter<MotorConfiguration> {
|
||||
|
||||
public static final String EMPTY_DESCRIPTION = "Empty Motor Configuration".intern();
|
||||
|
||||
private static final Translator trans = Application.getTranslator();
|
||||
|
||||
private final MotorMount mount;
|
||||
private final FlightConfigurationId fcid;
|
||||
private final MotorConfigurationId mid;
|
||||
@ -60,7 +62,7 @@ public class MotorConfiguration implements FlightConfigurableParameter<MotorConf
|
||||
|
||||
public String toMotorDescription(){
|
||||
if( motor == null ){
|
||||
return "<Empty>";
|
||||
return trans.get("empty");
|
||||
}else{
|
||||
return this.motor.getDesignation() + "-" + (int)this.getEjectionDelay();
|
||||
}
|
||||
|
@ -314,7 +314,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
||||
}
|
||||
}
|
||||
if( 0 == activeMotorCount ){
|
||||
return trans.get("MotorMount.NoMotors");
|
||||
return trans.get("noMotors");
|
||||
}
|
||||
buff.append("]");
|
||||
return buff.toString();
|
||||
@ -331,7 +331,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
||||
*/
|
||||
public void addMotor(MotorConfiguration motorConfig) {
|
||||
if( motorConfig.isEmpty() ){
|
||||
throw new IllegalArgumentException("MotorInstance is empty.");
|
||||
log.error("attempt to add an empty motorConfig! ignoring. ", new IllegalArgumentException("empty MotorInstance: "+motorConfig.toDebugDetail()));
|
||||
}
|
||||
|
||||
this.motors.put( motorConfig.getID(), motorConfig);
|
||||
|
Loading…
x
Reference in New Issue
Block a user