com.powsybl.iidm.network.Network.getHvdcLine()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中com.powsybl.iidm.network.Network.getHvdcLine()方法的一些代码示例,展示了Network.getHvdcLine()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.getHvdcLine()方法的具体详情如下:
包路径:com.powsybl.iidm.network.Network
类名称:Network
方法名:getHvdcLine

Network.getHvdcLine介绍

[英]Get an HVDC line.
[中]接通高压直流输电线路。

代码示例

代码示例来源:origin: com.powsybl/powsybl-ampl-converter

private Void readHvdcLine(String[] tokens) {
  int num = Integer.parseInt(tokens[1]);
  String converterMode = tokens[2].replace("\"", "");
  double targetP = readDouble(tokens[3]);
  String id = mapper.getId(AmplSubset.HVDC_LINE, num);
  HvdcLine hl = network.getHvdcLine(id);
  if (hl == null) {
    throw new AmplException("Invalid HvdcLine id '" + id + "'");
  }
  hl.setConvertersMode(ConvertersMode.valueOf(converterMode));
  hl.setActivePowerSetpoint(targetP);
  return null;
}

代码示例来源:origin: com.powsybl/powsybl-iidm-impl

/**
   * Throw a {@link com.powsybl.commons.PowsyblException} if this voltage level contains at least one {@link Branch} or
   * one {@link ThreeWindingsTransformer} or one {@link HvdcConverterStation}.
   */
  static void checkRemovability(VoltageLevel voltageLevel) {
    Network network = voltageLevel.getSubstation().getNetwork();

    for (Connectable connectable : voltageLevel.getConnectables()) {
      ConnectableType type = connectable.getType();
      if (MULTIPLE_TERMINALS_CONNECTABLE_TYPES.contains(type)) {
        // Reject lines, 2WT and 3WT
        throw new AssertionError("The voltage level '" + voltageLevel.getId() + "' cannot be removed because of a remaining " + type);
      } else if ((type == ConnectableType.HVDC_CONVERTER_STATION) && (network.getHvdcLine((HvdcConverterStation) connectable) != null)) {
        // Reject all converter stations connected to a HVDC line
        throw new AssertionError("The voltage level '" + voltageLevel.getId() + "' cannot be removed because of a remaining HVDC line");
      }
    }
  }
}

代码示例来源:origin: com.powsybl/powsybl-iidm-impl

private static void checkRemovability(Substation substation, HvdcConverterStation station) {
  HvdcLine hvdcLine = substation.getNetwork().getHvdcLine(station);
  if (hvdcLine != null) {
    Substation s1 = hvdcLine.getConverterStation1().getTerminal().getVoltageLevel().getSubstation();
    Substation s2 = hvdcLine.getConverterStation2().getTerminal().getVoltageLevel().getSubstation();
    if ((s1 != substation) || (s2 != substation)) {
      throw createIsolationException(substation);
    }
  }
}

相关文章