Crate sensor_core

Source

Modules§

conditional_image_renderer
graph_renderer
text_renderer

Structs§

ConditionalImageConfig
Represents a conditional image element on a display.
DisplayConfig
Represents the display config. It holds the resolution and the elements to be rendered.
ElementConfig
Represents a single element to be rendered on a display.
GraphConfig
Represents a graph element on a display.
ImageConfig
Represents a static image element on a display.
PrepareConditionalImageData
Represents the preparation data for the render process. It holds all static assets to be rendered. This is done once before the loop starts. Each asset will be stored on the display locally, and load during the render process by its asset id / element id
PrepareStaticImageData
Represents the preparation data for the render process. It holds all static assets to be rendered. This is done once before the loop starts. Each asset will be stored on the display locally, and load during the render process by its asset id / element id
PrepareTextData
Represents the preparation data for the render process. It holds all static assets to be rendered. This is done once before the loop starts. Each asset will be stored on the display locally, and load during the render process by its asset id / element id
RenderData
Represents the data to be rendered on a display. It holds the display config and the sensor values.
SensorValue
Provides a single SensorValue
TextConfig
Represents a text element on a display.
TransportMessage
Indicates the current type of message to be sent to the display. Either a message to prepares static assets, by sending them to the display, and then be stored on the fs. Or the actual render loop, where the prev. stored asses will be used to render the image. The type is used to deserialize the data to the correct struct. The data is a vector of bytes, which will be deserialized to the correct struct, depending on the type.

Enums§

ElementType
Represents the type of an element on a display.
GraphType
Represents the type of a graph element on a display.
SensorType
Represents the type of a sensor value. This is used to determine how to render the value. For example a text value will be rendered as text, while a number value can be rendered as a graph.
SensorValueModifier
Represents the modifier of a sensor value. This is used to modify the value before rendering. For example to output the average or max value of a sensor.
TextAlign
Represents the text alignment of a text element.
TransportType
Represents the type of the message to be sent to the display. Either a message to prepares static assets, by sending them to the display, and then be stored on the fs. Or the actual render loop, where the prev. stored asses will be used to render the image. The type is used to deserialize the data to the correct struct.

Functions§

extract_value_sequence
Extracts the historical values from the sensor_value_history and reverses the order
get_cache_base_dir
Get the base cache directory
get_cache_dir
Get the cache directory for the given element
get_config_dir
Get the application config dir
hex_to_rgba
Converts a hex string to a Rgba The hex string must be in the format #RRGGBBAA Example: #FF0000CC Returns a Rgba struct
is_image
Checks if the given DirEntry is an image
render_lcd_image
Render the image The image will be a RGB8 png image