[fixes #358] Fix some more issues...
This commit is contained in:
parent
161120855c
commit
6a9ce5d34a
@ -226,6 +226,16 @@ public class MotorConfiguration implements FlightConfigurableParameter<MotorConf
|
|||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void copyFrom(MotorConfiguration configuration) {
|
||||||
|
if (configuration == null) return;
|
||||||
|
|
||||||
|
this.motor = configuration.motor;
|
||||||
|
this.ejectionDelay = configuration.ejectionDelay;
|
||||||
|
this.ignitionOveride = configuration.ignitionOveride;
|
||||||
|
this.ignitionDelay = configuration.ignitionDelay;
|
||||||
|
this.ignitionEvent = configuration.ignitionEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public int getModID() {
|
public int getModID() {
|
||||||
|
@ -390,7 +390,7 @@ public class BodyTube extends SymmetricComponent implements BoxBounded, MotorMou
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMotorConfig( final MotorConfiguration newMotorConfig, final FlightConfigurationId fcid){
|
public void setMotorConfig(MotorConfiguration newMotorConfig, FlightConfigurationId fcid){
|
||||||
if(null == newMotorConfig){
|
if(null == newMotorConfig){
|
||||||
this.motors.set( fcid, null);
|
this.motors.set( fcid, null);
|
||||||
}else{
|
}else{
|
||||||
@ -405,7 +405,11 @@ public class BodyTube extends SymmetricComponent implements BoxBounded, MotorMou
|
|||||||
|
|
||||||
for (RocketComponent listener : configListeners) {
|
for (RocketComponent listener : configListeners) {
|
||||||
if (listener instanceof BodyTube) {
|
if (listener instanceof BodyTube) {
|
||||||
((BodyTube) listener).setMotorConfig(newMotorConfig, fcid);
|
if (newMotorConfig != null) {
|
||||||
|
BodyTube tube = (BodyTube) listener;
|
||||||
|
MotorConfiguration config = tube.getMotorConfig(fcid);
|
||||||
|
config.copyFrom(newMotorConfig);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1873,6 +1873,10 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab
|
|||||||
configListeners.clear();
|
configListeners.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<RocketComponent> getConfigListeners() {
|
||||||
|
return configListeners;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether this component has been invalidated and should no longer be used.
|
* Checks whether this component has been invalidated and should no longer be used.
|
||||||
|
@ -85,7 +85,15 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
|||||||
document.addUndoPosition(trans.get("FinSetConfig.Convertfinset"));
|
document.addUndoPosition(trans.get("FinSetConfig.Convertfinset"));
|
||||||
RocketComponent freeform =
|
RocketComponent freeform =
|
||||||
FreeformFinSet.convertFinSet((FinSet) component);
|
FreeformFinSet.convertFinSet((FinSet) component);
|
||||||
ComponentConfigDialog.showDialog(freeform);
|
|
||||||
|
List<RocketComponent> listeners = new ArrayList<>();
|
||||||
|
for (RocketComponent listener : component.getConfigListeners()) {
|
||||||
|
if (listener instanceof FinSet) {
|
||||||
|
listeners.add(FreeformFinSet.convertFinSet((FinSet) listener));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ComponentConfigDialog.showDialog(freeform, listeners);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user