Skip to content

Commit

Permalink
Belt tuning: Results show hotfix
Browse files Browse the repository at this point in the history
BFW-6029
  • Loading branch information
CZDanol-prusa authored and CZDanol committed Sep 5, 2024
1 parent a4eb54a commit 4eaf014
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/feature/belt_tuning/belt_tuning_wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class FSMBeltTuning final {
void phase_results_init(const Meta::InitCallbackArgs &) {
fsm_.change_data(fsm::serialize_data(BeltTuningWizardResultsData {
.frequency = static_cast<uint8_t>(result_->resonant_frequency_hz),
.tension = static_cast<uint8_t>(result_->tension_force_n * BeltTuningWizardResultsData::tension_mult),
.tension = static_cast<uint8_t>(std::clamp<float>(result_->tension_force_n * BeltTuningWizardResultsData::tension_mult, 0, 255)),
.belt_system = config_.belt_system,
}));
}
Expand Down
2 changes: 2 additions & 0 deletions src/gui/wizard/screen_belt_tuning_wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ class FrameResults : public FramePrompt {
std::array<char, 16> target_str;
_("Target").copyToRAM(target_str);
info.SetText(string_view_utf8::MakeCPUFLASH("%.1f N (%i Hz)\n\n%s: %.1f +- %.1f N").formatted(info_params, tension, (int)data.frequency, target_str.data(), params.target_tension_force_n, params.target_tension_force_dev_n));
info.Invalidate(); // Annoying reference comparison in SetText

graph.set_data(screen.graph_data);
}

Expand Down

0 comments on commit 4eaf014

Please sign in to comment.