[Resolves #391] Localized description is displayed for relative positioning methods

This commit is contained in:
Daniel_M_Williams 2018-02-03 10:37:40 -05:00
parent 7017b0b2f0
commit 0ef72ec66d
6 changed files with 28 additions and 13 deletions

View File

@ -197,7 +197,7 @@ public class AxialStage extends ComponentAssembly implements FlightConfigurableC
if( 1 == getInstanceCount()){
buffer.append(String.format("%-40s| %5.3f; %24s; %24s;", indent+this.getName()+" (# "+this.getStageNumber()+")",
this.getLength(), this.getPosition(), this.getComponentLocations()[0]));
buffer.append(String.format("len: %6.4f )(offset: %4.1f via: %s )\n", this.getLength(), this.getAxialOffset(), this.axialMethod.name ));
buffer.append(String.format("len: %6.4f )(offset: %4.1f via: %s )\n", this.getLength(), this.getAxialOffset(), this.axialMethod.name() ));
}else{
buffer.append(String.format("%-40s|(len: %6.4f )(offset: %4.1f via: %s)\n", (indent+this.getName()+"(# "+this.getStageNumber()+")"), this.getLength(), this.getAxialOffset(), this.axialMethod.name() ));
for (int instanceNumber = 0; instanceNumber < this.getInstanceCount(); instanceNumber++) {

View File

@ -155,7 +155,7 @@ public class PodSet extends ComponentAssembly implements RingInstanceable {
if (this.isAfter()){
// remember the implicit (this instanceof Stage)
throw new BugException("found a Stage on centerline, but not positioned as AFTER. Please fix this! " + this.getName() + " is " + this.getAxialMethod().name );
throw new BugException("found a pod positioned via: AFTER, but is not on the centerline?!: " + this.getName() + " is " + this.getAxialMethod().name() );
} else {
returnValue = super.asPositionValue(this.axialMethod);
}

View File

@ -967,7 +967,7 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab
}else if( AxialMethod.BOTTOM == asMethod) {
result = this.position.x + ( this.length - parentLength);
}else {
throw new BugException("Unknown position type: " + asMethod.name);
throw new BugException("Unknown position type: " + asMethod.name() );
}
return result;
@ -2176,7 +2176,7 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab
StackTraceElement[] stackTrace = (new Exception()).getStackTrace();
buf.append(" >> Dumping Detailed Information from: " + stackTrace[1].getMethodName() + "\n");
buf.append(" current Component: " + this.getName() + " ofClass: " + this.getClass().getSimpleName() + "\n");
buf.append(" offset: " + this.axialOffset + " via: " + this.axialMethod.name + " => " + this.getAxialOffset() + "\n");
buf.append(" offset: " + this.axialOffset + " via: " + this.axialMethod.name() + " => " + this.getAxialOffset() + "\n");
buf.append(" thisCenterX: " + this.position.x + "\n");
buf.append(" this length: " + this.length + "\n");
return buf;

View File

@ -49,12 +49,17 @@ public enum AngleMethod implements DistanceMethod {
return new AngleMethod[]{ AngleMethod.RELATIVE };
}
public final String name;
public final String description;
private AngleMethod( final String _name ) {
this.name= _name;
private AngleMethod( final String descr ) {
this.description= descr;
}
@Override
public String toString() {
return description;
}
@Override
public boolean clampToZero() { return true; }

View File

@ -35,13 +35,18 @@ public enum AxialMethod implements DistanceMethod {
public static final AxialMethod[] axialOffsetMethods = { TOP, MIDDLE, BOTTOM };
public final String name;
public final String description;
private AxialMethod( final String _name ) {
this.name=_name;
private AxialMethod( final String newDescription ) {
this.description=newDescription;
}
@Override
public boolean clampToZero() { return true; }
@Override
public String toString() {
return description;
}
}

View File

@ -58,12 +58,17 @@ public enum RadiusMethod implements DistanceMethod {
return new RadiusMethod[]{ RadiusMethod.FREE, RadiusMethod.RELATIVE };
}
public final String name;
public final String description;
// =============
private RadiusMethod( final String _name ) {
this.name = _name;
private RadiusMethod( final String descr ) {
this.description = descr;
}
@Override
public String toString() {
return description;
}
@Override