feat(emulator): add editable training schema panel
Redesign the DearPyGui emulator into a two-column layout with an interactive training schema editor and runtime preview. Add JSON load/save support for ST, SM, MT, and RSMT schemes, including draft normalization, conversion to core schemes, and explicit Apply validation so intermediate edits do not restart or block the preview. Update manual mode to clamp negative mileage, remove speed from manual positioning, preserve stopped runtime state when reloading schemas, and keep linear rendering visible with span-based drawing. Fix the core linear pingpong render plan so reverse travel remains visible near endpoints and prefix/postfix colors stay tied to physical sides instead of reversing with heading. Add C++ and Python regressions for schema conversion, emulator edit behavior, manual mode, linear endpoint visibility, and fixed prefix/postfix colors.
This commit is contained in:
+4
-12
@@ -249,8 +249,8 @@ TrackRenderPlan make_track_render_plan(
|
||||
}
|
||||
case TrackDrawKind::linear: {
|
||||
const auto drawer = LinearLineDrawer::from_report(config, report);
|
||||
const auto magic_color_ahead = Color::blue();
|
||||
const auto magic_color_behind = Color::cyan();
|
||||
const auto prefix_color = Color::cyan();
|
||||
const auto postfix_color = Color::blue();
|
||||
const auto center_offset = static_cast<int>(drawer.center_offset_leds_num());
|
||||
const auto line_leds_num = static_cast<int>(config.line_leds_num);
|
||||
const auto fill_positive_side = [&](std::uint16_t count, Color near_center, Color far_end) {
|
||||
@@ -281,16 +281,8 @@ TrackRenderPlan make_track_render_plan(
|
||||
};
|
||||
const auto ahead = drawer.center_ahead_leds_num();
|
||||
const auto behind = drawer.center_behind_leds_num();
|
||||
switch (drawer.direction) {
|
||||
case LinearLineDrawer::head_to_tail:
|
||||
fill_positive_side(ahead, info.color, magic_color_ahead);
|
||||
fill_negative_side(behind, info.color, magic_color_behind);
|
||||
break;
|
||||
case LinearLineDrawer::tail_to_head:
|
||||
fill_negative_side(ahead, info.color, magic_color_ahead);
|
||||
fill_positive_side(behind, info.color, magic_color_behind);
|
||||
break;
|
||||
}
|
||||
fill_positive_side(ahead, info.color, postfix_color);
|
||||
fill_negative_side(behind, info.color, prefix_color);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user