use of org.openlca.ecospold.IExchange in project olca-modules by GreenDelta.
the class MethodConverter method mapLCIAFactor.
private IExchange mapLCIAFactor(ImpactFactor factor) {
IExchange exchange = factory.createExchange();
Flow flow = factor.flow;
exchange.setNumber((int) flow.id);
Categories.map(factor.flow.category, exchange, config);
Util.mapFlowInformation(exchange, factor.flow);
exchange.setUnit(factor.unit.name);
exchange.setName(factor.flow.name);
exchange.setMeanValue(factor.value);
return exchange;
}
use of org.openlca.ecospold.IExchange in project olca-modules by GreenDelta.
the class ProcessConverter method mapExchange.
private IExchange mapExchange(Exchange inExchange) {
IExchange exchange = factory.createExchange();
Flow flow = inExchange.flow;
exchange.setNumber((int) flow.id);
exchange.setName(inExchange.flow.name);
if (inExchange.isInput) {
exchange.setInputGroup(mapFlowType(flow.flowType, true));
} else {
exchange.setOutputGroup(mapFlowType(flow.flowType, false));
}
Categories.map(flow.category, exchange, config);
Util.mapFlowInformation(exchange, inExchange.flow);
if (inExchange.unit != null) {
exchange.setUnit(inExchange.unit.name);
}
if (inExchange.uncertainty == null) {
exchange.setMeanValue(inExchange.amount);
} else {
mapUncertainty(inExchange, exchange);
}
mapComment(inExchange, exchange);
return exchange;
}
use of org.openlca.ecospold.IExchange in project olca-modules by GreenDelta.
the class ProcessConverter method mapExchanges.
private void mapExchanges(DataSet dataSet) {
Exchange qRef = process.quantitativeReference;
for (Exchange exchange : process.exchanges) {
IExchange iExchange = mapExchange(exchange);
dataSet.getExchanges().add(iExchange);
if (Objects.equals(exchange, qRef)) {
mapRefFlow(dataSet, exchange, iExchange);
}
}
}
use of org.openlca.ecospold.IExchange in project olca-modules by GreenDelta.
the class EcoSpold01Import method mapExchanges.
private void mapExchanges(List<IExchange> inExchanges, Process ioProcess) {
for (IExchange inExchange : inExchanges) {
FlowBucket flow = flowImport.handleProcessExchange(inExchange);
if (flow == null || !flow.isValid()) {
log.error("Could not import flow: " + inExchange);
continue;
}
Exchange outExchange = ioProcess.add(Exchange.of(flow.flow, flow.flowProperty, flow.unit));
outExchange.isInput = inExchange.getInputGroup() != null;
ExchangeAmount exchangeAmount = new ExchangeAmount(outExchange, inExchange);
outExchange.description = inExchange.getGeneralComment();
exchangeAmount.map(flow.conversionFactor);
localExchangeCache.put(inExchange.getNumber(), outExchange);
if (ioProcess.quantitativeReference == null && inExchange.getOutputGroup() != null && (inExchange.getOutputGroup() == 0 || inExchange.getOutputGroup() == 2)) {
ioProcess.quantitativeReference = outExchange;
}
}
}
use of org.openlca.ecospold.IExchange in project olca-modules by GreenDelta.
the class EcoSpold01Import method mapFactors.
private void mapFactors(List<IExchange> inFactors, ImpactCategory ioCategory) {
for (IExchange inFactor : inFactors) {
FlowBucket flow = flowImport.handleImpactFactor(inFactor);
if (flow == null || !flow.isValid()) {
log.error("Could not import flow: " + inFactor);
continue;
}
ImpactFactor factor = new ImpactFactor();
factor.flow = flow.flow;
factor.flowPropertyFactor = flow.flow.getFactor(flow.flowProperty);
factor.unit = flow.unit;
factor.value = flow.conversionFactor * inFactor.getMeanValue();
ioCategory.impactFactors.add(factor);
}
}
Aggregations