Skip to content

capturegraph.procedures.nodes.automatic.constant #

Constant Value Procedures#

Constant procedures provide fixed data values for use in workflows. These supply literal values that don't change during execution, useful for configuration, thresholds, defaults, and reference data.

Example
from capturegraph.procedures.nodes.automatic import (
    ConstantBool, ConstantNumber, ConstantLocation
)

# Set a threshold for distance checking
threshold = ConstantNumber(value=100)

# Provide a default setting
use_raw = ConstantBool(value=False)

# Define a fixed target location
office = ConstantLocation(latitude=42.445, longitude=-76.480)

ConstantBool #

Bases: Procedure[PBool]

Provides a constant boolean value for use in procedures.

Attributes:

Name Type Description
value bool

The boolean value to provide.

Example
# Default to HEIC format
use_raw = ConstantBool(value=False)
session.new_file("photo").save(
    CaptureImage(raw_photo=use_raw)
)
Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/constant.py
@make_procedure
class ConstantBool(Procedure[PBool]):
    """
    Provides a constant boolean value for use in procedures.

    Attributes:
        value: The boolean value to provide.

    Example:
        ```python
        # Default to HEIC format
        use_raw = ConstantBool(value=False)
        session.new_file("photo").save(
            CaptureImage(raw_photo=use_raw)
        )
        ```
    """

    value: bool

ConstantNumber #

Bases: Procedure[PNumber]

Provides a constant numeric value for use in procedures.

Attributes:

Name Type Description
value int | float

The numeric value to provide.

Example
# Distance threshold in meters
threshold = ConstantNumber(value=50)
too_far = distance > threshold
Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/constant.py
@make_procedure
class ConstantNumber(Procedure[PNumber]):
    """
    Provides a constant numeric value for use in procedures.

    Attributes:
        value: The numeric value to provide.

    Example:
        ```python
        # Distance threshold in meters
        threshold = ConstantNumber(value=50)
        too_far = distance > threshold
        ```
    """

    value: int | float

ConstantString #

Bases: Procedure[PString]

Provides a constant text value for use in procedures.

Attributes:

Name Type Description
value str

The string value to provide.

Example
default_name = ConstantString(value="Unnamed")
Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/constant.py
@make_procedure
class ConstantString(Procedure[PString]):
    """
    Provides a constant text value for use in procedures.

    Attributes:
        value: The string value to provide.

    Example:
        ```python
        default_name = ConstantString(value="Unnamed")
        ```
    """

    value: str

ConstantLocation #

Bases: Procedure[PLocation]

Provides a constant geographic location for use in procedures.

Attributes:

Name Type Description
latitude int | float

Latitude in decimal degrees.

longitude int | float

Longitude in decimal degrees.

altitude int | float

Altitude in meters above sea level (default: 0.0).

Example
# Fixed reference point
target = ConstantLocation(
    latitude=42.445,
    longitude=-76.480,
    altitude=250.0
)
Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/constant.py
@make_procedure
class ConstantLocation(Procedure[PLocation]):
    """
    Provides a constant geographic location for use in procedures.

    Attributes:
        latitude: Latitude in decimal degrees.
        longitude: Longitude in decimal degrees.
        altitude: Altitude in meters above sea level (default: 0.0).

    Example:
        ```python
        # Fixed reference point
        target = ConstantLocation(
            latitude=42.445,
            longitude=-76.480,
            altitude=250.0
        )
        ```
    """

    latitude: int | float
    longitude: int | float
    altitude: int | float = 0.0

ConstantTimeInterval #

Bases: Procedure[PNumber]

Provides a constant time duration for use in procedures.

Returns the interval as a number in seconds.

Attributes:

Name Type Description
seconds int | float

Duration in seconds.

Example
# 30 minute interval
interval = ConstantTimeInterval(seconds=1800)
Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/constant.py
@make_procedure
class ConstantTimeInterval(Procedure[PNumber]):
    """
    Provides a constant time duration for use in procedures.

    Returns the interval as a number in seconds.

    Attributes:
        seconds: Duration in seconds.

    Example:
        ```python
        # 30 minute interval
        interval = ConstantTimeInterval(seconds=1800)
        ```
    """

    seconds: int | float