Developers/Extending

CLI, testing and contributing

Command line, headless mode, validation, test suite and contribution workflow.

1 min read

Command line

python -m abscada [project] [--validate] [--headless] [--runtime] [--seconds N]
Option Effect
(none) Opens Studio with the project (default examples/plant)
--runtime Opens only the operator window
--validate Validates the project and exits
--headless --seconds N Acquires without a UI and prints values

Using it as a library

The core doesn't depend on Qt, so you can use it in your own tools:

from pathlib import Path
from abscada.project import Project
from abscada.runtime import Runtime

project = Project.load(Path("examples/s7"))
runtime = Runtime(project)
runtime.start()
try:
    for name, sample in runtime.snapshot().items():
        print(name, sample.value, sample.quality)
finally:
    runtime.stop()

Tests

.venv\Scripts\python -m pip install -e ".[dev,s7,modbus]"
.venv\Scripts\python -m pytest -q

CI uses QT_QPA_PLATFORM=offscreen. Communication tests spin up external TCP servers on ephemeral ports: there is no internal simulation.

Bundled tools

Script Use
tools/validate_library.py Validates a library package
tools/capture_demo.py Regenerates product screenshots
tools/build_showcase.py Builds the lab project
tools/showcase_plcs.py Test PLCs for the lab

Contributing

  1. Open an issue describing the problem or proposal.
  2. Keep module boundaries: the core never imports Qt.
  3. Add tests for any format or behaviour change.
  4. Don't claim compatibility with equipment you haven't tested.

The code is released under GPL-3.0-or-later. Contributions are accepted under the same licence.

CLI, testing and contributing · abSCADA