1 package net.sf.openrocket.file.rocksim.export;
3 import net.sf.openrocket.file.rocksim.RocksimCommonConstants;
4 import net.sf.openrocket.file.rocksim.importt.BaseHandler;
5 import net.sf.openrocket.rocketcomponent.Parachute;
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;
14 @XmlRootElement(name = RocksimCommonConstants.PARACHUTE)
15 @XmlAccessorType(XmlAccessType.FIELD)
16 public class ParachuteDTO extends BasePartDTO {
18 @XmlElement(name = RocksimCommonConstants.DIAMETER)
19 private double dia = 0d;
20 @XmlElement(name = RocksimCommonConstants.SHROUD_LINE_COUNT)
21 private int ShroudLineCount = 0;
22 @XmlElement(name = RocksimCommonConstants.THICKNESS)
23 private double thickness = 0d;
24 @XmlElement(name = RocksimCommonConstants.SHROUD_LINE_LEN)
25 private double shroudLineLen = 0d;
26 @XmlElement(name = RocksimCommonConstants.CHUTE_COUNT)
27 private int chuteCount = 1;
28 @XmlElement(name = RocksimCommonConstants.SHROUD_LINE_MASS_PER_MM)
29 private double shroudLineMassPerMM = 0d;
30 @XmlElement(name = RocksimCommonConstants.SHROUD_LINE_MATERIAL)
31 private String shroudLineMaterial = "";
32 @XmlElement(name = RocksimCommonConstants.DRAG_COEFFICIENT)
33 private double dragCoefficient = 0.75d;
36 * Default constructor.
38 public ParachuteDTO() {
42 * Copy constructor. Fully populates this instance with values taken from the corresponding OR Parachute.
44 * @param theORParachute the OR Parachute instance
46 public ParachuteDTO(Parachute theORParachute) {
47 super(theORParachute);
50 setDia(theORParachute.getDiameter() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);
51 setDragCoefficient(theORParachute.getCD());
52 setShroudLineCount(theORParachute.getLineCount());
53 setShroudLineLen(theORParachute.getLineLength() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);
55 String material = theORParachute.getLineMaterial().getName();
56 setShroudLineMassPerMM(theORParachute.getLineMaterial().getDensity() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_LINE_DENSITY);
58 if (material.startsWith(BaseHandler.ROCKSIM_MATERIAL_PREFIX)) {
59 material = material.substring(BaseHandler.ROCKSIM_MATERIAL_PREFIX.length());
61 setShroudLineMaterial(material);
64 public double getDia() {
68 public void setDia(double theDia) {
72 public int getShroudLineCount() {
73 return ShroudLineCount;
76 public void setShroudLineCount(int theShroudLineCount) {
77 ShroudLineCount = theShroudLineCount;
80 public double getThickness() {
84 public void setThickness(double theThickness) {
85 thickness = theThickness;
88 public double getShroudLineLen() {
92 public void setShroudLineLen(double theShroudLineLen) {
93 shroudLineLen = theShroudLineLen;
96 public int getChuteCount() {
100 public void setChuteCount(int theChuteCount) {
101 chuteCount = theChuteCount;
104 public double getShroudLineMassPerMM() {
105 return shroudLineMassPerMM;
108 public void setShroudLineMassPerMM(double theShroudLineMassPerMM) {
109 shroudLineMassPerMM = theShroudLineMassPerMM;
112 public String getShroudLineMaterial() {
113 return shroudLineMaterial;
116 public void setShroudLineMaterial(String theShroudLineMaterial) {
117 shroudLineMaterial = theShroudLineMaterial;
120 public double getDragCoefficient() {
121 return dragCoefficient;
124 public void setDragCoefficient(double theDragCoefficient) {
125 dragCoefficient = theDragCoefficient;