Search in sources :

Example 6 with DQSystem

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

the class DQSystemImport method map.

@Override
DQSystem map(JsonObject json, long id) {
    if (json == null)
        return null;
    DQSystem s = new DQSystem();
    In.mapAtts(json, s, id, conf);
    s.hasUncertainties = Json.getBool(json, "hasUncertainties", false);
    String sourceRefId = Json.getRefId(json, "source");
    if (sourceRefId != null)
        s.source = SourceImport.run(sourceRefId, conf);
    mapIndicators(json, s);
    return conf.db.put(s);
}
Also used : DQSystem(org.openlca.core.model.DQSystem)

Example 7 with DQSystem

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

the class DQSystems method ecoinvent.

/**
 * Returns the ecoinvent data quality system from the database. It creates a
 * new instance of the system and inserts it in the database if it does not
 * exist yet.
 */
public static DQSystem ecoinvent(IDatabase db) {
    if (db == null)
        return null;
    DQSystemDao dao = new DQSystemDao(db);
    DQSystem dqs = dao.getForRefId(EI_DQS);
    if (dqs == null) {
        dqs = dao.insert(ecoinvent());
    }
    return dqs;
}
Also used : DQSystem(org.openlca.core.model.DQSystem) DQSystemDao(org.openlca.core.database.DQSystemDao)

Example 8 with DQSystem

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

the class DQSystems method ecoinvent.

/**
 * Creates an instance of the ecoinvent data quality system.
 */
public static DQSystem ecoinvent() {
    DQSystem system = new DQSystem();
    system.name = "ecoinvent data quality system";
    system.refId = EI_DQS;
    system.hasUncertainties = true;
    String[] indicators = eiIndicators();
    String[][] scores = eiScores();
    double[][] uncertainties = eiUncertainties();
    for (int i = 0; i < indicators.length; i++) {
        DQIndicator indicator = new DQIndicator();
        indicator.name = indicators[i];
        indicator.position = i + 1;
        for (int j = 0; j < scores[i].length; j++) {
            DQScore score = new DQScore();
            score.description = scores[i][j];
            score.position = j + 1;
            score.uncertainty = uncertainties[i][j];
            indicator.scores.add(score);
        }
        system.indicators.add(indicator);
    }
    return system;
}
Also used : DQScore(org.openlca.core.model.DQScore) DQSystem(org.openlca.core.model.DQSystem) DQIndicator(org.openlca.core.model.DQIndicator)

Example 9 with DQSystem

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

the class DQInfoSection method statisticsTree.

private void statisticsTree(Composite parent, String label, boolean forProcesses) {
    DQSystem system = forProcesses ? dqResult.setup.processSystem : dqResult.setup.exchangeSystem;
    if (system == null)
        return;
    UI.formLabel(parent, toolkit, label);
    UI.formLabel(parent, toolkit, "");
    String[] headers = { M.Indicator, M.Coverage };
    TreeViewer viewer = Trees.createViewer(parent, headers);
    viewer.setContentProvider(new ContentProvider(forProcesses));
    viewer.setLabelProvider(new LabelProvider(forProcesses));
    ((GridData) viewer.getTree().getLayoutData()).horizontalSpan = 2;
    viewer.setInput(system.indicators);
    Trees.bindColumnWidths(viewer.getTree(), 0.6, 0.4);
}
Also used : DQSystem(org.openlca.core.model.DQSystem) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) ITreeContentProvider(org.eclipse.jface.viewers.ITreeContentProvider) BaseLabelProvider(org.eclipse.jface.viewers.BaseLabelProvider) ITableLabelProvider(org.eclipse.jface.viewers.ITableLabelProvider)

Example 10 with DQSystem

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

the class DQSystemReferenceSearchTest method createModel.

@Override
protected DQSystem createModel() {
    DQSystem system = new DQSystem();
    system.source = insertAndAddExpected("source", new Source());
    system = db.insert(system);
    systems.add(system);
    return system;
}
Also used : DQSystem(org.openlca.core.model.DQSystem) Source(org.openlca.core.model.Source)

Aggregations

DQSystem (org.openlca.core.model.DQSystem)14 Process (org.openlca.core.model.Process)4 DQSystemDao (org.openlca.core.database.DQSystemDao)3 Source (org.openlca.core.model.Source)3 DataQualityShell (org.openlca.app.editors.processes.data_quality.DataQualityShell)2 Category (org.openlca.core.model.Category)2 DQIndicator (org.openlca.core.model.DQIndicator)2 DQScore (org.openlca.core.model.DQScore)2 Location (org.openlca.core.model.Location)2 Parameter (org.openlca.core.model.Parameter)2 ProcessDocumentation (org.openlca.core.model.ProcessDocumentation)2 Dimension (org.eclipse.draw2d.geometry.Dimension)1 Point (org.eclipse.draw2d.geometry.Point)1 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)1 BaseLabelProvider (org.eclipse.jface.viewers.BaseLabelProvider)1 ITableLabelProvider (org.eclipse.jface.viewers.ITableLabelProvider)1 ITreeContentProvider (org.eclipse.jface.viewers.ITreeContentProvider)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 Color (org.eclipse.swt.graphics.Color)1 Hyperlink (org.eclipse.ui.forms.widgets.Hyperlink)1