adjusted configuration descriptions in UI to include ejection delay
This commit is contained in:
parent
04b4a45b2e
commit
c0a372258a
@ -14,6 +14,8 @@ import net.sf.openrocket.util.Inertia;
|
|||||||
*/
|
*/
|
||||||
public class MotorConfiguration implements FlightConfigurableParameter<MotorConfiguration> {
|
public class MotorConfiguration implements FlightConfigurableParameter<MotorConfiguration> {
|
||||||
|
|
||||||
|
public static final String EMPTY_DESCRIPTION = "Empty Configuration";
|
||||||
|
|
||||||
protected MotorMount mount = null;
|
protected MotorMount mount = null;
|
||||||
protected Motor motor = null;
|
protected Motor motor = null;
|
||||||
protected double ejectionDelay = 0.0;
|
protected double ejectionDelay = 0.0;
|
||||||
@ -64,6 +66,14 @@ public class MotorConfiguration implements FlightConfigurableParameter<MotorConf
|
|||||||
return motor != null;
|
return motor != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDescription(){
|
||||||
|
if( motor == null ){
|
||||||
|
return EMPTY_DESCRIPTION;
|
||||||
|
}else{
|
||||||
|
return this.motor.getDesignation() + " - " + this.getEjectionDelay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public MotorInstanceId getID() {
|
public MotorInstanceId getID() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
for ( RocketComponent comp : getActiveComponents() ){
|
for ( RocketComponent comp : getActiveComponents() ){
|
||||||
if (( comp instanceof MotorMount )&&( ((MotorMount)comp).isMotorMount())){
|
if (( comp instanceof MotorMount )&&( ((MotorMount)comp).isMotorMount())){
|
||||||
MotorMount mount = (MotorMount)comp;
|
MotorMount mount = (MotorMount)comp;
|
||||||
MotorConfiguration inst = mount.getMotorInstance( fcid);
|
MotorConfiguration motorConfig = mount.getMotorInstance( fcid);
|
||||||
|
|
||||||
if( first ){
|
if( first ){
|
||||||
first = false;
|
first = false;
|
||||||
@ -320,8 +320,8 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
buff.append(";");
|
buff.append(";");
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ! inst.isEmpty()){
|
if( ! motorConfig.isEmpty()){
|
||||||
buff.append( inst.getMotor().getDesignation());
|
buff.append( motorConfig.getDescription());
|
||||||
++activeMotorCount;
|
++activeMotorCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user