FIX: display failed when the flow rate is 0 or too large

Change-Id: I20af5b0badba63a12129fb571524a152b591d974
This commit is contained in:
zhimin.zeng 2023-08-04 16:04:24 +08:00 committed by Lane.Wei
parent 3aefe96f26
commit aa96aba89d
1 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,8 @@
namespace Slic3r { namespace GUI {
#define CALIBRATION_SAVE_INPUT_SIZE wxSize(FromDIP(240), FromDIP(24))
#define FLOW_RATE_MAX_VALUE 1.15
static wxString get_default_name(wxString filament_name, CalibMode mode){
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
for (auto it = preset_bundle->filaments.begin(); it != preset_bundle->filaments.end(); it++) {
@ -945,7 +947,7 @@ void CalibrationFlowX1SavePage::sync_cali_result(const std::vector<FlowRatioCali
part_failed = true;
for (auto& item : cali_result) {
bool result_failed = false;
if (item.confidence != 0) {
if (item.confidence != 0 || item.flow_ratio < 1e-3 || item.flow_ratio > FLOW_RATE_MAX_VALUE) {
result_failed = true;
part_failed = true;
}