Initial ElegooLink Support (Only Centauri Carbon Tested)

This commit is contained in:
Dark98
2026-01-22 07:42:14 +00:00
parent 261ba81e06
commit f352a02b9f
13 changed files with 613 additions and 12 deletions
+23
View File
@@ -1173,6 +1173,29 @@ void GCodeGenerator::_do_export(Print& print, GCodeOutputStream &file, Thumbnail
this->placeholder_parser().set("has_wipe_tower", has_wipe_tower);
this->placeholder_parser().set("has_single_extruder_multi_material_priming", has_wipe_tower && print.config().single_extruder_multi_material_priming);
this->placeholder_parser().set("total_toolchanges", tool_ordering.toolchanges_count());
{
const char *bed_type_label = (print.config().elegoolink_bed_type.value == ElegooBedType::PTE) ? "Side A" : "Side B";
this->placeholder_parser().set("curr_bed_type", new ConfigOptionString(bed_type_label));
}
{
this->placeholder_parser().set("printable_height", new ConfigOptionFloat(print.config().max_print_height.value));
this->placeholder_parser().set("nozzle_temperature_initial_layer", new ConfigOptionInt(print.config().first_layer_temperature.get_at(initial_extruder_id)));
this->placeholder_parser().set("bed_temperature_initial_layer_single", new ConfigOptionInt(print.config().first_layer_bed_temperature.get_at(initial_extruder_id)));
this->placeholder_parser().set("initial_no_support_extruder", new ConfigOptionInt(int(initial_extruder_id)));
this->placeholder_parser().set("outer_wall_acceleration", new ConfigOptionFloat(print.config().external_perimeter_acceleration.value));
if (const ConfigOption *opt = print.config().optptr("enable_pressure_advance"); opt != nullptr) {
this->placeholder_parser().set("enable_pressure_advance", opt->clone());
} else {
this->placeholder_parser().set("enable_pressure_advance", new ConfigOptionBools(std::max<size_t>(1, print.config().nozzle_diameter.values.size()), false));
}
if (const ConfigOption *opt = print.config().optptr("pressure_advance"); opt != nullptr) {
this->placeholder_parser().set("pressure_advance", opt->clone());
} else {
this->placeholder_parser().set("pressure_advance", new ConfigOptionFloat(0.0));
}
}
{
BoundingBoxf bbox(print.config().bed_shape.values);
assert(bbox.defined);
+6 -2
View File
@@ -525,7 +525,8 @@ static std::vector<std::string> s_Preset_printer_options {
"cooling_tube_length", "high_current_on_filament_swap", "parking_pos_retraction", "extra_loading_move", "multimaterial_purging",
"max_print_height", "default_print_profile", "inherits",
"remaining_times", "silent_mode",
"machine_limits_usage", "thumbnails", "thumbnails_format"
"machine_limits_usage", "thumbnails", "thumbnails_format",
"elegoolink_timelapse", "elegoolink_bed_leveling", "elegoolink_bed_type"
};
static std::vector<std::string> s_Preset_sla_print_options {
@@ -1702,7 +1703,10 @@ static std::vector<std::string> s_PhysicalPrinter_opts {
// HTTP digest authentization (RFC 2617)
"printhost_user",
"printhost_password",
"printhost_ssl_ignore_revoke"
"printhost_ssl_ignore_revoke",
"elegoolink_timelapse",
"elegoolink_bed_leveling",
"elegoolink_bed_type"
};
const std::vector<std::string>& PhysicalPrinter::printer_options()
+3
View File
@@ -1622,6 +1622,9 @@ std::string Print::output_filename(const std::string &filename_base) const
DynamicConfig config = this->finished() ? this->print_statistics().config() : this->print_statistics().placeholders();
config.set_key_value("num_extruders", new ConfigOptionInt((int)m_config.nozzle_diameter.size()));
config.set_key_value("default_output_extension", new ConfigOptionString(".gcode"));
config.set_key_value("nozzle_diameter", new ConfigOptionFloats(m_config.nozzle_diameter.values));
config.set_key_value("filament_type", new ConfigOptionStrings(m_config.filament_type.values));
config.set_key_value("layer_height", new ConfigOptionFloat(m_default_object_config.layer_height.value));
// Handle output_filename_format. There is a hack related to binary G-codes: gcode / bgcode substitution.
std::string output_filename_format = m_config.output_filename_format.value;
+2
View File
@@ -56,6 +56,7 @@ void PrintBase::update_object_placeholders(DynamicConfig &config, const std::str
const std::string input_filename_base = input_filename.substr(0, input_filename.find_last_of("."));
// config.set_key_value("input_filename", new ConfigOptionString(input_filename_base + default_output_ext));
config.set_key_value("input_filename_base", new ConfigOptionString(input_filename_base));
config.set_key_value("_input_filename_base", new ConfigOptionString(input_filename_base));
}
}
@@ -72,6 +73,7 @@ std::string PrintBase::output_filename(const std::string &format, const std::str
if (! filename_base.empty()) {
// cfg.set_key_value("input_filename", new ConfigOptionString(filename_base + default_ext));
cfg.set_key_value("input_filename_base", new ConfigOptionString(filename_base));
cfg.set_key_value("_input_filename_base", new ConfigOptionString(filename_base));
}
try {
boost::filesystem::path filename = format.empty() ?
+34 -1
View File
@@ -104,6 +104,7 @@ static const t_config_enum_values s_keys_map_PrintHostType {
{ "repetier", htRepetier },
{ "mks", htMKS },
{ "prusaconnectnew", htPrusaConnectNew },
{ "elegoolink", htElegooLink },
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(PrintHostType)
@@ -244,6 +245,12 @@ static const t_config_enum_values s_keys_map_GCodeThumbnailsFormat = {
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(GCodeThumbnailsFormat)
static const t_config_enum_values s_keys_map_ElegooBedType = {
{ "pte", int(ElegooBedType::PTE) },
{ "pc", int(ElegooBedType::PC) }
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(ElegooBedType)
static const t_config_enum_values s_keys_map_ForwardCompatibilitySubstitutionRule = {
{ "disable", ForwardCompatibilitySubstitutionRule::Disable },
{ "enable", ForwardCompatibilitySubstitutionRule::Enable },
@@ -2223,12 +2230,38 @@ void PrintConfigDef::init_fff_params()
{ "flashair", "FlashAir" },
{ "astrobox", "AstroBox" },
{ "repetier", "Repetier" },
{ "mks", "MKS" }
{ "mks", "MKS" },
{ "elegoolink", "ElegooLink" }
});
def->mode = comAdvanced;
def->cli = ConfigOptionDef::nocli;
def->set_default_value(new ConfigOptionEnum<PrintHostType>(htPrusaLink));
def = this->add("elegoolink_timelapse", coBool);
def->label = L("ElegooLink timelapse");
def->tooltip = L("Enable timelapse recording when starting a print via ElegooLink.");
def->mode = comAdvanced;
def->cli = ConfigOptionDef::nocli;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("elegoolink_bed_leveling", coBool);
def->label = L("ElegooLink bed leveling");
def->tooltip = L("Enable heated bed leveling when starting a print via ElegooLink.");
def->mode = comAdvanced;
def->cli = ConfigOptionDef::nocli;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("elegoolink_bed_type", coEnum);
def->label = L("ElegooLink bed type");
def->tooltip = L("Select bed type for ElegooLink printing.");
def->set_enum<ElegooBedType>({
{ "pte", L("Side A") },
{ "pc", L("Side B") }
});
def->mode = comAdvanced;
def->cli = ConfigOptionDef::nocli;
def->set_default_value(new ConfigOptionEnum<ElegooBedType>(ElegooBedType::PTE));
def = this->add("only_retract_when_crossing_perimeters", coBool);
def->label = L("Only retract when crossing perimeters");
def->tooltip = L("Disables retraction when the travel path does not exceed the upper layer's perimeters "
+8 -1
View File
@@ -65,7 +65,7 @@ enum class MachineLimitsUsage {
};
enum PrintHostType {
htPrusaLink, htPrusaConnect, htOctoPrint, htMoonraker, htDuet, htFlashAir, htAstroBox, htRepetier, htMKS, htPrusaConnectNew
htPrusaLink, htPrusaConnect, htOctoPrint, htMoonraker, htDuet, htFlashAir, htAstroBox, htRepetier, htMKS, htPrusaConnectNew, htElegooLink
};
enum AuthorizationType {
@@ -78,6 +78,11 @@ enum class FuzzySkinType {
All,
};
enum class ElegooBedType {
PTE = 0,
PC = 1
};
enum InfillPattern : int {
ipRectilinear, ipMonotonic, ipMonotonicLines, ipAlignedRectilinear, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb,
ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipAdaptiveCubic, ipSupportCubic, ipSupportBase,
@@ -212,6 +217,7 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(GCodeFlavor)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(MachineLimitsUsage)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(PrintHostType)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(AuthorizationType)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(ElegooBedType)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(FuzzySkinType)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(InfillPattern)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(IroningType)
@@ -883,6 +889,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionFloatOrPercent, first_layer_height))
((ConfigOptionFloatOrPercent, first_layer_speed))
((ConfigOptionInts, first_layer_temperature))
((ConfigOptionEnum<ElegooBedType>, elegoolink_bed_type))
((ConfigOptionIntsNullable, idle_temperature))
((ConfigOptionInts, full_fan_speed_layer))
((ConfigOptionFloat, infill_acceleration))