mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-20 10:52:47 +00:00
ENH: update airducts
jira: [STUDIO-13296] Change-Id: I5cdb34cc254933be9a91313462a6b03b0dca117b (cherry picked from commit fbf88ce6f226496723344e60f57632eadfaf5ee9)
This commit is contained in:
@@ -108,6 +108,53 @@ std::string DevPrinterConfigUtil::get_fan_text(const std::string& type_str, cons
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string DevPrinterConfigUtil::get_fan_text(const std::string& type_str, int airduct_mode, int airduct_func, int submode)
|
||||
{
|
||||
std::vector<std::string> filaments;
|
||||
std::string config_file = m_resource_file_path + "/printers/" + type_str + ".json";
|
||||
boost::nowide::ifstream json_file(config_file.c_str());
|
||||
try
|
||||
{
|
||||
json jj;
|
||||
if (json_file.is_open())
|
||||
{
|
||||
json_file >> jj;
|
||||
if (jj.contains("00.00.00.00"))
|
||||
{
|
||||
json const& printer = jj["00.00.00.00"];
|
||||
if (!printer.contains("fan"))
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
json const& fan_item = printer["fan"];
|
||||
const auto& airduct_mode_str = std::to_string(airduct_mode);
|
||||
if (!fan_item.contains(airduct_mode_str))
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
json const& airduct_item = fan_item[airduct_mode_str];
|
||||
const auto& airduct_func_str = std::to_string(airduct_func);
|
||||
if (airduct_item.contains(airduct_func_str))
|
||||
{
|
||||
const auto& airduct_func_item = airduct_item[airduct_func_str];
|
||||
if (airduct_func_item.is_object())
|
||||
{
|
||||
return airduct_func_item[std::to_string(submode)].get<std::string>();
|
||||
}
|
||||
else if (airduct_func_item.is_string())
|
||||
{
|
||||
return airduct_func_item.get<std::string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (...) {}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::map<std::string, std::vector<std::string>> DevPrinterConfigUtil::get_all_subseries(std::string type_str)
|
||||
{
|
||||
std::vector<wxString> m_files;
|
||||
|
||||
@@ -66,6 +66,7 @@ public:
|
||||
|
||||
/*fan*/
|
||||
static std::string get_fan_text(const std::string& type_str, const std::string& key);
|
||||
static std::string get_fan_text(const std::string& type_str, int airduct_mode, int airduct_func, int submode);
|
||||
|
||||
/*extruder*/
|
||||
static bool get_printer_can_set_nozzle(std::string type_str) { return get_value_from_config<bool>(type_str, "enable_set_nozzle_info"); }// can set nozzle from studio
|
||||
|
||||
@@ -204,7 +204,7 @@ void Slic3r::DevFan::ParseV2_0(const json &print_json) {
|
||||
|
||||
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, 9);
|
||||
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);
|
||||
|
||||
@@ -11,7 +11,7 @@ typedef std::function<void(const json &)> CommandCallBack;
|
||||
|
||||
|
||||
|
||||
enum AIR_FUN {
|
||||
enum AIR_FUN : int {
|
||||
FAN_HEAT_BREAK_0_IDX = 0,
|
||||
FAN_COOLING_0_AIRDOOR = 1,
|
||||
FAN_REMOTE_COOLING_0_IDX = 2,
|
||||
@@ -19,13 +19,14 @@ enum AIR_FUN {
|
||||
FAN_HEAT_BREAK_1_IDX = 4,
|
||||
FAN_MC_BOARD_0_IDX = 5,
|
||||
FAN_INNNER_LOOP_FAN_0_IDX = 6,
|
||||
FAN_TOTAL_COUNT = 7
|
||||
FAN_TOTAL_COUNT = 7,
|
||||
FAN_REMOTE_COOLING_1_IDX = 10
|
||||
};
|
||||
|
||||
enum AIR_DOOR { AIR_DOOR_FUNC_CHAMBER = 0, AIR_DOOR_FUNC_INNERLOOP, AIR_DOOR_FUNC_TOP };
|
||||
|
||||
|
||||
enum AIR_DUCT {
|
||||
enum AIR_DUCT : int {
|
||||
AIR_DUCT_NONE = -1,
|
||||
AIR_DUCT_COOLING_FILT = 0,
|
||||
AIR_DUCT_HEATING_INTERNAL_FILT,
|
||||
@@ -87,7 +88,7 @@ public:
|
||||
};
|
||||
|
||||
bool IsSupportCoolingFilter() const { return m_support_cooling_filter; }
|
||||
bool IsCoolingFilerOn() const { return m_sub_mode == 0; }
|
||||
bool IsCoolingFilerOn() const { return m_sub_mode == 1; }
|
||||
};
|
||||
|
||||
class DevFan
|
||||
|
||||
Reference in New Issue
Block a user