Be more consistent about creating a new modID when changes take place
This commit is contained in:
parent
0e437a8cb7
commit
eb9106a6a4
@ -77,7 +77,11 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setAxisymmetric(final boolean isSym) {
|
public void setAxisymmetric(final boolean isSym) {
|
||||||
|
if (this.axisymmetric == isSym)
|
||||||
|
return;
|
||||||
|
|
||||||
this.axisymmetric = isSym;
|
this.axisymmetric = isSym;
|
||||||
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -87,6 +91,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
* @param component The rocket component
|
* @param component The rocket component
|
||||||
*/
|
*/
|
||||||
public void setComponent(RocketComponent component) {
|
public void setComponent(RocketComponent component) {
|
||||||
|
if (this.component == component)
|
||||||
|
return;
|
||||||
|
|
||||||
this.component = component;
|
this.component = component;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -100,6 +107,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCP(Coordinate cp) {
|
public void setCP(Coordinate cp) {
|
||||||
|
if ((this.cp != null) && this.cp.equals(cp))
|
||||||
|
return;
|
||||||
|
|
||||||
this.cp = cp;
|
this.cp = cp;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -109,6 +119,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCNa(double cNa) {
|
public void setCNa(double cNa) {
|
||||||
|
if (CNa == cNa)
|
||||||
|
return;
|
||||||
|
|
||||||
CNa = cNa;
|
CNa = cNa;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -118,6 +131,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCN(double cN) {
|
public void setCN(double cN) {
|
||||||
|
if (CN == cN)
|
||||||
|
return;
|
||||||
|
|
||||||
CN = cN;
|
CN = cN;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -127,6 +143,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCm(double cm) {
|
public void setCm(double cm) {
|
||||||
|
if (Cm == cm)
|
||||||
|
return;
|
||||||
|
|
||||||
Cm = cm;
|
Cm = cm;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -136,6 +155,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCside(double cside) {
|
public void setCside(double cside) {
|
||||||
|
if (Cside == cside)
|
||||||
|
return;
|
||||||
|
|
||||||
Cside = cside;
|
Cside = cside;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -145,6 +167,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCyaw(double cyaw) {
|
public void setCyaw(double cyaw) {
|
||||||
|
if (Cyaw == cyaw)
|
||||||
|
return;
|
||||||
|
|
||||||
Cyaw = cyaw;
|
Cyaw = cyaw;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -154,6 +179,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCroll(double croll) {
|
public void setCroll(double croll) {
|
||||||
|
if (Croll == croll)
|
||||||
|
return;
|
||||||
|
|
||||||
Croll = croll;
|
Croll = croll;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -163,6 +191,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCrollDamp(double crollDamp) {
|
public void setCrollDamp(double crollDamp) {
|
||||||
|
if (CrollDamp == crollDamp)
|
||||||
|
return;
|
||||||
|
|
||||||
CrollDamp = crollDamp;
|
CrollDamp = crollDamp;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -172,6 +203,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCrollForce(double crollForce) {
|
public void setCrollForce(double crollForce) {
|
||||||
|
if (CrollForce == crollForce)
|
||||||
|
return;
|
||||||
|
|
||||||
CrollForce = crollForce;
|
CrollForce = crollForce;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -181,6 +215,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCDaxial(double cdaxial) {
|
public void setCDaxial(double cdaxial) {
|
||||||
|
if (CDaxial == cdaxial)
|
||||||
|
return;
|
||||||
|
|
||||||
CDaxial = cdaxial;
|
CDaxial = cdaxial;
|
||||||
modID= new ModID();
|
modID= new ModID();
|
||||||
}
|
}
|
||||||
@ -190,6 +227,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCD(double cD) {
|
public void setCD(double cD) {
|
||||||
|
if (CD == cD)
|
||||||
|
return;
|
||||||
|
|
||||||
CD = cD;
|
CD = cD;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -206,6 +246,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setPressureCD(double pressureCD) {
|
public void setPressureCD(double pressureCD) {
|
||||||
|
if (this.pressureCD == pressureCD)
|
||||||
|
return;
|
||||||
|
|
||||||
this.pressureCD = pressureCD;
|
this.pressureCD = pressureCD;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -221,6 +264,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setBaseCD(double baseCD) {
|
public void setBaseCD(double baseCD) {
|
||||||
|
if (this.baseCD == baseCD)
|
||||||
|
return;
|
||||||
|
|
||||||
this.baseCD = baseCD;
|
this.baseCD = baseCD;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -236,6 +282,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setFrictionCD(double frictionCD) {
|
public void setFrictionCD(double frictionCD) {
|
||||||
|
if (this.frictionCD == frictionCD)
|
||||||
|
return;
|
||||||
|
|
||||||
this.frictionCD = frictionCD;
|
this.frictionCD = frictionCD;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -251,6 +300,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setOverrideCD(double overrideCD) {
|
public void setOverrideCD(double overrideCD) {
|
||||||
|
if (this.overrideCD == overrideCD)
|
||||||
|
return;
|
||||||
|
|
||||||
this.overrideCD = overrideCD;
|
this.overrideCD = overrideCD;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -266,6 +318,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setPitchDampingMoment(double pitchDampingMoment) {
|
public void setPitchDampingMoment(double pitchDampingMoment) {
|
||||||
|
if (this.pitchDampingMoment == pitchDampingMoment)
|
||||||
|
return;
|
||||||
|
|
||||||
this.pitchDampingMoment = pitchDampingMoment;
|
this.pitchDampingMoment = pitchDampingMoment;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
@ -275,6 +330,9 @@ public class AerodynamicForces implements Cloneable, Monitorable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setYawDampingMoment(double yawDampingMoment) {
|
public void setYawDampingMoment(double yawDampingMoment) {
|
||||||
|
if (this.yawDampingMoment == yawDampingMoment)
|
||||||
|
return;
|
||||||
|
|
||||||
this.yawDampingMoment = yawDampingMoment;
|
this.yawDampingMoment = yawDampingMoment;
|
||||||
modID = new ModID();
|
modID = new ModID();
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,6 @@ public class FlightConditions implements Cloneable, ChangeSource, Monitorable {
|
|||||||
public FlightConditions(FlightConfiguration config) {
|
public FlightConditions(FlightConfiguration config) {
|
||||||
if (config != null)
|
if (config != null)
|
||||||
setRefLength(config.getReferenceLength());
|
setRefLength(config.getReferenceLength());
|
||||||
this.modID = new ModID();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,9 +98,12 @@ public class FlightConditions implements Cloneable, ChangeSource, Monitorable {
|
|||||||
* fires change event
|
* fires change event
|
||||||
*/
|
*/
|
||||||
public void setRefLength(double length) {
|
public void setRefLength(double length) {
|
||||||
refLength = length;
|
if (refLength == length)
|
||||||
|
return;
|
||||||
|
|
||||||
|
refLength = length;
|
||||||
refArea = Math.PI * MathUtil.pow2(length / 2);
|
refArea = Math.PI * MathUtil.pow2(length / 2);
|
||||||
|
|
||||||
fireChangeEvent();
|
fireChangeEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,8 +119,12 @@ public class FlightConditions implements Cloneable, ChangeSource, Monitorable {
|
|||||||
* fires change event
|
* fires change event
|
||||||
*/
|
*/
|
||||||
public void setRefArea(double area) {
|
public void setRefArea(double area) {
|
||||||
|
if (refArea == area)
|
||||||
|
return;
|
||||||
|
|
||||||
refArea = area;
|
refArea = area;
|
||||||
refLength = MathUtil.safeSqrt(area / Math.PI) * 2;
|
refLength = MathUtil.safeSqrt(area / Math.PI) * 2;
|
||||||
|
|
||||||
fireChangeEvent();
|
fireChangeEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,6 +155,7 @@ public class FlightConditions implements Cloneable, ChangeSource, Monitorable {
|
|||||||
this.sinAOA = Math.sin(aoa);
|
this.sinAOA = Math.sin(aoa);
|
||||||
this.sincAOA = sinAOA / aoa;
|
this.sincAOA = sinAOA / aoa;
|
||||||
}
|
}
|
||||||
|
|
||||||
fireChangeEvent();
|
fireChangeEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,6 +185,7 @@ public class FlightConditions implements Cloneable, ChangeSource, Monitorable {
|
|||||||
} else {
|
} else {
|
||||||
this.sincAOA = sinAOA / aoa;
|
this.sincAOA = sinAOA / aoa;
|
||||||
}
|
}
|
||||||
|
|
||||||
fireChangeEvent();
|
fireChangeEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,6 +220,7 @@ public class FlightConditions implements Cloneable, ChangeSource, Monitorable {
|
|||||||
if (MathUtil.equals(this.theta, theta))
|
if (MathUtil.equals(this.theta, theta))
|
||||||
return;
|
return;
|
||||||
this.theta = theta;
|
this.theta = theta;
|
||||||
|
|
||||||
fireChangeEvent();
|
fireChangeEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,6 +247,7 @@ public class FlightConditions implements Cloneable, ChangeSource, Monitorable {
|
|||||||
this.beta = MathUtil.safeSqrt(1 - mach * mach);
|
this.beta = MathUtil.safeSqrt(1 - mach * mach);
|
||||||
else
|
else
|
||||||
this.beta = MathUtil.safeSqrt(mach * mach - 1);
|
this.beta = MathUtil.safeSqrt(mach * mach - 1);
|
||||||
|
|
||||||
fireChangeEvent();
|
fireChangeEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,6 +304,7 @@ public class FlightConditions implements Cloneable, ChangeSource, Monitorable {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this.rollRate = rate;
|
this.rollRate = rate;
|
||||||
|
|
||||||
fireChangeEvent();
|
fireChangeEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,7 +380,7 @@ public class FlightConditions implements Cloneable, ChangeSource, Monitorable {
|
|||||||
public void setAtmosphericConditions(AtmosphericConditions cond) {
|
public void setAtmosphericConditions(AtmosphericConditions cond) {
|
||||||
if (atmosphericConditions.equals(cond))
|
if (atmosphericConditions.equals(cond))
|
||||||
return;
|
return;
|
||||||
modID = new ModID();
|
|
||||||
atmosphericConditions = cond;
|
atmosphericConditions = cond;
|
||||||
fireChangeEvent();
|
fireChangeEvent();
|
||||||
}
|
}
|
||||||
@ -456,6 +467,8 @@ public class FlightConditions implements Cloneable, ChangeSource, Monitorable {
|
|||||||
* wake up call to listeners
|
* wake up call to listeners
|
||||||
*/
|
*/
|
||||||
protected void fireChangeEvent() {
|
protected void fireChangeEvent() {
|
||||||
|
modID = new ModID();
|
||||||
|
|
||||||
// Copy the list before iterating to prevent concurrent modification exceptions.
|
// Copy the list before iterating to prevent concurrent modification exceptions.
|
||||||
EventListener[] listeners = listenerList.toArray(new EventListener[0]);
|
EventListener[] listeners = listenerList.toArray(new EventListener[0]);
|
||||||
for (EventListener l : listeners) {
|
for (EventListener l : listeners) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user