* @return whether any motors are defined for it.
*/
public boolean hasMotors(String id) {
+ if (id == null)
+ return false;
+
Iterator<RocketComponent> iterator = this.deepIterator();
while (iterator.hasNext()) {
RocketComponent c = iterator.next();
* @return the configuration name
*/
public String getMotorConfigurationName(String id) {
+ if (!isMotorConfigurationID(id))
+ return "";
String s = motorConfigurationNames.get(id);
if (s == null)
return "";
fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE);
}
-
+
/**
* Return either the motor configuration name (if set) or its description.
*
public String getMotorConfigurationNameOrDescription(String id) {
String name;
- name = motorConfigurationNames.get(id);
+ name = getMotorConfigurationName(id);
if (name != null && !name.equals(""))
return name;
-
+
return getMotorConfigurationDescription(id);
}
String name;
int motorCount = 0;
- if (!motorConfigurationIDs.contains(id)) {
- throw new IllegalArgumentException("Motor configuration ID does not exist: "+id);
- }
-
// Generate the description
// First iterate over each stage and store the designations of each motor