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.4.0.tar.gz (3.5 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for crosslab_soa_service_parameter-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8ccb0fa21aed4d72651069202b45a2d765a3d9541507b7d0af9da8497dbf50e4
MD5 ce94d93b5b4d77d0f759c1aa871d619a
BLAKE2b-256 ffe670ed3fb854a2dddc3f9876a4c418705ec9f572e0110fab9015a78e4622c2

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