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;
}
}
}
Aggregations