Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing invalidateCache in N/B Voltage Level #318

Open
sebalaig opened this issue May 4, 2021 · 0 comments · Fixed by #319
Open

Add missing invalidateCache in N/B Voltage Level #318

sebalaig opened this issue May 4, 2021 · 0 comments · Fixed by #319
Labels
bug Something isn't working

Comments

@sebalaig
Copy link
Contributor

sebalaig commented May 4, 2021

powsybl::iidm::Network network("test", "test");
        powsybl::iidm::Substation& substation = network.newSubstation()
                                                 .setId("S1")
                                                 .setCountry(powsybl::iidm::Country::FR)
                                                 .setTso("TSO")
                                                 .add();
        powsybl::iidm::VoltageLevel& vl1 = substation.newVoltageLevel()
                                             .setId("VL1")
                                             .setTopologyKind(powsybl::iidm::TopologyKind::NODE_BREAKER)
                                             .setNominalV(90.0)
                                             .setLowVoltageLimit(88.0)
                                             .setHighVoltageLimit(96.0)
                                             .add();

        powsybl::iidm::BusbarSection& bbs1 = vl1.getNodeBreakerView().newBusbarSection()
                                                                     .setId("BBS1")
                                                                     .setName("BBS1_NAME")
                                                                     .setNode(0)
                                                                     .add();

      const auto& bus1 = bbs1.getTerminal().getBusView().getBus();
      if (bus1) {
        bus1.get().setV(3).setAngle(4);
      }
      else {
        std::cerr << "bus1 is null" << std::endl;
      }

      powsybl::iidm::BusbarSection& bbs2 = vl1.getNodeBreakerView().newBusbarSection()
                                                                   .setId("BBS2")
                                                                   .setName("BBS2_NAME")
                                                                   .setNode(1)
                                                                   .add();

      const auto& bus2 = bbs2.getTerminal().getBusView().getBus();  // <-- crash here
      if (bus2) {
        bus2.get().setV(3).setAngle(4);
      }
      else {
        std::cerr << "bus2 is null" << std::endl;
      }
  • What is the expected behavior?

  • What is the motivation / use case for changing the behavior?

  • Please tell us about your environment:

    • PowSyBl Version: ...
    • OS Version: ...
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, spectrum, etc)

(if a question doesn't apply, you can delete it)

@sebalaig sebalaig changed the title https://github.com/powsybl/powsybl-core/pull/1710 Add missing invalidateCache in N/B Voltage Level May 4, 2021
@sebalaig sebalaig added the bug Something isn't working label May 6, 2021
sebalaig added a commit that referenced this issue May 6, 2021
@sebalaig sebalaig linked a pull request May 6, 2021 that will close this issue
5 tasks
mathbagu pushed a commit that referenced this issue May 31, 2021
mathbagu pushed a commit that referenced this issue Nov 30, 2021
mathbagu pushed a commit that referenced this issue Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant