mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-22 16:21:24 -06:00
Merge branch 'project_specific_config' into wipe_tower_improvements
This commit is contained in:
commit
e864238609
10 changed files with 77 additions and 52 deletions
|
@ -630,15 +630,19 @@ elseif (NOT MSVC)
|
|||
endif ()
|
||||
|
||||
if (MSVC)
|
||||
# Here we associate some additional properties with the MSVC projects to enable compilation and debugging out of the box.
|
||||
# It seems a props file needs to be copied to the same dir as the proj file, otherwise MSVC doesn't load it up.
|
||||
# For copying, the configure_file() function seems to work much better than the file() function.
|
||||
configure_file("${PROJECT_SOURCE_DIR}/cmake/msvc/xs.wperl64d.props" ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
|
||||
set_target_properties(XS PROPERTIES VS_USER_PROPS "xs.wperl64d.props")
|
||||
configure_file("${PROJECT_SOURCE_DIR}/cmake/msvc/slic3r.wperl64d.props" ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
|
||||
set_target_properties(slic3r PROPERTIES VS_USER_PROPS "slic3r.wperl64d.props")
|
||||
endif ()
|
||||
# Here we associate some additional properties with the MSVC project to enable compilation and debugging out of the box.
|
||||
set_target_properties(XS PROPERTIES VS_USER_PROPS "${PROJECT_SOURCE_DIR}/cmake/msvc/xs.wperl64d.props")
|
||||
endif()
|
||||
|
||||
# l10n
|
||||
set(L10N_DIR "${PROJECT_SOURCE_DIR}/resources/localization")
|
||||
add_custom_target(pot
|
||||
COMMAND xgettext --keyword=L --from-code=UTF-8 --debug
|
||||
-f "${L10N_DIR}/list.txt"
|
||||
-o "${L10N_DIR}/Slic3rPE.pot"
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Generate pot file from strings in the source tree"
|
||||
)
|
||||
|
||||
# Installation
|
||||
install(TARGETS XS DESTINATION ${PERL_VENDORARCH}/auto/Slic3r/XS)
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
|
||||
namespace Slic3r {
|
||||
|
||||
static std::vector<std::string> s_project_options {
|
||||
};
|
||||
|
||||
PresetBundle::PresetBundle() :
|
||||
prints(Preset::TYPE_PRINT, Preset::print_options()),
|
||||
filaments(Preset::TYPE_FILAMENT, Preset::filament_options()),
|
||||
|
@ -56,6 +59,8 @@ PresetBundle::PresetBundle() :
|
|||
this->filaments.load_bitmap_default("spool.png");
|
||||
this->printers .load_bitmap_default("printer_empty.png");
|
||||
this->load_compatible_bitmaps();
|
||||
|
||||
this->project_config.apply_only(FullPrintConfig::defaults(), s_project_options);
|
||||
}
|
||||
|
||||
PresetBundle::~PresetBundle()
|
||||
|
@ -223,6 +228,7 @@ DynamicPrintConfig PresetBundle::full_config() const
|
|||
out.apply(FullPrintConfig());
|
||||
out.apply(this->prints.get_edited_preset().config);
|
||||
out.apply(this->printers.get_edited_preset().config);
|
||||
out.apply(this->project_config);
|
||||
|
||||
auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(out.option("nozzle_diameter"));
|
||||
size_t num_extruders = nozzle_diameter->values.size();
|
||||
|
@ -412,6 +418,9 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool
|
|||
}
|
||||
}
|
||||
|
||||
// 4) Load the project config values (the per extruder wipe matrix etc).
|
||||
this->project_config.apply_only(config, s_project_options);
|
||||
|
||||
this->update_compatible_with_printer(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,11 @@ public:
|
|||
// extruders.size() should be the same as printers.get_edited_preset().config.nozzle_diameter.size()
|
||||
std::vector<std::string> filament_presets;
|
||||
|
||||
// The project configuration values are kept separated from the print/filament/printer preset,
|
||||
// they are being serialized / deserialized from / to the .amf, .3mf, .config, .gcode,
|
||||
// and they are being used by slicing core.
|
||||
DynamicPrintConfig project_config;
|
||||
|
||||
bool has_defauls_only() const
|
||||
{ return prints.size() <= 1 && filaments.size() <= 1 && printers.size() <= 1; }
|
||||
|
||||
|
|
|
@ -161,6 +161,8 @@ PresetCollection::arrayref()
|
|||
Ref<PresetCollection> print() %code%{ RETVAL = &THIS->prints; %};
|
||||
Ref<PresetCollection> filament() %code%{ RETVAL = &THIS->filaments; %};
|
||||
Ref<PresetCollection> printer() %code%{ RETVAL = &THIS->printers; %};
|
||||
Ref<DynamicPrintConfig> project_config() %code%{ RETVAL = &THIS->project_config; %};
|
||||
|
||||
bool has_defauls_only();
|
||||
|
||||
std::vector<std::string> filament_presets() %code%{ RETVAL = THIS->filament_presets; %};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue