mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 06:04:01 -06:00
Merge branch 'dev' of https://github.com/prusa3d/Slic3r into dev
This commit is contained in:
commit
4b25d3924b
52 changed files with 5698 additions and 537 deletions
|
@ -22,6 +22,14 @@
|
|||
|
||||
namespace Slic3r {
|
||||
|
||||
enum PrinterTechnology
|
||||
{
|
||||
// Fused Filament Fabrication
|
||||
ptFFF,
|
||||
// Stereolitography
|
||||
ptSLA,
|
||||
};
|
||||
|
||||
enum GCodeFlavor {
|
||||
gcfRepRap, gcfRepetier, gcfTeacup, gcfMakerWare, gcfMarlin, gcfSailfish, gcfMach3, gcfMachinekit,
|
||||
gcfSmoothie, gcfNoExtrusion,
|
||||
|
@ -48,7 +56,16 @@ enum FilamentType {
|
|||
ftPLA, ftABS, ftPET, ftHIPS, ftFLEX, ftSCAFF, ftEDGE, ftNGEN, ftPVA
|
||||
};
|
||||
|
||||
template<> inline t_config_enum_values& ConfigOptionEnum<GCodeFlavor>::get_enum_values() {
|
||||
template<> inline const t_config_enum_values& ConfigOptionEnum<PrinterTechnology>::get_enum_values() {
|
||||
static t_config_enum_values keys_map;
|
||||
if (keys_map.empty()) {
|
||||
keys_map["FFF"] = ptFFF;
|
||||
keys_map["SLA"] = ptSLA;
|
||||
}
|
||||
return keys_map;
|
||||
}
|
||||
|
||||
template<> inline const t_config_enum_values& ConfigOptionEnum<GCodeFlavor>::get_enum_values() {
|
||||
static t_config_enum_values keys_map;
|
||||
if (keys_map.empty()) {
|
||||
keys_map["reprap"] = gcfRepRap;
|
||||
|
@ -65,7 +82,7 @@ template<> inline t_config_enum_values& ConfigOptionEnum<GCodeFlavor>::get_enum_
|
|||
return keys_map;
|
||||
}
|
||||
|
||||
template<> inline t_config_enum_values& ConfigOptionEnum<PrintHostType>::get_enum_values() {
|
||||
template<> inline const t_config_enum_values& ConfigOptionEnum<PrintHostType>::get_enum_values() {
|
||||
static t_config_enum_values keys_map;
|
||||
if (keys_map.empty()) {
|
||||
keys_map["octoprint"] = htOctoPrint;
|
||||
|
@ -74,7 +91,7 @@ template<> inline t_config_enum_values& ConfigOptionEnum<PrintHostType>::get_enu
|
|||
return keys_map;
|
||||
}
|
||||
|
||||
template<> inline t_config_enum_values& ConfigOptionEnum<InfillPattern>::get_enum_values() {
|
||||
template<> inline const t_config_enum_values& ConfigOptionEnum<InfillPattern>::get_enum_values() {
|
||||
static t_config_enum_values keys_map;
|
||||
if (keys_map.empty()) {
|
||||
keys_map["rectilinear"] = ipRectilinear;
|
||||
|
@ -94,7 +111,7 @@ template<> inline t_config_enum_values& ConfigOptionEnum<InfillPattern>::get_enu
|
|||
return keys_map;
|
||||
}
|
||||
|
||||
template<> inline t_config_enum_values& ConfigOptionEnum<SupportMaterialPattern>::get_enum_values() {
|
||||
template<> inline const t_config_enum_values& ConfigOptionEnum<SupportMaterialPattern>::get_enum_values() {
|
||||
static t_config_enum_values keys_map;
|
||||
if (keys_map.empty()) {
|
||||
keys_map["rectilinear"] = smpRectilinear;
|
||||
|
@ -104,7 +121,7 @@ template<> inline t_config_enum_values& ConfigOptionEnum<SupportMaterialPattern>
|
|||
return keys_map;
|
||||
}
|
||||
|
||||
template<> inline t_config_enum_values& ConfigOptionEnum<SeamPosition>::get_enum_values() {
|
||||
template<> inline const t_config_enum_values& ConfigOptionEnum<SeamPosition>::get_enum_values() {
|
||||
static t_config_enum_values keys_map;
|
||||
if (keys_map.empty()) {
|
||||
keys_map["random"] = spRandom;
|
||||
|
@ -115,7 +132,7 @@ template<> inline t_config_enum_values& ConfigOptionEnum<SeamPosition>::get_enum
|
|||
return keys_map;
|
||||
}
|
||||
|
||||
template<> inline t_config_enum_values& ConfigOptionEnum<FilamentType>::get_enum_values() {
|
||||
template<> inline const t_config_enum_values& ConfigOptionEnum<FilamentType>::get_enum_values() {
|
||||
static t_config_enum_values keys_map;
|
||||
if (keys_map.empty()) {
|
||||
keys_map["PLA"] = ftPLA;
|
||||
|
@ -139,6 +156,11 @@ public:
|
|||
PrintConfigDef();
|
||||
|
||||
static void handle_legacy(t_config_option_key &opt_key, std::string &value);
|
||||
|
||||
private:
|
||||
void init_common_params();
|
||||
void init_fff_params();
|
||||
void init_sla_params();
|
||||
};
|
||||
|
||||
// The one and only global definition of SLic3r configuration options.
|
||||
|
@ -851,6 +873,73 @@ protected:
|
|||
}
|
||||
};
|
||||
|
||||
class SLAMaterialConfig : public StaticPrintConfig
|
||||
{
|
||||
STATIC_PRINT_CONFIG_CACHE(SLAMaterialConfig)
|
||||
public:
|
||||
ConfigOptionFloat layer_height;
|
||||
ConfigOptionFloat initial_layer_height;
|
||||
ConfigOptionFloat exposure_time;
|
||||
ConfigOptionFloat initial_exposure_time;
|
||||
ConfigOptionFloats material_correction_printing;
|
||||
ConfigOptionFloats material_correction_curing;
|
||||
protected:
|
||||
void initialize(StaticCacheBase &cache, const char *base_ptr)
|
||||
{
|
||||
OPT_PTR(layer_height);
|
||||
OPT_PTR(initial_layer_height);
|
||||
OPT_PTR(exposure_time);
|
||||
OPT_PTR(initial_exposure_time);
|
||||
OPT_PTR(material_correction_printing);
|
||||
OPT_PTR(material_correction_curing);
|
||||
}
|
||||
};
|
||||
|
||||
class SLAPrinterConfig : public StaticPrintConfig
|
||||
{
|
||||
STATIC_PRINT_CONFIG_CACHE(SLAPrinterConfig)
|
||||
public:
|
||||
ConfigOptionEnum<PrinterTechnology> printer_technology;
|
||||
ConfigOptionPoints bed_shape;
|
||||
ConfigOptionFloat max_print_height;
|
||||
ConfigOptionFloat display_width;
|
||||
ConfigOptionFloat display_height;
|
||||
ConfigOptionInt display_pixels_x;
|
||||
ConfigOptionInt display_pixels_y;
|
||||
ConfigOptionFloats printer_correction;
|
||||
protected:
|
||||
void initialize(StaticCacheBase &cache, const char *base_ptr)
|
||||
{
|
||||
OPT_PTR(printer_technology);
|
||||
OPT_PTR(bed_shape);
|
||||
OPT_PTR(max_print_height);
|
||||
OPT_PTR(display_width);
|
||||
OPT_PTR(display_height);
|
||||
OPT_PTR(display_pixels_x);
|
||||
OPT_PTR(display_pixels_y);
|
||||
OPT_PTR(printer_correction);
|
||||
}
|
||||
};
|
||||
|
||||
class SLAFullPrintConfig : public SLAPrinterConfig, public SLAMaterialConfig
|
||||
{
|
||||
STATIC_PRINT_CONFIG_CACHE_DERIVED(SLAFullPrintConfig)
|
||||
SLAFullPrintConfig() : SLAPrinterConfig(0), SLAMaterialConfig(0) { initialize_cache(); *this = s_cache_SLAFullPrintConfig.defaults(); }
|
||||
|
||||
public:
|
||||
// Validate the SLAFullPrintConfig. Returns an empty string on success, otherwise an error message is returned.
|
||||
// std::string validate();
|
||||
|
||||
protected:
|
||||
// Protected constructor to be called to initialize ConfigCache::m_default.
|
||||
SLAFullPrintConfig(int) : SLAPrinterConfig(0), SLAMaterialConfig(0) {}
|
||||
void initialize(StaticCacheBase &cache, const char *base_ptr)
|
||||
{
|
||||
this->SLAPrinterConfig ::initialize(cache, base_ptr);
|
||||
this->SLAMaterialConfig::initialize(cache, base_ptr);
|
||||
}
|
||||
};
|
||||
|
||||
#undef STATIC_PRINT_CONFIG_CACHE
|
||||
#undef STATIC_PRINT_CONFIG_CACHE_BASE
|
||||
#undef STATIC_PRINT_CONFIG_CACHE_DERIVED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue