Developers/Graphic libraries

Building graphic libraries

Authoring, publishing, linking and updating versioned faceplate libraries.

2 min read

A library packages templates and images into a single *.abscada-library.json file. Another project links it with an alias and a specific version.

Workflow

  1. Author: build the faceplates in a normal project, with a test screen bound to internal variables.
  2. Publish: Libraries… → Publish library…, pick templates, name, version, author and licence.
  3. Link: in the consumer project, Libraries… → Link… and an alias, e.g. equipos.
  4. Use: templates appear as equipos__unidad, equipos__valvula.
  5. Update: Update from… with a newer version of the same library.

Self-containment rules

  • Variable references must be $name parameters.
  • No dependencies on the authoring project's scripts, screens or viewers.
  • Images, including dynamic-state images, are embedded as base64.
  • @Name palette colours are resolved to HEX on publish.
  • Published files are never overwritten: each version is a new file.

Publishing from Python

from abscada.project import Project
from abscada.faceplate_libraries import export_library

p = Project.load("author")
export_library(p, ["pump", "valve"], "equipos-1.0.0.abscada-library.json",
               "Process equipment", "1.0.0",
               author="My team", license="GPL-3.0-or-later")

Linking and updating from Python

from abscada.faceplate_libraries import link

p = Project.load("consumer")
link(p, "equipos-1.0.0.abscada-library.json", "equipos")
p.save()

# Later compatible revision:
link(p, "equipos-1.1.0.abscada-library.json", "equipos", update=True)
p.save()

An update is rejected if it removes a used parameter, changes its type, adds a required one or removes a template in use. The previous project stays intact.

Package format

{"schema_version": 1, "name": "Process equipment", "version": "1.0.0",
 "author": "My team", "license": "GPL-3.0-or-later",
 "faceplates": {"pump": {"width": 100, "height": 60, "parameters": {}, "elements": []}},
 "assets": {"a1b2c3.svg": "<base64>"}}

The project stores a full snapshot with a SHA-256 hash in libraries.json: it keeps working even if the original file disappears.

Validate

.venv\Scripts\python tools/validate_library.py equipos-1.0.0.abscada-library.json
.venv\Scripts\python -m pytest tests/test_faceplate_libraries.py

Current limits

No nested faceplates, no trend/alarm viewers inside templates, no packaged scripts and no dependencies between libraries. Parameters are primitive: a UDT is broken down into leaf parameters.

Adapting libraries

The downloadable specification describes controls, properties, dynamics and acceptance criteria for adapting objects to abSCADA.

Standard and project libraries

Studio groups project, standard and external libraries under Librerías. The standard library ships with the application and is read-only: copy objects to the project to modify them. Project folders organise the editor only. External libraries retain their alias, snapshot, version and fingerprint; updates are explicit. The format and APIs keep the term faceplate. See the user guide.

Building graphic libraries · abSCADA