Skip to content

Conversation

@SiboVG
Copy link
Member

@SiboVG SiboVG commented Dec 16, 2024

Well, this is a bit awkward. Transition (and nose cone) presets that had a <Filled> parameter in the database, even if it was <Filled>false</False>, would always be set to filled, because of loadFromPreset in SymmetricComponent.java:

@Override
protected void loadFromPreset(ComponentPreset preset) {
if (preset.has(ComponentPreset.THICKNESS)) {
	this.thickness = preset.get(ComponentPreset.THICKNESS);
	this.filled = false;
}
if (preset.has(ComponentPreset.FILLED)) {
	this.filled = true;
}

super.loadFromPreset(preset);
}

Which was called in Transition:

@Override
protected void loadFromPreset(ComponentPreset preset) {

  boolean presetFilled = false;
  if (preset.has(ComponentPreset.FILLED)) {
	  presetFilled = preset.get(ComponentPreset.FILLED);
  }

  ...

  super.loadFromPreset(preset);   // This was the issue
  
  fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE);

}

The result: all transition and nose cone presets that had a Filled parameter in the database, which includes not all, but still a fair amount of parts, were incorrectly set to Filled and also had an incorrect mass (if no mass override was set).

The SymmetricComponent should have checked the value of the Filled parameter (which can be false). I have not found any component presets that did not explicitly define a true or false Filled value, so I'm not sure where the original code originates from.

Together with this PR fixes #2614 and fixes #2480.

@JoePfeiffer JoePfeiffer merged commit c0dfbc0 into openrocket:unstable Dec 18, 2024
1 check passed
@SiboVG SiboVG deleted the issue-2614 branch March 9, 2025 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Incorrect default nose cone weights Parts library error: plastic nose cone shown as "filled"

2 participants