Search in sources :

Example 11 with IntermediateExchange

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

the class EcoSpold2Export method createIntermediateExchange.

private IntermediateExchange createIntermediateExchange(Exchange exchange, Process process, UserMasterData masterData) {
    IntermediateExchange e2Ex = new IntermediateExchange();
    if (exchange.isInput)
        e2Ex.inputGroup = 5;
    else {
        if (Objects.equals(exchange, process.quantitativeReference))
            e2Ex.outputGroup = 0;
        else if (exchange.flow.flowType == FlowType.WASTE_FLOW)
            e2Ex.outputGroup = 3;
        else
            e2Ex.outputGroup = 2;
    }
    e2Ex.flowId = exchange.flow.refId;
    ProcessDescriptor provider = getDefaultProvider(exchange);
    if (provider != null)
        e2Ex.activityLinkId = provider.refId;
    mapExchangeData(exchange, e2Ex);
    Units.map(exchange.unit, e2Ex, masterData);
    MasterData.writeTechFlow(e2Ex, masterData);
    return e2Ex;
}
Also used : IntermediateExchange(spold2.IntermediateExchange) ProcessDescriptor(org.openlca.core.model.descriptors.ProcessDescriptor)

Example 12 with IntermediateExchange

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

the class MasterData method writeTechFlow.

public static void writeTechFlow(IntermediateExchange techFlow, UserMasterData masterData) {
    IntermediateExchange masterFlow = new IntermediateExchange();
    masterData.intermediateExchanges.add(masterFlow);
    // !
    masterFlow.id = techFlow.flowId;
    masterFlow.unitId = techFlow.unitId;
    masterFlow.name = techFlow.name;
    masterFlow.unit = techFlow.unit;
}
Also used : IntermediateExchange(spold2.IntermediateExchange)

Aggregations

IntermediateExchange (spold2.IntermediateExchange)9 Activity (spold2.Activity)3 ElementaryExchange (spold2.ElementaryExchange)3 Exchange (org.openlca.core.model.Exchange)2 Flow (org.openlca.core.model.Flow)2 Property (spold2.Property)2 ProcessDescriptor (org.openlca.core.model.descriptors.ProcessDescriptor)1 Classification (spold2.Classification)1 Exchange (spold2.Exchange)1 FlowData (spold2.FlowData)1 Representativeness (spold2.Representativeness)1 UserMasterData (spold2.UserMasterData)1