use of org.openlca.ilcd.commons.Classification in project olca-modules by GreenDelta.
the class FlowExport method makeCategoryInfo.
private void makeCategoryInfo(DataSetInfo dataSetInfo) {
CategoryConverter converter = new CategoryConverter();
FlowCategoryInfo info = new FlowCategoryInfo();
dataSetInfo.classificationInformation = info;
if (flow.flowType == org.openlca.core.model.FlowType.ELEMENTARY_FLOW) {
CompartmentList categorization = converter.getElementaryFlowCategory(flow.category);
info.compartmentLists.add(categorization);
} else {
Classification classification = converter.getClassification(flow.category);
info.classifications.add(classification);
}
}
use of org.openlca.ilcd.commons.Classification in project olca-modules by GreenDelta.
the class SystemExport method initModel.
private Model initModel() {
Model model = new Model();
Models.setOrigin(model, "openLCA");
model.version = "1.1";
model.locations = "../ILCDLocations.xml";
DataSetInfo info = Models.forceDataSetInfo(model);
info.uuid = system.refId;
ModelName name = Models.forceModelName(model);
name.name.add(LangString.of(system.name, config.lang));
if (system.description != null) {
info.comment.add(LangString.of(system.description, config.lang));
}
CategoryConverter conv = new CategoryConverter();
Classification c = conv.getClassification(system.category);
if (c != null)
Models.forceClassifications(model).add(c);
if (system.referenceProcess != null) {
long refId = system.referenceProcess.id;
QuantitativeReference qRef = Models.forceQuantitativeReference(model);
qRef.refProcess = processIDs.getOrDefault(refId, -1);
}
Models.forcePublication(model).version = Version.asString(system.version);
model.modelling = new Modelling();
return model;
}
use of org.openlca.ilcd.commons.Classification in project olca-modules by GreenDelta.
the class ActorExport method addClassification.
private void addClassification(DataSetInfo dataSetInfo) {
if (actor.category == null)
return;
CategoryConverter converter = new CategoryConverter();
Classification classification = converter.getClassification(actor.category);
if (classification != null) {
dataSetInfo.classifications.add(classification);
}
}
use of org.openlca.ilcd.commons.Classification in project olca-modules by GreenDelta.
the class CategoryConverter method getClassification.
Classification getClassification(Category category) {
if (category == null)
return null;
Classification classification = new Classification();
if (category != null) {
Stack<Category> stack = fillStack(category);
makeClasses(classification, stack);
}
return classification;
}
use of org.openlca.ilcd.commons.Classification in project olca-modules by GreenDelta.
the class DataSetInfo method clone.
@Override
public DataSetInfo clone() {
DataSetInfo clone = new DataSetInfo();
clone.uuid = uuid;
if (name != null)
clone.name = name.clone();
clone.subIdentifier = subIdentifier;
LangString.copy(synonyms, clone.synonyms);
if (complementingProcesses != null) {
clone.complementingProcesses = new Ref[complementingProcesses.length];
for (int i = 0; i < complementingProcesses.length; i++) {
Ref p = complementingProcesses[i];
if (p == null)
continue;
clone.complementingProcesses[i] = p.clone();
}
}
for (Classification c : classifications) {
if (c == null)
continue;
clone.classifications.add(c.clone());
}
LangString.copy(comment, clone.comment);
Ref.copy(externalDocs, clone.externalDocs);
if (other != null)
clone.other = other.clone();
clone.otherAttributes.putAll(otherAttributes);
return clone;
}
Aggregations