/** * Factory of the class * * @param id * id of the class RatioTapChanger to create * @return the class created */ public static RatioTapChanger create(final String id) { RatioTapChanger newRatioTapChanger = new RatioTapChanger(); newRatioTapChanger.setId(id); return newRatioTapChanger; }
/** * Utility to "clear" the content of a class when a subset is invalidated * * @param subset subset to clean */ @Override public void clearContent(Subset subset) { // First of all, we clear the associations: this.clearAssociations(subset); switch (subset) { default: // nothing to clear } }
/** * Copy constructor * The associations with other objects are not copied * * @param RatioTapChanger * the reference to the class to copy * @return the class constructed */ private RatioTapChanger(final RatioTapChanger otherRatioTapChanger) { // TODO : check exception safe this.copyBase(otherRatioTapChanger); }
private void createRatioTapChanger(cim1.model.RatioTapChanger rtc, Supplier<RatioTapChangerAdder> transfo, boolean rtcSide1, Map<cim1.model.Terminal, Terminal> terminals) { int lowStep = rtc.getLowStep(); int highStep = rtc.getHighStep(); int neutralStep = rtc.getNeutralStep(); if (neutralStep < lowStep || neutralStep > highStep) { throw new CIM1Exception("Malformed ratio tap changer: neutral step (" LOGGER.debug("RTC at side 2 deviation {}", rtc.getId()); float du = rtc.getStepVoltageIncrement() / 100; double rho = rtcSide1 ? 1 / (1 + n * du) : (1 + n * du); if (rtc.regulatingControlIsSet()) { cim1.model.RegulatingControl rc = rtc.getRegulatingControl(); switch (rc.getMode()) { case voltage: LOGGER.warn("Ratio tap changer '{}' of power transformer '{}'" + " has a bad target voltage {}, switch off regulation", rtc.getId(), transfo.toString(), targetV); regulating = false; targetV = Float.NaN; LOGGER.warn("Ratio tap changer '{}' of power transformer '{}'" + " has an unsupported regulating mode: {}", rtc.getId(), transfo.toString(), rc.getMode());
this.setTransformerWinding(attributeToSet, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); this.setTransformerWinding(attributeToSetFromBoundary, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); errorMessage.append(idTransformerWinding); errorMessage.append("\" in \"RatioTapChanger\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); errorMessage.append(idTransformerWinding); errorMessage.append("\" in \"RatioTapChanger\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); removeFromUnresolved();
message.append(this.getId()); message.append("\" is not consistent in this context:\n");
xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("RatioTapChanger "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); writeClass(xmlsw); super.write(xmlsw, false); errorMessage.append("RatioTapChanger "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); try { xmlsw.writeStartElement(CIMURI.CIMURI, "RatioTapChanger"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("RatioTapChanger "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); writeClass(xmlsw); super.write(xmlsw, subset, false);
RatioTapChanger newRatioTapChanger = new RatioTapChanger(); RatioTapChanger value = entry.getValue(); newRatioTapChanger = value; this.id_RatioTapChanger.put(newRatioTapChanger.getId(), newRatioTapChanger); this.allInstances.put(newRatioTapChanger.getId(), newRatioTapChanger); newMap.put(newRatioTapChanger.getId(), newRatioTapChanger); this.subsetsInstances.put( .put(newRatioTapChanger.getId(), newRatioTapChanger);
message.append(getMessageForConsistency(this.minBitsets.get(subset)));
/** * Utility returning a copy of the "base" of this instance * This utility does not copy the associations with other instances * * @return a clone of this instance */ public RatioTapChanger clone() { RatioTapChanger newInstance = new RatioTapChanger(this); RatioTapChanger newInstanceSP = newInstance; return newInstanceSP; }
errorMessage.append("RatioTapChanger "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e);
message.append(getMessageForConsistency(this.minBitset));
this.idRatioTapChanger = ratioTapChangerAssociation.getId();