1 package net.sf.openrocket.file.rocksim.export;
3 import net.sf.openrocket.file.rocksim.RocksimCommonConstants;
4 import net.sf.openrocket.rocketcomponent.RadiusRingComponent;
5 import net.sf.openrocket.rocketcomponent.ThicknessRingComponent;
7 import javax.xml.bind.annotation.XmlAccessType;
8 import javax.xml.bind.annotation.XmlAccessorType;
9 import javax.xml.bind.annotation.XmlElement;
10 import javax.xml.bind.annotation.XmlRootElement;
11 import javax.xml.bind.annotation.XmlTransient;
14 * Centering ring conversion from OR to Rocksim.
16 @XmlRootElement(name = RocksimCommonConstants.RING)
17 @XmlAccessorType(XmlAccessType.FIELD)
18 public class CenteringRingDTO extends BasePartDTO {
21 protected enum UsageCode {
36 @XmlElement(name = RocksimCommonConstants.OD)
37 private double od = 0d;
38 @XmlElement(name = RocksimCommonConstants.ID)
39 private double id = 0d;
40 @XmlElement(name = RocksimCommonConstants.USAGE_CODE)
41 private int usageCode = UsageCode.CenteringRing.ordinal;
42 @XmlElement(name = RocksimCommonConstants.AUTO_SIZE)
43 private int autoSize = 0;
46 * Default Constructor.
48 public CenteringRingDTO() {
54 * @param theORRadiusRing
56 public CenteringRingDTO(RadiusRingComponent theORRadiusRing) {
57 super(theORRadiusRing);
58 setId(theORRadiusRing.getInnerRadius()* RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS);
59 setOd(theORRadiusRing.getOuterRadius()* RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS);
65 * @param theORThicknessRing
67 public CenteringRingDTO(ThicknessRingComponent theORThicknessRing) {
68 super(theORThicknessRing);
69 setId(theORThicknessRing.getInnerRadius()* RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS);
70 setOd(theORThicknessRing.getOuterRadius()* RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS);
73 public double getOd() {
77 public void setOd(double theOd) {
81 public double getId() {
85 public void setId(double theId) {
89 public int getUsageCode() {
93 public void setUsageCode(int theUsageCode) {
94 usageCode = theUsageCode;
97 public void setUsageCode(UsageCode theUsageCode) {
98 usageCode = theUsageCode.ordinal;
101 public int getAutoSize() {
105 public void setAutoSize(int theAutoSize) {
106 autoSize = theAutoSize;