In Cdm example don't actually save Cdm to FlightDataBranch until after simulation step.
This commit is contained in:
parent
e1490e0d3d
commit
90f09d9860
@ -1 +1 @@
|
||||
Subproject commit 93054dc2b40d5196433b1d91c636cee2e9dda424
|
||||
Subproject commit 48eb2172d58c0db6042bd847a782835df056b287
|
@ -25,6 +25,9 @@ import info.openrocket.core.unit.UnitGroup;
|
||||
public class DampingMoment extends AbstractSimulationExtension {
|
||||
private static final Logger log = LoggerFactory.getLogger(DampingMoment.class);
|
||||
|
||||
// Keep it internal until time to publish in the FlightDataBranch
|
||||
private double Cdm = Double.NaN;
|
||||
|
||||
// Save it as a FlightDataType
|
||||
private static final FlightDataType cdm = FlightDataType.getType("Damping moment coefficient", "Cdm",
|
||||
UnitGroup.UNITS_COEFFICIENT);
|
||||
@ -62,11 +65,16 @@ public class DampingMoment extends AbstractSimulationExtension {
|
||||
throws SimulationException {
|
||||
|
||||
// status.getFlightDataBranch().setValue(cdm, aerodynamicPart + propulsivePart);
|
||||
status.getFlightDataBranch().setValue(cdm, calculate(status, flightConditions));
|
||||
Cdm = calculate(status, flightConditions);
|
||||
|
||||
return flightConditions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postStep(SimulationStatus status) {
|
||||
status.getFlightDataBranch().setValue(cdm, Cdm);
|
||||
}
|
||||
|
||||
private double calculate(SimulationStatus status, FlightConditions flightConditions) {
|
||||
|
||||
// Work out the propulsive/jet damping part of the moment.
|
||||
|
Loading…
x
Reference in New Issue
Block a user