use of org.openlca.ilcd.models.ModelName 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.models.ModelName in project olca-modules by GreenDelta.
the class IO method getName.
@SuppressWarnings("unchecked")
private static String getName(Model m) {
ModelName mn = Models.getModelName(m);
if (mn == null)
return "";
List<?>[] parts = new List<?>[] { mn.name, mn.technicalDetails, mn.mixAndLocation, mn.flowProperties };
String name = "";
for (List<?> part : parts) {
String s = LangString.getFirst((List<LangString>) part, "en");
if (Strings.nullOrEmpty(s))
continue;
if (name.length() > 0)
name += "; ";
name += s.trim();
}
return name;
}
Aggregations