mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-06 03:38:01 -05:00
* Add Missing Includes Across src/slic3r/GUI Every GUI source and header now directly includes the headers declaring what it uses, rather than relying on the precompiled header or transitive includes. Generated with clang-tidy misc-include-cleaner, plus one hand edit making CalibrationPanel.hpp self-contained. * Drop the OS-Specific Includes Added Outside Their Platform Guards GLib, GTK, D-Bus and POSIX headers are only used inside platform #if blocks, which already include them. Added unconditionally at the top of the file they broke the Windows build. * Add the clang-tidy Configuration That Generated These Includes Only misc-include-cleaner's missing-include check, with the headers it must never suggest: per-platform, internal and OS-specific ones that would break other platforms or are not meant to be included directly. * Match Windows Paths in the clang-tidy Ignore List Header paths use backslashes on Windows, so every / in a pattern is now [/\\]. The Windows SDK headers are ignored alongside the other OS-specific ones, and the list is one pattern per line. Suggested by @raistlin7447 from a Windows clang-cl run.
70 lines
2.7 KiB
C++
70 lines
2.7 KiB
C++
#include <nlohmann/json.hpp>
|
|
|
|
#include "DevConfig.h"
|
|
#include "DevUtil.h"
|
|
#include "json_diff.hpp"
|
|
|
|
using namespace nlohmann;
|
|
|
|
namespace Slic3r
|
|
{
|
|
|
|
bool DevConfig::SupportChamberTempDisplay() const
|
|
{
|
|
if (!m_support_chamber_temp_display.has_value()) {
|
|
return m_has_chamber;
|
|
}
|
|
|
|
return m_support_chamber_temp_display.value();
|
|
}
|
|
|
|
void DevConfig::ParseConfig(const json& print_json)
|
|
{
|
|
ParseChamberConfig(print_json);
|
|
ParsePrintOptionsConfig(print_json);
|
|
ParseCalibrationConfig(print_json);
|
|
}
|
|
|
|
void DevConfig::ParseChamberConfig(const json& print_json)
|
|
{
|
|
DevJsonValParser::ParseVal(print_json, "support_chamber", m_has_chamber);
|
|
|
|
if (print_json.contains("support_chamber_temp_display")) {
|
|
m_support_chamber_temp_display = DevJsonValParser::GetVal<bool>(print_json, "support_chamber_temp_display");
|
|
}
|
|
|
|
DevJsonValParser::ParseVal(print_json, "support_chamber_temp_edit", m_support_chamber_edit);
|
|
if (m_support_chamber_edit)
|
|
{
|
|
if (print_json.contains("support_chamber_temp_edit_range"))
|
|
{
|
|
const auto &support_champer_range = print_json["support_chamber_temp_edit_range"];
|
|
if (support_champer_range.is_array() && support_champer_range.size() > 1) {
|
|
m_chamber_temp_edit_min = support_champer_range[0];
|
|
m_chamber_temp_edit_max = support_champer_range[1];
|
|
}
|
|
}
|
|
|
|
DevJsonValParser::ParseVal(print_json, "support_chamber_temp_switch_heating", m_chamber_temp_switch_heat);
|
|
}
|
|
}
|
|
|
|
void DevConfig::ParsePrintOptionsConfig(const json& print_json)
|
|
{
|
|
DevJsonValParser::ParseVal(print_json, "support_first_layer_inspect", m_support_first_layer_inspect);
|
|
DevJsonValParser::ParseVal(print_json, "support_save_remote_print_file_to_storage", m_support_save_remote_print_file_to_storage);
|
|
DevJsonValParser::ParseVal(print_json, "support_ai_monitoring", m_support_ai_monitor);
|
|
DevJsonValParser::ParseVal(print_json, "support_print_without_sd", m_support_print_without_sd);
|
|
DevJsonValParser::ParseVal(print_json, "support_print_all", m_support_print_all);
|
|
}
|
|
|
|
void DevConfig::ParseCalibrationConfig(const json& print_json)
|
|
{
|
|
DevJsonValParser::ParseVal(print_json, "support_lidar_calibration", m_support_calibration_lidar);
|
|
DevJsonValParser::ParseVal(print_json, "support_nozzle_offset_calibration", m_support_calibration_nozzle_offset);
|
|
DevJsonValParser::ParseVal(print_json, "support_high_tempbed_calibration", m_support_calibration_high_temp_bed);
|
|
DevJsonValParser::ParseVal(print_json, "support_auto_flow_calibration", m_support_calibration_pa_flow_auto);
|
|
DevJsonValParser::ParseVal(print_json, "support_clump_position_calibration", m_support_calibration_clump_pos);
|
|
}
|
|
|
|
} |