@Override public TieLineImpl add() { String id = checkAndGetUniqueId(); VoltageLevelExt voltageLevel1 = checkAndGetVoltageLevel1(); VoltageLevelExt voltageLevel2 = checkAndGetVoltageLevel2(); TerminalExt terminal1 = checkAndGetTerminal1(); TerminalExt terminal2 = checkAndGetTerminal2(); if (ucteXnodeCode == null) { throw new ValidationException(this, "ucteXnodeCode is not set"); } checkHalf(half1, 1); checkHalf(half2, 2); // check that the line is attachable on both side voltageLevel1.attach(terminal1, true); voltageLevel2.attach(terminal2, true); TieLineImpl line = new TieLineImpl(id, getName(), ucteXnodeCode, half1, half2); terminal1.setNum(1); terminal2.setNum(2); line.addTerminal(terminal1); line.addTerminal(terminal2); voltageLevel1.attach(terminal1, false); voltageLevel2.attach(terminal2, false); network.getObjectStore().checkAndAdd(line); return line; }
@Override public LineImpl add() { String id = checkAndGetUniqueId(); VoltageLevelExt voltageLevel1 = checkAndGetVoltageLevel1(); VoltageLevelExt voltageLevel2 = checkAndGetVoltageLevel2(); TerminalExt terminal1 = checkAndGetTerminal1(); TerminalExt terminal2 = checkAndGetTerminal2(); ValidationUtil.checkR(this, r); ValidationUtil.checkX(this, x); ValidationUtil.checkG1(this, g1); ValidationUtil.checkG2(this, g2); ValidationUtil.checkB1(this, b1); ValidationUtil.checkB2(this, b2); // check that the line is attachable on both side voltageLevel1.attach(terminal1, true); voltageLevel2.attach(terminal2, true); LineImpl line = new LineImpl(id, getName(), r, x, g1, b1, g2, b2); terminal1.setNum(1); terminal2.setNum(2); line.addTerminal(terminal1); line.addTerminal(terminal2); voltageLevel1.attach(terminal1, false); voltageLevel2.attach(terminal2, false); network.getObjectStore().checkAndAdd(line); getNetwork().getListeners().notifyCreation(line); return line; }