/** * Factory of the class * * @param id * id of the class OperationalLimitSet to create * @return the class created */ public static OperationalLimitSet create(final String id) { OperationalLimitSet newOperationalLimitSet = new OperationalLimitSet(); newOperationalLimitSet.setId(id); return newOperationalLimitSet; }
/** * Utility to set the "operationalLimitSetValue" * * @param operationalLimitSetValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setOperationalLimitSet( OperationalLimitSet operationalLimitSetValue, boolean setInverse) throws LinkageException { this.operationalLimitSet = operationalLimitSetValue; this.currentBitset.set(0); if (setInverse) { if (operationalLimitSetValue != null) { operationalLimitSetValue.addOperationalLimitValue(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 } }
message.append(this.getId()); message.append("\" is not consistent in this context:\n");
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 \"OperationalLimitSet\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); errorMessage.append(idTerminal); errorMessage.append("\" in \"OperationalLimitSet\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); removeFromUnresolved();
if (t.getOperationalLimitSet() != null) { for (cim1.model.OperationalLimitSet ols : t.getOperationalLimitSet()) { if (ols.getOperationalLimitValue() == null) { noOperationalLimitInOperationalLimitSet.add(ols.getId()); continue; for (cim1.model.OperationalLimit ol : ols.getOperationalLimitValue()) { cim1.model.OperationalLimitType olt = ol.getOperationalLimitType(); float value;
xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("OperationalLimitSet "); 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("OperationalLimitSet "); 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, "OperationalLimitSet"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("OperationalLimitSet "); 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);
OperationalLimitSet newOperationalLimitSet = new OperationalLimitSet(); OperationalLimitSet value = entry.getValue(); newOperationalLimitSet = value; this.id_OperationalLimitSet.put(newOperationalLimitSet.getId(), newOperationalLimitSet); this.allInstances.put(newOperationalLimitSet.getId(), newOperationalLimitSet); newMap.put(newOperationalLimitSet.getId(), newOperationalLimitSet); this.subsetsInstances.put( .put(newOperationalLimitSet.getId(), newOperationalLimitSet);
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 OperationalLimitSet clone() { OperationalLimitSet newInstance = new OperationalLimitSet(this); OperationalLimitSet newInstanceSP = newInstance; return newInstanceSP; }
/** * Copy constructor * The associations with other objects are not copied * * @param OperationalLimitSet * the reference to the class to copy * @return the class constructed */ private OperationalLimitSet(final OperationalLimitSet otherOperationalLimitSet) { // TODO : check exception safe this.copyBase(otherOperationalLimitSet); }
/** * 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 otherOperationalLimitSet * the instance to copy */ public void copyBase(final OperationalLimitSet otherOperationalLimitSet) { // 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 (otherOperationalLimitSet.currentBitset.get(1)) { Terminal terminalAssociation = otherOperationalLimitSet.getTerminal(); //this.idTerminal = (terminalAssociation != null) ? terminalAssociation.getId() : ""; if (terminalAssociation != null) { this.idTerminal = terminalAssociation.getId(); // the proper bit will be set when the setter is called } else { this.idTerminal = ""; } } // TODO : Call the parent copy constructor instead ? super.copyBase(otherOperationalLimitSet); }
errorMessage.append("OperationalLimitSet "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); errorMessage.append("OperationalLimitSet "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e);
boolean foundCurrentLimits = false; for (cim1.model.OperationalLimitSet ols : t.getOperationalLimitSet()) { if (ols.getOperationalLimitValue() == null) { noOperationalLimitInOperationalLimitSet.add(ols.getId()); continue; for (cim1.model.OperationalLimit ol : ols.getOperationalLimitValue()) { cim1.model.OperationalLimitType olt = ol.getOperationalLimitType(); if (ol instanceof cim1.model.CurrentLimit) { float value = ((cim1.model.CurrentLimit) ol).getValue(); if (value <= 0) { LOGGER.warn("Invalid current limit {} for {}", value, ols.getId()); } else { foundCurrentLimits = true;
message.append(getMessageForConsistency(this.minBitset));
xmlsw.writeEmptyElement(CIMURI.CIMURI,"Terminal.OperationalLimitSet"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + operationalLimitSet.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder(
this.idOperationalLimitSet = operationalLimitSetAssociation.getId();
xmlsw.writeEmptyElement(CIMURI.CIMURI,"Terminal.OperationalLimitSet"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + operationalLimitSet.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder(