Search in sources :

Example 1 with FlowProperty

use of org.openlca.core.model.FlowProperty in project olca-modules by GreenDelta.

the class FlowReferenceSearchTest method createFlowPropertyFactor.

private FlowPropertyFactor createFlowPropertyFactor() {
    FlowPropertyFactor factor = new FlowPropertyFactor();
    factor.flowProperty = db.insert(new FlowProperty());
    return factor;
}
Also used : FlowPropertyFactor(org.openlca.core.model.FlowPropertyFactor) FlowProperty(org.openlca.core.model.FlowProperty)

Example 2 with FlowProperty

use of org.openlca.core.model.FlowProperty in project olca-modules by GreenDelta.

the class ImpactMethodReferenceSearchTest method createFlow.

private Flow createFlow() {
    Flow flow = new Flow();
    UnitGroup group = new UnitGroup();
    Unit unit = new Unit();
    unit.name = "unit";
    group.units.add(unit);
    group = db.insert(group);
    FlowProperty property = new FlowProperty();
    property.unitGroup = group;
    property = db.insert(property);
    FlowPropertyFactor factor = new FlowPropertyFactor();
    factor.flowProperty = property;
    flow.flowPropertyFactors.add(factor);
    return db.insert(flow);
}
Also used : UnitGroup(org.openlca.core.model.UnitGroup) Unit(org.openlca.core.model.Unit) FlowPropertyFactor(org.openlca.core.model.FlowPropertyFactor) FlowProperty(org.openlca.core.model.FlowProperty) Flow(org.openlca.core.model.Flow)

Example 3 with FlowProperty

use of org.openlca.core.model.FlowProperty in project olca-modules by GreenDelta.

the class FlowDescriptorTest method setUp.

@Before
public void setUp() {
    property = new FlowProperty();
    property = new FlowPropertyDao(db).insert(property);
    flow = new Flow();
    flow.referenceFlowProperty = property;
    flow = flowDao.insert(flow);
}
Also used : FlowPropertyDao(org.openlca.core.database.FlowPropertyDao) FlowProperty(org.openlca.core.model.FlowProperty) Flow(org.openlca.core.model.Flow) Before(org.junit.Before)

Example 4 with FlowProperty

use of org.openlca.core.model.FlowProperty in project olca-modules by GreenDelta.

the class TestData method flow.

public static Flow flow(String name, String unit, FlowType type) {
    String flowId = KeyGen.get("flow", name, unit);
    FlowDao dao = new FlowDao(Tests.getDb());
    Flow flow = dao.getForRefId(flowId);
    if (flow != null)
        return flow;
    flow = new Flow();
    flow.name = name;
    flow.refId = flowId;
    flow.flowType = type;
    FlowProperty property = property(unit);
    FlowPropertyFactor factor = new FlowPropertyFactor();
    factor.flowProperty = property;
    factor.conversionFactor = 1;
    flow.flowPropertyFactors.add(factor);
    flow.referenceFlowProperty = property;
    return dao.insert(flow);
}
Also used : FlowDao(org.openlca.core.database.FlowDao) FlowPropertyFactor(org.openlca.core.model.FlowPropertyFactor) FlowProperty(org.openlca.core.model.FlowProperty) Flow(org.openlca.core.model.Flow)

Example 5 with FlowProperty

use of org.openlca.core.model.FlowProperty in project olca-modules by GreenDelta.

the class FlowPropertyFactorUseSearchTest method setup.

@Before
public void setup() {
    flow = new Flow();
    flow.name = "flow";
    property = new FlowProperty();
    property.name = "property";
    factor = new FlowPropertyFactor();
    factor.flowProperty = property;
    flow.flowPropertyFactors.add(factor);
    property = new FlowPropertyDao(database).insert(property);
    flow = new FlowDao(database).insert(flow);
    factor = flow.getFactor(property);
    search = new FlowPropertyFactorUseSearch(flow, database);
}
Also used : FlowDao(org.openlca.core.database.FlowDao) FlowPropertyDao(org.openlca.core.database.FlowPropertyDao) FlowPropertyFactor(org.openlca.core.model.FlowPropertyFactor) FlowProperty(org.openlca.core.model.FlowProperty) Flow(org.openlca.core.model.Flow) Before(org.junit.Before)

Aggregations

FlowProperty (org.openlca.core.model.FlowProperty)58 Flow (org.openlca.core.model.Flow)18 FlowPropertyFactor (org.openlca.core.model.FlowPropertyFactor)18 UnitGroup (org.openlca.core.model.UnitGroup)18 FlowPropertyDao (org.openlca.core.database.FlowPropertyDao)14 Unit (org.openlca.core.model.Unit)14 FlowDao (org.openlca.core.database.FlowDao)7 Process (org.openlca.core.model.Process)7 ProcessDao (org.openlca.core.database.ProcessDao)4 UnitGroupDao (org.openlca.core.database.UnitGroupDao)4 Category (org.openlca.core.model.Category)4 ArrayList (java.util.ArrayList)3 Before (org.junit.Before)3 CategoryDao (org.openlca.core.database.CategoryDao)3 Actor (org.openlca.core.model.Actor)3 ProductSystem (org.openlca.core.model.ProductSystem)3 Source (org.openlca.core.model.Source)3 JsonObject (com.google.gson.JsonObject)2 Date (java.util.Date)2 IDatabase (org.openlca.core.database.IDatabase)2