feat(track-core): add portable training runtimes
Move scheme and PID training runtime behavior into the pure track_core layer and expose render sinks for injected strip application. Add ESP compatibility adapters, Python bindings/test scaffolding, and in-memory render support so app_track_bt can consume core render and runtime logic without duplicating it. Cover circular/linear rendering boundaries, all scheme runtime types, scheme render_to parity, PID sample de-duplication, speed suppression, and live tuning in track-core tests.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
#include "track_core/model.hpp"
|
||||
@@ -27,10 +28,34 @@ struct TrackRenderPlan {
|
||||
std::size_t span_count{};
|
||||
};
|
||||
|
||||
struct TrackRenderSink {
|
||||
using ClearFn = TrackError (*)(void *context);
|
||||
using FillFn = TrackError (*)(
|
||||
void *context,
|
||||
std::uint16_t start_led,
|
||||
std::uint16_t led_count,
|
||||
Color color);
|
||||
using ShowFn = TrackError (*)(void *context);
|
||||
|
||||
void *context{};
|
||||
ClearFn clear{};
|
||||
FillFn fill{};
|
||||
ShowFn show{};
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
TrackRenderPlan make_track_render_plan(
|
||||
const TrackConfig &config,
|
||||
const TrackInfo &info,
|
||||
const TrackReport &report);
|
||||
|
||||
[[nodiscard]]
|
||||
TrackError clear_render_sink(TrackRenderSink sink);
|
||||
|
||||
[[nodiscard]]
|
||||
TrackError apply_render_plan(TrackRenderSink sink, const TrackRenderPlan &plan);
|
||||
|
||||
[[nodiscard]]
|
||||
TrackError show_render_sink(TrackRenderSink sink);
|
||||
|
||||
} // namespace track_core
|
||||
|
||||
Reference in New Issue
Block a user