Merge remote-tracking branch 'origin/fix-2443' into fix-2443
This commit is contained in:
commit
3086635f39
@ -319,6 +319,8 @@ public abstract class AbstractSimulationStepper implements SimulationStepper {
|
||||
flightConditions.getAtmosphericConditions().getTemperature());
|
||||
dataBranch.setValue(FlightDataType.TYPE_AIR_PRESSURE,
|
||||
flightConditions.getAtmosphericConditions().getPressure());
|
||||
dataBranch.setValue(FlightDataType.TYPE_AIR_DENSITY,
|
||||
flightConditions.getAtmosphericConditions().getDensity());
|
||||
dataBranch.setValue(FlightDataType.TYPE_SPEED_OF_SOUND,
|
||||
flightConditions.getAtmosphericConditions().getMachSpeed());
|
||||
}
|
||||
|
@ -275,10 +275,14 @@ public class FlightDataType implements Comparable<FlightDataType> {
|
||||
public static final FlightDataType TYPE_AIR_PRESSURE = newType(trans.get("FlightDataType.TYPE_AIR_PRESSURE"), "P",
|
||||
UnitGroup.UNITS_PRESSURE,
|
||||
FlightDataTypeGroup.ATMOSPHERIC_CONDITIONS, 2);
|
||||
//// Air density
|
||||
public static final FlightDataType TYPE_AIR_DENSITY = newType(trans.get("FlightDataType.TYPE_AIR_DENSITY"), "\u03C1",
|
||||
UnitGroup.UNITS_DENSITY_BULK,
|
||||
FlightDataTypeGroup.ATMOSPHERIC_CONDITIONS, 3);
|
||||
//// Speed of sound
|
||||
public static final FlightDataType TYPE_SPEED_OF_SOUND = newType(trans.get("FlightDataType.TYPE_SPEED_OF_SOUND"),
|
||||
"Vs", UnitGroup.UNITS_VELOCITY,
|
||||
FlightDataTypeGroup.ATMOSPHERIC_CONDITIONS, 3);
|
||||
FlightDataTypeGroup.ATMOSPHERIC_CONDITIONS, 4);
|
||||
|
||||
// Simulation information
|
||||
//// Simulation time step
|
||||
@ -345,6 +349,7 @@ public class FlightDataType implements Comparable<FlightDataType> {
|
||||
TYPE_WIND_VELOCITY,
|
||||
TYPE_AIR_TEMPERATURE,
|
||||
TYPE_AIR_PRESSURE,
|
||||
TYPE_AIR_DENSITY,
|
||||
TYPE_SPEED_OF_SOUND,
|
||||
TYPE_TIME_STEP,
|
||||
TYPE_COMPUTATION_TIME
|
||||
|
@ -2119,6 +2119,7 @@ FlightDataType.TYPE_ORIENTATION_PHI = Lateral orientation (azimuth)
|
||||
FlightDataType.TYPE_WIND_VELOCITY = Wind velocity
|
||||
FlightDataType.TYPE_AIR_TEMPERATURE = Air temperature
|
||||
FlightDataType.TYPE_AIR_PRESSURE = Air pressure
|
||||
FlightDataType.TYPE_AIR_DENSITY = Air density
|
||||
FlightDataType.TYPE_SPEED_OF_SOUND = Speed of sound
|
||||
FlightDataType.TYPE_TIME_STEP = Simulation time step
|
||||
FlightDataType.TYPE_COMPUTATION_TIME = Computation time
|
||||
|
@ -3,6 +3,7 @@ package info.openrocket.swing.gui.print;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
@ -12,18 +13,25 @@ import com.itextpdf.text.PageSize;
|
||||
import com.itextpdf.text.Rectangle;
|
||||
|
||||
public enum PaperSize {
|
||||
A1("A1", PageSize.A1),
|
||||
A2("A2", PageSize.A2),
|
||||
A3("A3", PageSize.A3),
|
||||
A4("A4", PageSize.A4),
|
||||
A5("A5", PageSize.A5),
|
||||
LETTER("Letter", PageSize.LETTER),
|
||||
LEGAL("Legal", PageSize.LEGAL);
|
||||
ANSI_D("ANSI D", new Rectangle(22 * PrintUnit.POINTS_PER_INCH, 34 * PrintUnit.POINTS_PER_INCH)),
|
||||
ANSI_C("ANSI C", new Rectangle(17 * PrintUnit.POINTS_PER_INCH, 22 * PrintUnit.POINTS_PER_INCH)),
|
||||
TABLOID("Tabloid (ANSI B)", PageSize.TABLOID, "Tabloid", "ANSI B"),
|
||||
LEGAL("Legal", PageSize.LEGAL),
|
||||
LETTER("Letter (ANSI A)", PageSize.LETTER, "Letter", "ANSI A");
|
||||
|
||||
private final String name;
|
||||
private final List<String> alternativeNames;
|
||||
private final Rectangle size;
|
||||
|
||||
private PaperSize(String name, Rectangle size) {
|
||||
|
||||
PaperSize(String name, Rectangle size, String... alternativeNames) {
|
||||
this.name = name;
|
||||
this.size = size;
|
||||
this.alternativeNames = List.of(alternativeNames);
|
||||
}
|
||||
|
||||
public Rectangle getSize() {
|
||||
@ -158,6 +166,11 @@ public enum PaperSize {
|
||||
if (p.name.equalsIgnoreCase(size)) {
|
||||
return p;
|
||||
}
|
||||
for (String alt : p.alternativeNames) {
|
||||
if (alt.equalsIgnoreCase(size)) {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user