newdiscrete = otherRegulatingControl.isDiscrete(); this.setDiscrete(newdiscrete); newtargetRange = otherRegulatingControl.getTargetRange(); this.setTargetRange(newtargetRange); newmode = otherRegulatingControl.getMode(); this.setMode(newmode); newtargetValue = otherRegulatingControl.getTargetValue(); this.setTargetValue(newtargetValue); Terminal terminalAssociation = otherRegulatingControl.getTerminal();
/** * Factory of the class * * @param id * id of the class RegulatingControl to create * @return the class created */ public static RegulatingControl create(final String id) { RegulatingControl newRegulatingControl = new RegulatingControl(); newRegulatingControl.setId(id); return newRegulatingControl; }
/** * Utility to set the "regulatingControlValue" * * @param regulatingControlValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setRegulatingControl( RegulatingControl regulatingControlValue, boolean setInverse) throws LinkageException { this.regulatingControl = regulatingControlValue; this.currentBitset.set(0); if (setInverse) { if (regulatingControlValue != null) { regulatingControlValue.addRegulatingCondEq(this, false); } } }
switch (rc.getMode()) { case voltage: boolean regulating = true; float targetV = rc.getTargetValue(); if (targetV <= 0) { LOGGER.warn("Ratio tap changer '{}' of power transformer '{}'" + if (rc.getTerminal() == e.getKey()) { regulationTerminal = e.getValue(); regulationTerminal = getTerminalMapping(rc.getTerminal().getTopologicalNode()); LOGGER.warn("Ratio tap changer '{}' of power transformer '{}'" + " has an unsupported regulating mode: {}", rtc.getId(), transfo.toString(), rc.getMode());
errorMessage.append("RegulatingControl "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); xmlsw.writeCharacters(String.valueOf(isDiscrete())); xmlsw.writeEndElement(); errorMessage.append("RegulatingControl "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); errorMessage.append("RegulatingControl "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); xmlsw.writeCharacters(String.valueOf(getTargetRange())); xmlsw.writeEndElement(); errorMessage.append("RegulatingControl "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e);
this.setTerminal(attributeToSet, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); this.setTerminal(attributeToSetFromBoundary, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); errorMessage.append(idTerminal); errorMessage.append("\" in \"RegulatingControl\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); errorMessage.append(idTerminal); errorMessage.append("\" in \"RegulatingControl\" 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("RegulatingControl "); 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("RegulatingControl "); 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, "RegulatingControl"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("RegulatingControl "); 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);
RegulatingControl newRegulatingControl = new RegulatingControl(); RegulatingControl value = entry.getValue(); newRegulatingControl = value; this.id_RegulatingControl.put(newRegulatingControl.getId(), newRegulatingControl); this.allInstances.put(newRegulatingControl.getId(), newRegulatingControl); newMap.put(newRegulatingControl.getId(), newRegulatingControl); this.subsetsInstances.put( .put(newRegulatingControl.getId(), newRegulatingControl);
/** * 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 RegulatingControl clone() { RegulatingControl newInstance = new RegulatingControl(this); RegulatingControl newInstanceSP = newInstance; return newInstanceSP; }
/** * Copy constructor * The associations with other objects are not copied * * @param RegulatingControl * the reference to the class to copy * @return the class constructed */ private RegulatingControl(final RegulatingControl otherRegulatingControl) { // TODO : check exception safe this.copyBase(otherRegulatingControl); }
/** * 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 } }
/** * Utility to set the "regulatingControlValue" * * @param regulatingControlValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setRegulatingControl( RegulatingControl regulatingControlValue, boolean setInverse) throws LinkageException { this.regulatingControl = regulatingControlValue; this.currentBitset.set(3); if (setInverse) { if (regulatingControlValue != null) { regulatingControlValue.addTapChanger(this, false); } } }
switch (rc.getMode()) { case currentFlow: Terminal regulationTerminal; if (rc.getTerminal() == t1) { regulationTerminal = transfo.getTerminal1(); } else if (rc.getTerminal() == t2) { regulationTerminal = transfo.getTerminal2(); } else { regulationTerminal = getTerminalMapping(rc.getTerminal().getTopologicalNode()); .setRegulationValue(rc.getTargetValue()) .setRegulating(true) .setRegulationTerminal(regulationTerminal); LOGGER.warn("Phase tap changer '{}' of power transformer '{}'" + " has an unsupported regulating mode: {}", ptc.getId(), transfo.getId(), rc.getMode());
/** * Utility to copy the "base" of an other instance of the same class * This utility does not copy the associations with other instances from * the instance to copy * * @param otherRegulatingCondEq * the instance to copy */ public void copyBase(final RegulatingCondEq otherRegulatingCondEq) { // Memory allocation has done successfully ! // Dropping "old" objects... // This part may change : we do nothing to allow the user to access // object by their id from the global model. if (otherRegulatingCondEq.currentBitset.get(0)) { RegulatingControl regulatingControlAssociation = otherRegulatingCondEq.getRegulatingControl(); //this.idRegulatingControl = (regulatingControlAssociation != null) ? regulatingControlAssociation.getId() : ""; if (regulatingControlAssociation != null) { this.idRegulatingControl = regulatingControlAssociation.getId(); // the proper bit will be set when the setter is called } else { this.idRegulatingControl = ""; } } // TODO : Call the parent copy constructor instead ? super.copyBase(otherRegulatingCondEq); }
cim1.model.RegulatingControl rc = sm.getRegulatingControl(); if (rc != null) { if (rc.getMode() == cim1.model.RegulatingControlModeKind.voltage) { voltageRegulatorOn = true; targetV = rc.getTargetValue(); if (targetV == 0) { targetV = voltageLevel.getNominalV(); synchronousMachinesRegulatingVoltageWithZeroTargetVoltage.add(namingStrategy.getId(sm)); } else if (rc.getMode() == cim1.model.RegulatingControlModeKind.reactivePower) { targetQ = rc.getTargetValue(); } else { LOGGER.warn("Incorrect regulating control mode {} for synchronous machine {}", rc.getMode(), sm.getId()); if (rc.getTerminal() != t) { regulatingTerminal = getTerminalMapping(rc.getTerminal().getTopologicalNode());
xmlsw.writeEmptyElement(CIMURI.CIMURI,"Terminal.RegulatingControl"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + regulatingControl.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder(
xmlsw.writeEmptyElement(CIMURI.CIMURI,"Terminal.RegulatingControl"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + regulatingControl.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder(