mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-28 21:32:11 +00:00
ENH: enable to enter 0 as default cooling temperature
jira: [STUDIO-11360] Change-Id: Iaede485340c1a88a1a42eceeadf772332fe369a0 (cherry picked from commit 1fd53404176795581cb2fe1e6d69bfe425a04c23)
This commit is contained in:
@@ -61,25 +61,21 @@ bool TempInput::CheckIsValidVal(bool show_warning)
|
||||
|
||||
/*show temperature range warnings*/
|
||||
auto tempint = std::stoi(temp.ToStdString());
|
||||
if (tempint > max_temp)
|
||||
if (additional_temps.count(tempint) == 0)
|
||||
{
|
||||
if (show_warning)
|
||||
if (tempint > max_temp)
|
||||
{
|
||||
Warning(true, WARNING_TOO_HIGH);
|
||||
if (show_warning) { Warning(true, WARNING_TOO_HIGH); }
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
else if (tempint < min_temp)
|
||||
{
|
||||
if (show_warning)
|
||||
else if (tempint < min_temp)
|
||||
{
|
||||
Warning(true, WARNING_TOO_LOW);
|
||||
if (show_warning) { Warning(true, WARNING_TOO_LOW); }
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <wx/stattext.h>
|
||||
#include "StaticBox.hpp"
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
wxDECLARE_EVENT(wxCUSTOMEVT_SET_TEMP_FINISH, wxCommandEvent);
|
||||
|
||||
enum TempInputType {
|
||||
@@ -34,6 +36,7 @@ class TempInput : public wxNavigationEnabled<StaticBox>
|
||||
|
||||
int max_temp = 0;
|
||||
int min_temp = 0;
|
||||
std::unordered_set<int> additional_temps;
|
||||
bool warning_mode = false;
|
||||
TempInputType m_input_type;
|
||||
|
||||
@@ -96,6 +99,7 @@ public:
|
||||
|
||||
void SetMaxTemp(int temp);
|
||||
void SetMinTemp(int temp);
|
||||
void AddTemp(int temp) { additional_temps.insert(temp); };
|
||||
|
||||
int GetType() { return temp_type; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user