mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-01 20:40:41 -07:00
ENH: limit chamber temperature setting in cooling filt mode
Jira: [STUDIO-14035] Change-Id: I894ecc3f1628bbdaa86fcfd8a4420e59111af7bb (cherry picked from commit 5e95c6bcc8aa0b89661f27a4f123442857f7fec7)
This commit is contained in:
parent
2c675b1365
commit
c6db0f0f85
3 changed files with 61 additions and 48 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#include <nlohmann/json.hpp>
|
||||
#include "DevFan.h"
|
||||
#include "DevFan.h"
|
||||
#include <wx/app.h>
|
||||
#include "slic3r/GUI/DeviceManager.hpp"
|
||||
#include "slic3r/GUI/GUI.hpp"
|
||||
|
|
@ -158,62 +158,62 @@ void Slic3r::DevFan::ParseV2_0(const json &print_json) {
|
|||
|
||||
|
||||
|
||||
void Slic3r::DevFan::ParseV3_0(const json &device)
|
||||
void Slic3r::DevFan::ParseV3_0(const json &device)
|
||||
{
|
||||
if (device.contains("airduct")) {
|
||||
m_air_duct_data.curren_mode = -1;
|
||||
m_air_duct_data.modes.clear();
|
||||
m_air_duct_data.parts.clear();
|
||||
if (device.contains("airduct")) {
|
||||
is_support_airduct = true;
|
||||
m_air_duct_data.curren_mode = -1;
|
||||
m_air_duct_data.modes.clear();
|
||||
m_air_duct_data.parts.clear();
|
||||
|
||||
m_air_duct_data.curren_mode = device["airduct"]["modeCur"].get<int>();
|
||||
m_air_duct_data.curren_mode = device["airduct"]["modeCur"].get<int>();
|
||||
|
||||
const json &airduct = device["airduct"];
|
||||
if (airduct.contains("modeCur")) { m_air_duct_data.curren_mode = airduct["modeCur"].get<int>(); }
|
||||
if (airduct.contains("subMode")) { m_air_duct_data.m_sub_mode = airduct["subMode"].get<int>(); }
|
||||
if (airduct.contains("modeList") && airduct["modeList"].is_array()) {
|
||||
auto list = airduct["modeList"].get<std::vector<json>>();
|
||||
const json &airduct = device["airduct"];
|
||||
if (airduct.contains("modeCur")) { m_air_duct_data.curren_mode = airduct["modeCur"].get<int>(); }
|
||||
if (airduct.contains("subMode")) { m_air_duct_data.m_sub_mode = airduct["subMode"].get<int>(); }
|
||||
if (airduct.contains("modeList") && airduct["modeList"].is_array()) {
|
||||
auto list = airduct["modeList"].get<std::vector<json>>();
|
||||
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
// only show 2 mode for o
|
||||
if (m_owner->is_series_o() && i >= 2) { break; }
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
// only show 2 mode for o
|
||||
if (m_owner->is_series_o() && i >= 2) { break; }
|
||||
|
||||
json mode_json = list[i];
|
||||
AirMode mode;
|
||||
if (mode_json.contains("modeId")) mode.id = mode_json["modeId"].get<int>();
|
||||
if (mode_json.contains("ctrl")) {
|
||||
for (auto it_mode_ctrl = mode_json["ctrl"].begin(); it_mode_ctrl != mode_json["ctrl"].end(); it_mode_ctrl++) {
|
||||
mode.ctrl.push_back((*it_mode_ctrl).get<int>() >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
if (mode_json.contains("off")) {
|
||||
for (auto it_mode_off = mode_json["off"].begin(); it_mode_off != mode_json["off"].end(); *it_mode_off++) {
|
||||
mode.off.push_back((*it_mode_off).get<int>() >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
if (AIR_DUCT(mode.id) == AIR_DUCT::AIR_DUCT_EXHAUST) { continue; } /*STUDIO-12796*/
|
||||
m_air_duct_data.modes[mode.id] = mode;
|
||||
json mode_json = list[i];
|
||||
AirMode mode;
|
||||
if (mode_json.contains("modeId")) mode.id = mode_json["modeId"].get<int>();
|
||||
if (mode_json.contains("ctrl")) {
|
||||
for (auto it_mode_ctrl = mode_json["ctrl"].begin(); it_mode_ctrl != mode_json["ctrl"].end(); it_mode_ctrl++) {
|
||||
mode.ctrl.push_back((*it_mode_ctrl).get<int>() >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
if (airduct.contains("parts") && airduct["parts"].is_array()) {
|
||||
for (auto it_part = airduct["parts"].begin(); it_part != airduct["parts"].end(); it_part++) {
|
||||
int state = (*it_part)["state"].get<int>();
|
||||
int range = (*it_part)["range"].get<int>();
|
||||
|
||||
AirParts part;
|
||||
part.type = m_owner->get_flag_bits((*it_part)["id"].get<int>(), 0, 4);
|
||||
part.id = m_owner->get_flag_bits((*it_part)["id"].get<int>(), 4, 8);
|
||||
part.func = (*it_part)["func"].get<int>();
|
||||
part.state = m_owner->get_flag_bits(state, 0, 8);
|
||||
part.range_start = m_owner->get_flag_bits(range, 0, 16);
|
||||
part.range_end = m_owner->get_flag_bits(range, 16, 16);
|
||||
|
||||
m_air_duct_data.parts.push_back(part);
|
||||
if (mode_json.contains("off")) {
|
||||
for (auto it_mode_off = mode_json["off"].begin(); it_mode_off != mode_json["off"].end(); *it_mode_off++) {
|
||||
mode.off.push_back((*it_mode_off).get<int>() >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
if (AIR_DUCT(mode.id) == AIR_DUCT::AIR_DUCT_EXHAUST) { continue; } /*STUDIO-12796*/
|
||||
m_air_duct_data.modes[mode.id] = mode;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (airduct.contains("parts") && airduct["parts"].is_array()) {
|
||||
for (auto it_part = airduct["parts"].begin(); it_part != airduct["parts"].end(); it_part++) {
|
||||
int state = (*it_part)["state"].get<int>();
|
||||
int range = (*it_part)["range"].get<int>();
|
||||
|
||||
AirParts part;
|
||||
part.type = m_owner->get_flag_bits((*it_part)["id"].get<int>(), 0, 4);
|
||||
part.id = m_owner->get_flag_bits((*it_part)["id"].get<int>(), 4, 8);
|
||||
part.func = (*it_part)["func"].get<int>();
|
||||
part.state = m_owner->get_flag_bits(state, 0, 8);
|
||||
part.range_start = m_owner->get_flag_bits(range, 0, 16);
|
||||
part.range_end = m_owner->get_flag_bits(range, 16, 16);
|
||||
|
||||
m_air_duct_data.parts.push_back(part);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ public:
|
|||
};
|
||||
|
||||
bool is_at_heating_mode() const { return m_air_duct_data.curren_mode == AIR_DUCT_HEATING_INTERNAL_FILT; };
|
||||
bool is_at_cooling_mode() const { return m_air_duct_data.curren_mode == AIR_DUCT_COOLING_FILT; };
|
||||
|
||||
void SetSupportCoolingFilter(bool enable) { m_air_duct_data.m_support_cooling_filter = enable; }
|
||||
AirDuctData GetAirDuctData() { return m_air_duct_data; };
|
||||
|
|
@ -123,6 +124,7 @@ public:
|
|||
void ParseV3_0(const json &print_json);
|
||||
|
||||
public:
|
||||
bool GetSupportAirduct() { return is_support_airduct; };
|
||||
bool GetSupportAuxFanData() { return is_support_aux_fan; };
|
||||
bool GetSupportChamberFan() { return is_support_aux_fan; };
|
||||
int GetHeatBreakFanSpeed() { return heatbreak_fan_speed; }
|
||||
|
|
@ -137,6 +139,7 @@ private:
|
|||
|
||||
bool is_support_aux_fan{false};
|
||||
bool is_support_chamber_fan{false};
|
||||
bool is_support_airduct{false};
|
||||
|
||||
int heatbreak_fan_speed = 0;
|
||||
int cooling_fan_speed = 0;
|
||||
|
|
|
|||
|
|
@ -4092,7 +4092,17 @@ void StatusPanel::on_set_chamber_temp()
|
|||
m_tempCtrl_chamber->Warning(false);
|
||||
}
|
||||
|
||||
if (!obj->GetFan()->is_at_heating_mode() && chamber_temp >= obj->GetConfig()->GetChamberTempSwitchHeat())
|
||||
if(obj->is_in_printing() && obj->GetFan()->GetSupportAirduct() && obj->GetFan()->is_at_cooling_mode())
|
||||
{
|
||||
#ifndef __APPLE__
|
||||
MessageDialog champer_switch_head_dlg(this, _L("Chamber temperature cannot be changed in cooling mode while printing."), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
#else
|
||||
wxMessageDialog champer_switch_head_dlg(this, _L("Chamber temperature cannot be changed in cooling mode while printing."), wxEmptyString, wxICON_WARNING | wxOK);
|
||||
#endif
|
||||
champer_switch_head_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
else if (!obj->GetFan()->is_at_heating_mode() && chamber_temp >= obj->GetConfig()->GetChamberTempSwitchHeat())
|
||||
{
|
||||
#ifndef __APPLE__
|
||||
MessageDialog champer_switch_head_dlg(this, _L("If the chamber temperature exceeds 40\u2103, the system will automatically switch to heating mode. "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue