refactor(track-core): remove app-facing track adapters
Keep track-core focused on portable track state, scheme runtime, PID runtime, memory strip, and render planning. Remove the ESP-IDF/nanopb Track adapter headers and sources from the submodule so app/protobuf ownership can live in a separate firmware component. The standalone CMake and Python binding surface remains unchanged, including the emulator-facing APIs.
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "app_track_model.hpp"
|
||||
#include "track_core/scheme_decoder.hpp"
|
||||
|
||||
namespace app::track {
|
||||
|
||||
struct TrackSchemeDecoder {
|
||||
using proto_type = track_app_TrackScheme;
|
||||
static inline const pb_msgdesc_t *pb_fields = &track_app_TrackScheme_msg;
|
||||
|
||||
TrackSchemeDecoder() = default;
|
||||
|
||||
[[nodiscard]]
|
||||
static TrackSchemeDecoder from_proto(const proto_type &proto);
|
||||
|
||||
[[nodiscard]]
|
||||
proto_type to_proto() const;
|
||||
|
||||
[[nodiscard]]
|
||||
expected<track_core::DecodedScheme, error_t> decode_core() const;
|
||||
|
||||
uint8_t id = 0;
|
||||
std::vector<uint8_t> binary;
|
||||
Color color;
|
||||
};
|
||||
|
||||
struct TrackSchemeMgr {
|
||||
using proto_type = track_app_TrackSchemeMgr;
|
||||
static inline const pb_msgdesc_t *pb_fields = &track_app_TrackSchemeMgr_msg;
|
||||
|
||||
struct Add {
|
||||
using proto_type = track_app_TrackSchemeMgrAdd;
|
||||
static inline const pb_msgdesc_t *pb_fields = &track_app_TrackSchemeMgrAdd_msg;
|
||||
|
||||
TrackSchemeDecoder scheme_decoder;
|
||||
error_t err{ESP_OK};
|
||||
|
||||
static Add from_proto(const proto_type &proto);
|
||||
[[nodiscard]]
|
||||
proto_type to_proto() const;
|
||||
};
|
||||
|
||||
struct Clear {};
|
||||
|
||||
using Unknown = std::monostate;
|
||||
|
||||
enum class MessageType : uint8_t {
|
||||
NONE = 0,
|
||||
ADD = 1,
|
||||
CLEAR = 2
|
||||
};
|
||||
|
||||
explicit TrackSchemeMgr() = default;
|
||||
|
||||
static TrackSchemeMgr from_proto(const proto_type &proto);
|
||||
[[nodiscard]]
|
||||
proto_type to_proto() const;
|
||||
|
||||
std::variant<Unknown, Add, Clear> choice{Unknown{}};
|
||||
};
|
||||
|
||||
} // namespace app::track
|
||||
@@ -1,40 +0,0 @@
|
||||
#ifndef D2AF35D4_5EEF_406F_A3F6_F7E6F2AA24C4
|
||||
#define D2AF35D4_5EEF_406F_A3F6_F7E6F2AA24C4
|
||||
#include "app_strip_if.hpp"
|
||||
#include "app_track_model.hpp"
|
||||
#include "track_core/render.hpp"
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
|
||||
namespace app::track {
|
||||
|
||||
struct TrackRenderSpan {
|
||||
uint16_t start_led{};
|
||||
uint16_t led_count{};
|
||||
Color color;
|
||||
};
|
||||
|
||||
struct TrackRenderPlan {
|
||||
static constexpr size_t MAX_SPANS = 4;
|
||||
|
||||
void add_fill(uint16_t start_led, uint16_t led_count, Color color);
|
||||
|
||||
[[nodiscard]]
|
||||
bool empty() const {
|
||||
return span_count == 0;
|
||||
}
|
||||
|
||||
std::array<TrackRenderSpan, MAX_SPANS> spans{};
|
||||
size_t span_count{};
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
TrackRenderPlan make_track_render_plan(const TrackConfig &config, const TrackInfo &info, const report &rep);
|
||||
|
||||
void apply_render_plan(app::strip::StripView strip, const TrackRenderPlan &plan);
|
||||
|
||||
[[nodiscard]]
|
||||
track_core::TrackRenderSink make_track_render_sink(app::strip::StripView &strip);
|
||||
}
|
||||
|
||||
#endif /* D2AF35D4_5EEF_406F_A3F6_F7E6F2AA24C4 */
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user