This commit is contained in:
2026-08-26 22:11:50 +08:00
parent c50afae9c5
commit e187d9a9a8
12 changed files with 317 additions and 64 deletions
+5 -5
View File
@@ -813,16 +813,16 @@ std::shared_ptr<Plot> make_waterfall_plot() {
auto update = [scene = scene.get(), raw = waterfall.get(), frequency = frequency.get(), time = time.get()](const Plot_Render_Tick& event, bool demo_data) {
resize_axes(scene, {static_cast<int>(event.width), static_cast<int>(event.height)}, frequency, time);
if (!demo_data) return;
std::array < double, 192 > values{};
for (std::size_t i = 0; i < values.size(); ++i)
values[i] = -100.0 + 70.0 * std::exp(-240.0 * std::pow(
static_cast<double>(i) / values.size() - 0.5
- 0.22 * std::sin(event.time_milliseconds * 0.0006), 2.0));
constexpr double day_milliseconds = 86'400'000.0;
const auto tick = time->append_time(Time_Of_Day{
static_cast<std::int64_t>(
std::fmod(std::max(0.0, event.time_milliseconds), day_milliseconds))
});
std::array < double, 192 > values{};
for (std::size_t i = 0; i < values.size(); ++i)
values[i] = -100.0 + 70.0 * std::exp(-240.0 * std::pow(
static_cast<double>(i) / values.size() - 0.5
- 0.22 * std::sin(static_cast<double>(tick) * 0.01), 2.0));
raw->template submit_stream<Waterfall_Stream_Tag>(
std::make_shared<const Waterfall_Row>(Waterfall_Row{
tick, {values.begin(), values.end()}