@Override public PhaseTapChangerImpl setRegulationMode(RegulationMode regulationMode) { ValidationUtil.checkPhaseTapChangerRegulation(parent, regulationMode, getRegulationValue(), isRegulating(), getRegulationTerminal(), getNetwork()); this.regulationMode = regulationMode; return this; }
@Override public PhaseTapChangerImpl setRegulationTerminal(Terminal regulationTerminal) { ValidationUtil.checkPhaseTapChangerRegulation(parent, regulationMode, getRegulationValue(), isRegulating(), regulationTerminal, getNetwork()); return super.setRegulationTerminal(regulationTerminal); }
@Override public PhaseTapChangerImpl setRegulationValue(double regulationValue) { ValidationUtil.checkPhaseTapChangerRegulation(parent, regulationMode, regulationValue, isRegulating(), getRegulationTerminal(), getNetwork()); this.regulationValue.set(network.get().getVariantIndex(), regulationValue); return this; }
@Override public void allocateVariantArrayElement(int[] indexes, int sourceIndex) { super.allocateVariantArrayElement(indexes, sourceIndex); if (ratioTapChanger != null) { ratioTapChanger.allocateVariantArrayElement(indexes, sourceIndex); } if (phaseTapChanger != null) { phaseTapChanger.allocateVariantArrayElement(indexes, sourceIndex); } }
@Override public void deleteVariantArrayElement(int index) { super.deleteVariantArrayElement(index); if (ratioTapChanger != null) { ratioTapChanger.deleteVariantArrayElement(index); } if (phaseTapChanger != null) { phaseTapChanger.deleteVariantArrayElement(index); } }
@Override public void extendVariantArraySize(int initVariantArraySize, int number, int sourceIndex) { super.extendVariantArraySize(initVariantArraySize, number, sourceIndex); if (ratioTapChanger != null) { ratioTapChanger.extendVariantArraySize(initVariantArraySize, number, sourceIndex); } if (phaseTapChanger != null) { phaseTapChanger.extendVariantArraySize(initVariantArraySize, number, sourceIndex); } }
@Override public void reduceVariantArraySize(int number) { super.reduceVariantArraySize(number); if (ratioTapChanger != null) { ratioTapChanger.reduceVariantArraySize(number); } if (phaseTapChanger != null) { phaseTapChanger.reduceVariantArraySize(number); } }
@Override public PhaseTapChanger add() { if (tapPosition == null) { throw new ValidationException(transformer, "tap position is not set"); } if (steps.isEmpty()) { throw new ValidationException(transformer, "a phase tap changer shall have at least one step"); } int highTapPosition = lowTapPosition + steps.size() - 1; if (tapPosition < lowTapPosition || tapPosition > highTapPosition) { throw new ValidationException(transformer, "incorrect tap position " + tapPosition + " [" + lowTapPosition + ", " + highTapPosition + "]"); } ValidationUtil.checkPhaseTapChangerRegulation(transformer, regulationMode, regulationValue, regulating, regulationTerminal, getNetwork()); PhaseTapChangerImpl tapChanger = new PhaseTapChangerImpl(transformer, lowTapPosition, steps, regulationTerminal, tapPosition, regulating, regulationMode, regulationValue); transformer.setPhaseTapChanger(tapChanger); return tapChanger; }