Search in sources :

Example 1 with LCIMethod

use of org.openlca.ilcd.flows.LCIMethod in project olca-modules by GreenDelta.

the class FlowExtensions method getMethodExtension.

private static Other getMethodExtension(Flow flow, boolean create) {
    Modelling mav = flow.modelling;
    if (mav == null) {
        if (!create)
            return null;
        mav = new Modelling();
        flow.modelling = mav;
    }
    LCIMethod method = mav.lciMethod;
    if (method == null) {
        if (!create)
            return null;
        method = new LCIMethod();
        mav.lciMethod = method;
    }
    Other other = method.other;
    if (other == null && create) {
        other = new Other();
        method.other = other;
    }
    return other;
}
Also used : LCIMethod(org.openlca.ilcd.flows.LCIMethod) Modelling(org.openlca.ilcd.flows.Modelling) Other(org.openlca.ilcd.commons.Other)

Example 2 with LCIMethod

use of org.openlca.ilcd.flows.LCIMethod in project olca-modules by GreenDelta.

the class FlowExport method makeModellingInfo.

private Modelling makeModellingInfo() {
    Modelling mav = new Modelling();
    LCIMethod method = new LCIMethod();
    mav.lciMethod = method;
    method.flowType = getFlowType();
    return mav;
}
Also used : LCIMethod(org.openlca.ilcd.flows.LCIMethod) Modelling(org.openlca.ilcd.flows.Modelling)

Example 3 with LCIMethod

use of org.openlca.ilcd.flows.LCIMethod in project olca-modules by GreenDelta.

the class FlowUpdateTest method makeFlow.

private Flow makeFlow(String id) {
    Flow flow = new Flow();
    FlowInfo info = new FlowInfo();
    flow.flowInfo = info;
    DataSetInfo dataInfo = new DataSetInfo();
    dataInfo.uuid = id;
    info.dataSetInfo = dataInfo;
    FlowName name = new FlowName();
    dataInfo.name = name;
    LangString.set(name.baseName, "test flow - " + id, "en");
    AdminInfo adminInfo = new AdminInfo();
    Publication pub = new Publication();
    adminInfo.publication = pub;
    pub.version = "01.00.000";
    flow.adminInfo = adminInfo;
    Modelling mav = new Modelling();
    flow.modelling = mav;
    LCIMethod method = new LCIMethod();
    mav.lciMethod = method;
    method.flowType = FlowType.ELEMENTARY_FLOW;
    return flow;
}
Also used : FlowInfo(org.openlca.ilcd.flows.FlowInfo) LCIMethod(org.openlca.ilcd.flows.LCIMethod) FlowName(org.openlca.ilcd.flows.FlowName) AdminInfo(org.openlca.ilcd.flows.AdminInfo) Publication(org.openlca.ilcd.commons.Publication) Modelling(org.openlca.ilcd.flows.Modelling) DataSetInfo(org.openlca.ilcd.flows.DataSetInfo) Flow(org.openlca.ilcd.flows.Flow)

Example 4 with LCIMethod

use of org.openlca.ilcd.flows.LCIMethod in project olca-modules by GreenDelta.

the class NetworkPutFlowTest method testPutFlow.

@Test
public void testPutFlow() throws Exception {
    Assume.assumeTrue(TestServer.isAvailable());
    String id = UUID.randomUUID().toString();
    Flow flow = new Flow();
    FlowInfo info = new FlowInfo();
    flow.flowInfo = info;
    info.dataSetInfo = makeDataInfo(id);
    flow.adminInfo = makeAdminInfo();
    Modelling mav = new Modelling();
    flow.modelling = mav;
    LCIMethod method = new LCIMethod();
    mav.lciMethod = method;
    method.flowType = FlowType.ELEMENTARY_FLOW;
    client.put(flow);
}
Also used : FlowInfo(org.openlca.ilcd.flows.FlowInfo) LCIMethod(org.openlca.ilcd.flows.LCIMethod) Modelling(org.openlca.ilcd.flows.Modelling) LangString(org.openlca.ilcd.commons.LangString) Flow(org.openlca.ilcd.flows.Flow) Test(org.junit.Test)

Aggregations

LCIMethod (org.openlca.ilcd.flows.LCIMethod)4 Modelling (org.openlca.ilcd.flows.Modelling)4 Flow (org.openlca.ilcd.flows.Flow)2 FlowInfo (org.openlca.ilcd.flows.FlowInfo)2 Test (org.junit.Test)1 LangString (org.openlca.ilcd.commons.LangString)1 Other (org.openlca.ilcd.commons.Other)1 Publication (org.openlca.ilcd.commons.Publication)1 AdminInfo (org.openlca.ilcd.flows.AdminInfo)1 DataSetInfo (org.openlca.ilcd.flows.DataSetInfo)1 FlowName (org.openlca.ilcd.flows.FlowName)1