FIX: modify the max k value
jira: none Change-Id: I739f58d4d80e557e1a320af38cc68d7d4e967577
This commit is contained in:
parent
e630c0672a
commit
f03dbdeb61
|
@ -16,7 +16,7 @@ namespace GUI {
|
|||
#define EDIT_HISTORY_DIALOG_INPUT_SIZE wxSize(FromDIP(160), FromDIP(24))
|
||||
#define NEW_HISTORY_DIALOG_INPUT_SIZE wxSize(FromDIP(250), FromDIP(24))
|
||||
#define HISTORY_WINDOW_ITEMS_COUNT 5
|
||||
static const wxString k_tips = "Please input a valid value (K in 0~0.3)";
|
||||
static const wxString k_tips = wxString::Format(_L("Please input a valid value (K in %.1f~%.1f)"), MIN_PA_K_VALUE, MAX_PA_K_VALUE);
|
||||
|
||||
static wxString get_preset_name_by_filament_id(std::string filament_id)
|
||||
{
|
||||
|
@ -472,7 +472,7 @@ void EditCalibrationHistoryDialog::on_save(wxCommandEvent& event) {
|
|||
|
||||
float k = 0.0f;
|
||||
if (!CalibUtils::validate_input_k_value(m_k_value->GetTextCtrl()->GetValue(), &k)) {
|
||||
MessageDialog msg_dlg(nullptr, _L(k_tips), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
MessageDialog msg_dlg(nullptr, k_tips, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
|
@ -678,7 +678,7 @@ void NewCalibrationHistoryDialog::on_ok(wxCommandEvent &event)
|
|||
|
||||
float k = 0.0f;
|
||||
if (!CalibUtils::validate_input_k_value(m_k_value->GetTextCtrl()->GetValue(), &k)) {
|
||||
MessageDialog msg_dlg(nullptr, _L(k_tips), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
MessageDialog msg_dlg(nullptr, k_tips, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "../../libslic3r/Calib.hpp"
|
||||
#include "Tabbook.hpp"
|
||||
#include "CaliHistoryDialog.hpp"
|
||||
#include "CalibUtils.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
|
@ -15,8 +16,6 @@ wxDEFINE_EVENT(EVT_DEVICE_CHANGED, wxCommandEvent);
|
|||
wxDEFINE_EVENT(EVT_CALIBRATION_JOB_FINISHED, wxCommandEvent);
|
||||
|
||||
static const wxString NA_STR = _L("N/A");
|
||||
static const float MIN_PA_K_VALUE = 0.0;
|
||||
static const float MAX_PA_K_VALUE = 0.3;
|
||||
static const float MIN_PA_K_VALUE_STEP = 0.001;
|
||||
static const int MAX_PA_HISTORY_RESULTS_NUMS = 16;
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@ namespace Slic3r { namespace GUI {
|
|||
|
||||
#define CALIBRATION_SAVE_INPUT_SIZE wxSize(FromDIP(240), FromDIP(24))
|
||||
#define FLOW_RATE_MAX_VALUE 1.15
|
||||
static const wxString k_tips = "Please input a valid value (K in 0~0.3)";
|
||||
|
||||
static const wxString k_tips = wxString::Format(_L("Please input a valid value (K in %.1f~%.1f)"), MIN_PA_K_VALUE, MAX_PA_K_VALUE);
|
||||
|
||||
static wxString get_default_name(wxString filament_name, CalibMode mode){
|
||||
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
|
||||
|
@ -362,7 +363,7 @@ void CaliPASaveAutoPanel::save_to_result_from_widgets(wxWindow* window, bool* ou
|
|||
if (input->get_type() == GridTextInputType::K) {
|
||||
float k = 0.0f;
|
||||
if (!CalibUtils::validate_input_k_value(input->GetTextCtrl()->GetValue(), &k)) {
|
||||
*out_msg = _L("Please input a valid value (K in 0~0.3)");
|
||||
*out_msg = k_tips;
|
||||
*out_is_valid = false;
|
||||
}
|
||||
else
|
||||
|
@ -546,7 +547,7 @@ bool CaliPASaveManualPanel::get_result(PACalibResult& out_result) {
|
|||
// Check if the value is valid
|
||||
float k;
|
||||
if (!CalibUtils::validate_input_k_value(m_k_val->GetTextCtrl()->GetValue(), &k)) {
|
||||
MessageDialog msg_dlg(nullptr, _L(k_tips), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
MessageDialog msg_dlg(nullptr, k_tips, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return false;
|
||||
}
|
||||
|
@ -694,7 +695,7 @@ void CaliPASaveP1PPanel::set_pa_cali_method(ManualPaCaliMethod method)
|
|||
bool CaliPASaveP1PPanel::get_result(float* out_k, float* out_n){
|
||||
// Check if the value is valid
|
||||
if (!CalibUtils::validate_input_k_value(m_k_val->GetTextCtrl()->GetValue(), out_k)) {
|
||||
MessageDialog msg_dlg(nullptr, _L(k_tips), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
MessageDialog msg_dlg(nullptr, k_tips, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
const float MIN_PA_K_VALUE = 0.0;
|
||||
const float MAX_PA_K_VALUE = 1.0;
|
||||
|
||||
std::shared_ptr<PrintJob> CalibUtils::print_job;
|
||||
wxString wxstr_temp_dir = fs::path(fs::temp_directory_path() / "calib").wstring();
|
||||
static const std::string temp_dir = wxstr_temp_dir.utf8_string();
|
||||
|
@ -226,7 +229,7 @@ bool CalibUtils::validate_input_k_value(wxString k_text, float* output_value)
|
|||
;
|
||||
}
|
||||
|
||||
if (k_value < 0 || k_value > 0.3) {
|
||||
if (k_value < MIN_PA_K_VALUE || k_value > MAX_PA_K_VALUE) {
|
||||
*output_value = default_k;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,9 @@ class ProgressIndicator;
|
|||
class Preset;
|
||||
|
||||
namespace GUI {
|
||||
extern const float MIN_PA_K_VALUE;
|
||||
extern const float MAX_PA_K_VALUE;
|
||||
|
||||
class CalibInfo
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue