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.crdriver_router.cr- Publishes
Drivermodels to themetadatatopic (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_idtodriver_id
- Maintains a mapping of
publish_metadata.cr- Module with a helper to Publish a model under the
metadatakey 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::Brokerfilters - 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
Publishers - Broadcasts events across
Publishers
- Handles creation of
resource.cr- Reexport of
PlaceOS::Core::Resource
- Reexport of
system_router.cr- Publishes
ControlSystemmodels to themetadatatopic (viaPublishMetadata) - Maintains
control_system_idtoZoneMappingmappings. For use in generatingstatekeys. - Maintains
module_idtoArray(ModuleMapping)mappings. For use in generatingstatekeys. - Maintains
module_idtodriver_idmappings. For use in generatingstatekeys.
- Publishes
zone_router.cr- Publishes
Zonemodels to themetadatatopic (viaPublishMetadata)
- Publishes