Skip to content

Conversation

Mathieu-Deharbe
Copy link
Contributor

No description provided.

}
case TRANSIENT_REACTANCE -> modifyGeneratorShortCircuitAttributes(
new AttributeModification<>(Double.parseDouble(newValue), OperationType.SET),
new AttributeModification<>(newValue != null ? Double.parseDouble(newValue) : Double.NaN, OperationType.SET),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you should use Unset instead ? And change AttributeModification behavior for double to return NaN

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds like a good idea but it quickly gets complicated and dangerous for one week before the MVP si I prefer not to.
image

Copy link
Contributor

@basseche basseche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Group issues :

  • Unsetting Transient reactance on Generator does not seems to work.
  • Crash if you change Transient reactance and Transformer reactance in the same time.

.withStepUpTransformerX(stepUpTransformerX.getValue())
.add();
if (Double.isNaN(directTransX.getValue()) && Double.isNaN(stepUpTransformerX.getValue())) {
generator.removeExtension(GeneratorShortCircuit.class);
Copy link
Contributor

@basseche basseche Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should not remove extension because extension contains 2 values, remove extension only if 2 values are empty. You should only remove the concerned value. And also check if the extension is present, as when it is not present this will produce an exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the possibility to remove transient reactance (because it is impossible). So that part has been removed : aa8b2ca

directTransXNewValue = NO_VALUE;
stepUpTransformerXNewValue = NO_VALUE;
} else {
generator.newExtension(GeneratorShortCircuitAdder.class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is now impossible to remove an extension through filter modification : aa8b2ca

Signed-off-by: Mathieu DEHARBE <[email protected]>
Copy link

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.

3 participants