Search in sources :

Example 36 with ProductSystem

use of org.openlca.core.model.ProductSystem in project olca-app by GreenDelta.

the class Export method tryExportSystem.

private void tryExportSystem(ExportConfig config, Descriptor d) {
    try {
        ProductSystem system = new ProductSystemDao(database).getForId(d.id);
        SystemExport export = new SystemExport(config);
        export.run(system);
        monitor.worked(1);
    } catch (Exception e) {
        log.error("System export failed", e);
    }
}
Also used : ProductSystem(org.openlca.core.model.ProductSystem) SystemExport(org.openlca.io.ilcd.output.SystemExport) InvocationTargetException(java.lang.reflect.InvocationTargetException) ProductSystemDao(org.openlca.core.database.ProductSystemDao)

Example 37 with ProductSystem

use of org.openlca.core.model.ProductSystem in project olca-app by GreenDelta.

the class ProductSystemWizardPage method createModel.

@Override
public ProductSystem createModel() {
    ProductSystem system;
    if (refProcess != null) {
        system = ProductSystem.of(refProcess);
    } else {
        // create an empty reference process
        var processName = filterText.getText().trim();
        if (Strings.nullOrEmpty(processName)) {
            processName = nameText.getText().trim();
        }
        var process = new Process();
        process.name = processName;
        process.refId = UUID.randomUUID().toString();
        system = new ProductSystem();
        system.refId = UUID.randomUUID().toString();
        system.referenceProcess = process;
    }
    system.name = getModelName();
    system.description = getModelDescription();
    return system;
}
Also used : ProductSystem(org.openlca.core.model.ProductSystem) Process(org.openlca.core.model.Process)

Aggregations

ProductSystem (org.openlca.core.model.ProductSystem)37 Test (org.junit.Test)12 Process (org.openlca.core.model.Process)12 TestProcess (org.openlca.core.TestProcess)7 ProductSystemDao (org.openlca.core.database.ProductSystemDao)7 ProductSystemNode (org.openlca.app.editors.graphical.model.ProductSystemNode)5 Flow (org.openlca.core.model.Flow)5 Parameter (org.openlca.core.model.Parameter)5 FullResult (org.openlca.core.results.FullResult)5 ImpactMethod (org.openlca.core.model.ImpactMethod)4 ProcessLink (org.openlca.core.model.ProcessLink)4 Before (org.junit.Before)3 FlowProperty (org.openlca.core.model.FlowProperty)3 ParameterRedef (org.openlca.core.model.ParameterRedef)3 ParameterRedefSet (org.openlca.core.model.ParameterRedefSet)3 UnitGroup (org.openlca.core.model.UnitGroup)3 AbstractZipTest (org.openlca.jsonld.AbstractZipTest)3 Actor (org.openlca.core.model.Actor)2 Category (org.openlca.core.model.Category)2 ImpactCategory (org.openlca.core.model.ImpactCategory)2