Search in sources :

Example 1 with Compartment

use of spold2.Compartment in project olca-modules by GreenDelta.

the class EcoSpold2Export method createElemExchange.

private ElementaryExchange createElemExchange(Exchange exchange, UserMasterData masterData) {
    var e2Ex = elemFlowMap.apply(exchange);
    if (e2Ex != null)
        return e2Ex;
    e2Ex = new ElementaryExchange();
    if (exchange.isInput) {
        e2Ex.inputGroup = 4;
    } else {
        e2Ex.outputGroup = 4;
    }
    var flow = exchange.flow;
    e2Ex.flowId = flow.refId;
    e2Ex.formula = flow.formula;
    mapExchangeData(exchange, e2Ex);
    // compartment
    if (flow.category != null) {
        var comp = new Compartment();
        comp.id = flow.category.refId;
        comp.subCompartment = flow.category.name;
        if (flow.category.category != null) {
            comp.compartment = flow.category.category.name;
        }
    }
    Units.map(exchange.unit, e2Ex, masterData);
    MasterData.writeElemFlow(e2Ex, masterData);
    return e2Ex;
}
Also used : ElementaryExchange(spold2.ElementaryExchange) Compartment(spold2.Compartment)

Aggregations

Compartment (spold2.Compartment)1 ElementaryExchange (spold2.ElementaryExchange)1