Skip to main content

The CrossLab SOA parameter Service.

Project description

This is the Parameter service to use as a Crosslab SOA service. It allows to transmit variouse numeric parameters / values between different devices.

Parameter Producer

service = ParameterService__Producer(
    "position",
    [
        {"name": "x", "unit": "m", "minimum": -1.2, "maximum": 1.2},
        {"name": "y", "unit": "m", "minimum": -1.2, "maximum": 1.2},
        {"name": "z", "unit": "m", "minimum": 0, "maximum": 0.5},
    ],
)
deviceHandler.add_service(service)

When any parameter changes (or is initialized) the service inform the service via:

await service.updateParameter("x", 0.5)

Parameter Consumer

service = ParameterService__Consumer(
    "position",
    [
        {"name": "x", "unit": "m"},
        {"name": "y", "unit": "m"},
        {"name": "z", "unit": "m", "minimum": 0, "maximum": 1},
        {"name": "ANY", "unit": "ANY"},
    ],
)

deviceHandler.add_service(service)

The special name / unit “ANY” allows to receive any parameter. When a new parameter gets connected / disconnect the service will emit the following callback:

def parameterListChanged(event: ParameterListChangedEvent):
    print(event)
    # event.parameters is a list of all parameters

service.on("parameterListChanged", parameterListChanged)

When a parameter changes the service will emit the following callback:

def parameterChanged(event: ParameterChangedEvent):
    print(event)
    # event.parameter is the changed parameter

service.on("parameterChanged", parameterChanged)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crosslab_soa_service_parameter-0.3.2.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file crosslab_soa_service_parameter-0.3.2.tar.gz.

File metadata

File hashes

Hashes for crosslab_soa_service_parameter-0.3.2.tar.gz
Algorithm Hash digest
SHA256 f9540fe8c5907432857fc661d68a845dd0d59330d4e141dc21c1101d038d19f2
MD5 688d3b179136d326abbd8f399aa702f2
BLAKE2b-256 e9452f5a957a1f259117d93a786090073cdd4b37e136e3a0ac463c0274fd34d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page