Basic configuration

How a project is discovered, how devices are described, and how services are configured.

Project root

Quatm resolves the project root in this order:

  1. QUATM_PROJECT_ROOT (set by the project launcher);
  2. the nearest parent directory containing configuration/configfile/configfile.json or a .quatm_project marker;
  3. the legacy repository layout.

A project keeps its own configuration and data; the framework package is installed separately. This lets several laboratories share one installation while keeping their files independent.

Directory layout

<project>/
├── configuration/
│   ├── configfile/configfile.json   # services and GUI entries to launch
│   ├── device_db.py                 # instruments used by experiments
│   └── properties/                  # persisted property tree
├── experiments/                     # experiment scripts
├── Data/                            # HDF5 acquisition files
├── drivers/                         # optional project-local drivers
├── monitor/                         # optional monitors
└── analysis/                        # optional analysis scripts

Device database

configuration/device_db.py maps logical names to drivers. An experiment refers to these names, never to vendor APIs directly.

DEVICE_DB = {
    'mot_coils': {
        'type': 'attr',
        'module': 'quatm.drivers.xxx',
        'class': 'XxxDriver',
        'address': 'tcp://192.168.1.50:5025',
        'arguments': {'channel': 1},
    },
    'probe_laser': {
        'type': 'local',
        'module': 'drivers.probe_laser',
        'class': 'ProbeLaser',
        'arguments': {'port': 'COM4'},
    },
}

The three modes are:

TypeMeaningTypical use
localInstantiate the driver as a full objectcameras, FPGA controllers, stages
attrMap one channel to a Python attributeDAC/TTL outputs
generic_attrCall an arbitrary driver functionDDS tones, multi-channel devices

A project-local module (for example drivers.probe_laser) takes precedence over a bundled driver with the same suffix. local_only / analysis_local_only can enforce that no bundled fallback is used.

Services

configuration/configfile/configfile.json declares the services and GUI programs for the project. The Operations Console reads this file, starts selected entries and tracks their state. Service processes are ordinary operating-system processes, so a crash is isolated and can be restarted independently.

Verify the setup

from quatm.servers.configreader import PROJECT_ROOT
print(PROJECT_ROOT)

Then open the Device Manager, select a device and use Test connection with simulation enabled. No hardware is required for this step.