The design heavily relies on the PlaceOS::Core::Resource
abstraction.
The individual components are roughly laid out below. For more detail, see the files themselves.
constants.cr
driver_router.cr
- Publishes
Driver
models to themetadata
topic (viaPublishMetadata
)
- Publishes
manager.cr
- Manages the application start-up
status_events.cr
- Listens for redis events via a pattern subscription
- Parses events, gets topic keys and writes the events to
PublisherManager
module_router.cr
- Maintains a mapping of
module_id
todriver_id
- Maintains a mapping of
publish_metadata.cr
- Module with a helper to Publish a model under the
metadata
key viaPublisherManager
- Module with a helper to Publish a model under the
publisher.cr
- Abstraction over an MQTT client, writing to a broker specified by a
Model::Broker
- Sanitizes data via
Model::Broker
filters - Writes state events to
/<org>/state/..
- Writes metadata events to
/<org>/metadata/..
- Abstraction over an MQTT client, writing to a broker specified by a
publisher_manager.cr
- Handles creation of
Publisher
s - Broadcasts events across
Publisher
s
- Handles creation of
resource.cr
- Reexport of
PlaceOS::Core::Resource
- Reexport of
system_router.cr
- Publishes
ControlSystem
models to themetadata
topic (viaPublishMetadata
) - Maintains
control_system_id
toZoneMapping
mappings. For use in generatingstate
keys. - Maintains
module_id
toArray(ModuleMapping)
mappings. For use in generatingstate
keys. - Maintains
module_id
todriver_id
mappings. For use in generatingstate
keys.
- Publishes
zone_router.cr
- Publishes
Zone
models to themetadata
topic (viaPublishMetadata
)
- Publishes