NEW: add limitation of bed temperature
Change-Id: Ib25f28d8803a022678d67ee05cf1d0c48e8727c4 Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
@@ -1590,6 +1590,7 @@ void StatusPanel::update_temp_ctrl(MachineObject *obj)
|
||||
if (!obj) return;
|
||||
|
||||
m_tempCtrl_bed->SetCurrTemp((int) obj->bed_temp);
|
||||
m_tempCtrl_bed->SetMaxTemp(obj->get_bed_temperature_limit());
|
||||
|
||||
// update temprature if not input temp target
|
||||
if (m_temp_bed_timeout > 0) {
|
||||
@@ -2243,6 +2244,12 @@ void StatusPanel::on_set_bed_temp()
|
||||
long bed_temp;
|
||||
if (str.ToLong(&bed_temp) && obj) {
|
||||
set_hold_count(m_temp_bed_timeout);
|
||||
int limit = obj->get_bed_temperature_limit();
|
||||
if (bed_temp >= limit) {
|
||||
BOOST_LOG_TRIVIAL(info) << "can not set over limit = " << limit << ", set temp = " << bed_temp;
|
||||
bed_temp = limit;
|
||||
m_tempCtrl_bed->SetTagTemp(wxString::Format("%d", bed_temp));
|
||||
}
|
||||
obj->command_set_bed(bed_temp);
|
||||
}
|
||||
} catch (...) {
|
||||
|
||||
Reference in New Issue
Block a user