/** * Factory of the class * * @param id * id of the class EnergyConsumer to create * @return the class created */ public static EnergyConsumer create(final String id) { EnergyConsumer newEnergyConsumer = new EnergyConsumer(); newEnergyConsumer.setId(id); return newEnergyConsumer; }
/** * 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 EnergyConsumer * the reference to the class to copy * @return the class constructed */ private EnergyConsumer(final EnergyConsumer otherEnergyConsumer) { // TODO : check exception safe this.copyBase(otherEnergyConsumer); }
this.setLoadResponse(attributeToSet, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); this.setLoadResponse(attributeToSetFromBoundary, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); errorMessage.append(idLoadResponse); errorMessage.append("\" in \"EnergyConsumer\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); errorMessage.append(idLoadResponse); errorMessage.append("\" in \"EnergyConsumer\" 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("EnergyConsumer "); 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("EnergyConsumer "); 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, "EnergyConsumer"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("EnergyConsumer "); 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);
private void createLoad(VoltageLevel voltageLevel, cim1.model.EnergyConsumer ec) { cim1.model.Terminal t = ec.getTerminals().get(0); cim1.model.TopologicalNode tn = t.getTopologicalNode(); q = svpf.getQ(); } else { LOGGER.warn("No active and reactive power value for load {}", ec.getId()); LoadType loadType = ec.getId().contains("fict") ? LoadType.FICTITIOUS : LoadType.UNDEFINED;
EnergyConsumer newEnergyConsumer = new EnergyConsumer(); EnergyConsumer value = entry.getValue(); newEnergyConsumer = value; this.id_EnergyConsumer.put(newEnergyConsumer.getId(), newEnergyConsumer); this.allInstances.put(newEnergyConsumer.getId(), newEnergyConsumer); newMap.put(newEnergyConsumer.getId(), newEnergyConsumer); this.subsetsInstances.put( .put(newEnergyConsumer.getId(), newEnergyConsumer);
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 EnergyConsumer clone() { EnergyConsumer newInstance = new EnergyConsumer(this); EnergyConsumer newInstanceSP = newInstance; return newInstanceSP; }
/** * 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 otherEnergyConsumer * the instance to copy */ public void copyBase(final EnergyConsumer otherEnergyConsumer) { // 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 (otherEnergyConsumer.currentBitset.get(0)) { LoadResponseCharacteristic loadResponseAssociation = otherEnergyConsumer.getLoadResponse(); //this.idLoadResponse = (loadResponseAssociation != null) ? loadResponseAssociation.getId() : ""; if (loadResponseAssociation != null) { this.idLoadResponse = loadResponseAssociation.getId(); // the proper bit will be set when the setter is called } else { this.idLoadResponse = ""; } } // TODO : Call the parent copy constructor instead ? super.copyBase(otherEnergyConsumer); }
float q0 = 0; if (ec2 != null) { cim1.model.Terminal ect2 = ec2.getTerminals().get(0); cim1.model.SvPowerFlow ect2svpf = ect2.getSvPowerFlow(); ect2isConnected = ect2.isConnected();
errorMessage.append("EnergyConsumer "); 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));
xmlsw.writeEmptyElement(CIMURI.CIMURI,"LoadResponseCharacteristic.EnergyConsumer"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + energyConsumer.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder(