/** * Factory of the class * * @param id * id of the class ReactiveCapabilityCurve to create * @return the class created */ public static ReactiveCapabilityCurve create(final String id) { ReactiveCapabilityCurve newReactiveCapabilityCurve = new ReactiveCapabilityCurve(); newReactiveCapabilityCurve.setId(id); return newReactiveCapabilityCurve; }
/** * Utility to set the "initialReactiveCapabilityCurveValue" * * @param initialReactiveCapabilityCurveValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setInitialReactiveCapabilityCurve( ReactiveCapabilityCurve initialReactiveCapabilityCurveValue, boolean setInverse) throws LinkageException { this.initialReactiveCapabilityCurve = initialReactiveCapabilityCurveValue; this.currentBitset.set(13); if (setInverse) { if (initialReactiveCapabilityCurveValue != null) { initialReactiveCapabilityCurveValue.addInitiallyUsedBySynchronousMachine(this, false); } } }
/** * 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 } }
xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("ReactiveCapabilityCurve "); 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("ReactiveCapabilityCurve "); 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, "ReactiveCapabilityCurve"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("ReactiveCapabilityCurve "); 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);
ReactiveCapabilityCurve attributeToSetFromBoundary = boundaryModel.searchReactiveCapabilityCurve(idInitialReactiveCapabilityCurve); if(attributeToSetFromBoundary != null) { attributeToSetFromBoundary.setFromBoundary(true); try { model.createReactiveCapabilityCurve(idInitialReactiveCapabilityCurve, attributeToSetFromBoundary); throw new LinkageException(e.getMessage()); attributeToSetFromBoundary.resolveLinks(model, boundaryModel); } else { StringBuilder errorMessage = new StringBuilder(
this.currentSubsetSet = other.isCurrentSubsetSet(); this.loadedSubsets = other.getLoadedSubsets(); ReactiveCapabilityCurve newReactiveCapabilityCurve = new ReactiveCapabilityCurve(); ReactiveCapabilityCurve value = entry.getValue(); newReactiveCapabilityCurve = value; this.id_ReactiveCapabilityCurve.put(newReactiveCapabilityCurve.getId(), newReactiveCapabilityCurve); this.allInstances.put(newReactiveCapabilityCurve.getId(), newReactiveCapabilityCurve); newMap.put(newReactiveCapabilityCurve.getId(), newReactiveCapabilityCurve); this.subsetsInstances.put( .put(newReactiveCapabilityCurve.getId(), newReactiveCapabilityCurve);
/** * Utility to return the content of this class into the CIM XML format * * @param xmlsw * the stream in which are stored the elements to write */ private void writeClass(XMLStreamWriter xmlsw) { if (currentBitset.get(0)) { for (SynchronousMachine initiallyUsedBySynchronousMachine : this.initiallyUsedBySynchronousMachine){ try { xmlsw.writeEmptyElement(CIMURI.CIMURI,"ReactiveCapabilityCurve.InitiallyUsedBySynchronousMachine"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + initiallyUsedBySynchronousMachine.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder( "Error while trying to write the reference to "); errorMessage.append("ReactiveCapabilityCurve "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); } } } return; }
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 ReactiveCapabilityCurve clone() { ReactiveCapabilityCurve newInstance = new ReactiveCapabilityCurve(this); ReactiveCapabilityCurve newInstanceSP = newInstance; return newInstanceSP; }
/** * Copy constructor * The associations with other objects are not copied * * @param ReactiveCapabilityCurve * the reference to the class to copy * @return the class constructed */ private ReactiveCapabilityCurve(final ReactiveCapabilityCurve otherReactiveCapabilityCurve) { // TODO : check exception safe this.copyBase(otherReactiveCapabilityCurve); }
/** * Utility to resolve the links at the end of parsing * * @param model * the model this class belongs to * @param boundaryModel * the model that gather data about the boundarySet, used * as a resource force links resolving * @throws Linkage Exception */ @Override public void resolveLinks(CIMModel model, CIMModel boundaryModel) throws LinkageException { // TODO : implement vectors (not required according to CIM // specifications) super.resolveLinks(model, boundaryModel); removeFromUnresolved(); }
private void createReactiveCapabilityCurve(Generator generator, cim1.model.SynchronousMachine sm, List<String> synchronousMachinesWithReactiveRangeForMinus9999MW) { if (sm.initialReactiveCapabilityCurveIsSet()) { Map<Float, cim1.model.CurveData> cdMap = new HashMap<>(); for (cim1.model.CurveData cd : sm.initialReactiveCapabilityCurve.getCurveScheduleDatas()) { if (cdMap.containsKey(cd.getXvalue())) { LOGGER.warn("Duplicated data for x value {} of {} reactive capability curve",
message.append(this.getId()); message.append("\" is not consistent in this context:\n");
message.append(getMessageForConsistency(this.minBitset));
this.idInitialReactiveCapabilityCurve = initialReactiveCapabilityCurveAssociation.getId();