Skip to content

Fearuew top cover yjx#437

Open
iesteem wants to merge 52 commits into
Snapmaker:feature_top_coverfrom
iesteem:fearuew_top_cover_yjx
Open

Fearuew top cover yjx#437
iesteem wants to merge 52 commits into
Snapmaker:feature_top_coverfrom
iesteem:fearuew_top_cover_yjx

Conversation

@iesteem
Copy link
Copy Markdown

@iesteem iesteem commented Jun 4, 2026

Description

add top cover

iesteem and others added 30 commits April 16, 2026 17:01
feat: add configurable option for top cover requirement
# Conflicts:
#	src/libslic3r/Preset.cpp
#	src/libslic3r/PrintConfig.cpp
…consumable filament, and simultaneously modify the printer's initial gcode.
feat: Add the "Is It a High-Temperature Consumable" attribute to the …
fix:Temporarily enable the ability to export gcode.3mf
Revert "fix:Temporarily enable the ability to export gcode.3mf"
…eature_top_cover

#	resources/profiles/Snapmaker.json
#	resources/profiles/Snapmaker/filament/Snapmaker PETG HF @U1 0.2 nozzle.json
#	resources/profiles/Snapmaker/machine/Snapmaker U1 (0.2 nozzle).json
#	resources/profiles/Snapmaker/machine/Snapmaker U1 (0.4 nozzle).json
#	resources/profiles/Snapmaker/machine/Snapmaker U1 (0.6 nozzle).json
#	resources/profiles/Snapmaker/machine/Snapmaker U1 (0.8 nozzle).json
Replace the outdated filament_info.json-based classification with per-preset
filament_is_high_temperature config. Detect mixing whenever filament
assignments change on the current plate (wall, infill, solid infill,
support, support interface, wipe tower, and multi-material painting).

Detection hooks:
- Plater::on_config_change() — config load, extruder count change, import
- Sidebar::update_presets() — sidebar filament combo selection

Enforcement layers (three-stage guard against notification flicker):
1. check_filament_temp_mixing() shows error notification + marks plate
   invalid immediately on config change (CallAfter-deferred with serial
   cancellation to prevent races between the two hooks).
2. Print::validate() runs check_multi_filament_valid() using
   filament_is_high_temperature (was: filament_info.json + nozzles<2
   restriction removed).
3. Plater::priv::update() re-checks after background validate passes,
   preventing the validate cycle from silently closing the notification.

The old Print::validate() check (nozzles<2 && extruders>1) is replaced
with a simpler extruders>1 guard that works for multi-nozzle printers too.
Make check_filament_temp_mixing() a pure detection function with no side
effects. Notification push/close is now owned exclusively by
Plater::priv::update()'s three-layer guard, eliminating races where
CallAfter serial cancellation would accidentally drop the error
notification.

Also scan all plates' configs (not just the active plate) so that
filament changes on any plate are detected immediately.
Previously the hooks only marked the plate invalid (greyed out slice
button) but relied on priv::update() to push the error notification.
Since priv::update() only runs after schedule_background_process(),
sidebar filament preset changes that don't trigger a background
process cycle would never show the red error bar.

Now all three sites push/close notification synchronously:
- Sidebar::update_presets()
- Plater::on_config_change()
- Plater::priv::update() (three-layer guard)
full_config() builds a merged snapshot that may lag when called from
Sidebar hooks because the edited preset config hasn't been committed
yet. Read filament_is_high_temperature directly from each filament
preset's individual config via find_preset(name, true) instead.
Replace the outdated filament_info.json-based classification with per-preset
filament_is_high_temperature config. Detect mixing whenever filament
assignments change on the current plate (wall, infill, solid infill,
support, support interface, wipe tower, and multi-material painting).

Detection hooks:
- Plater::on_config_change() — config load, extruder count change, import
- Sidebar::update_presets() — sidebar filament combo selection

Enforcement layers (three-stage guard against notification flicker):
1. check_filament_temp_mixing() shows error notification + marks plate
   invalid immediately on config change (CallAfter-deferred with serial
   cancellation to prevent races between the two hooks).
2. Print::validate() runs check_multi_filament_valid() using
   filament_is_high_temperature (was: filament_info.json + nozzles<2
   restriction removed).
3. Plater::priv::update() re-checks after background validate passes,
   preventing the validate cycle from silently closing the notification.

The old Print::validate() check (nozzles<2 && extruders>1) is replaced
with a simpler extruders>1 guard that works for multi-nozzle printers too.
Make check_filament_temp_mixing() a pure detection function with no side
effects. Notification push/close is now owned exclusively by
Plater::priv::update()'s three-layer guard, eliminating races where
CallAfter serial cancellation would accidentally drop the error
notification.

Also scan all plates' configs (not just the active plate) so that
filament changes on any plate are detected immediately.
Previously the hooks only marked the plate invalid (greyed out slice
button) but relied on priv::update() to push the error notification.
Since priv::update() only runs after schedule_background_process(),
sidebar filament preset changes that don't trigger a background
process cycle would never show the red error bar.

Now all three sites push/close notification synchronously:
- Sidebar::update_presets()
- Plater::on_config_change()
- Plater::priv::update() (three-layer guard)
full_config() builds a merged snapshot that may lag when called from
Sidebar hooks because the edited preset config hasn't been committed
yet. Read filament_is_high_temperature directly from each filament
preset's individual config via find_preset(name, true) instead.
@iesteem iesteem force-pushed the fearuew_top_cover_yjx branch from 90e93b7 to 1c6118b Compare June 4, 2026 02:57
@iesteem iesteem closed this Jun 4, 2026
@iesteem iesteem reopened this Jun 4, 2026
@iesteem iesteem force-pushed the feature_top_cover branch from 91144a2 to 39508f2 Compare June 4, 2026 06:53
Comment thread src/libslic3r/GCode.cpp Outdated
for (unsigned int extruder : tool_ordering.all_extruders()) {
if (!m_config.filament_is_high_temperature.get_at(extruder)) {
int vitrification = m_config.temperature_vitrification.get_at(extruder);
if (vitrification <= 50) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

50和70用constexpr定义一下全局变量比较好,写清楚谁是高低温

Comment thread src/libslic3r/GCode.cpp Outdated
// Compute chamber cooling mode based on all filaments used on this plate.
// 0 = keep warm (all high-temp), 1 = weak cooling, 2 = strong cooling.
{
int chamber_cooling_mode = 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chamber_cooling_mode 的值如果只有0,1,2定义一个枚举比较好

Comment thread src/slic3r/GUI/Preferences.cpp Outdated

//// save config
checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, checkbox, param](wxCommandEvent &e) {
auto in_handler = std::make_shared<bool>(false);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool值用值拷贝不好吗,为啥加个智能指针,也没看到后面会用到

Comment thread src/slic3r/GUI/Preferences.cpp Outdated

auto* main_sizer = new wxBoxSizer(wxVERTICAL);

wxString msg = _L("混合使用打印温度差异较大的耗材,可能导致:\n"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码不能使用中文

Comment thread src/slic3r/GUI/Preferences.cpp Outdated
if (!new_val)
return false;

wxDialog dlg(this, wxID_ANY, _L("高/低温材料混打风险"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码不能使用中文

Comment thread src/slic3r/GUI/Preferences.cpp Outdated
main_sizer->Add(text, 0, wxALL, FromDIP(20));

auto* btn_sizer = new wxBoxSizer(wxHORIZONTAL);
auto* btn_yes = new wxButton(&dlg, wxID_YES, _L("是"));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码不能用中文

iesteem and others added 17 commits June 4, 2026 17:29
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Consolidate duplicated notification logic into sync_filament_temp_mixing_notification()
and hook it into model add/remove (object_list_changed), filament assignment changes
(set_extruder_for_selected_items, update_filament_in_config), and MMU painting
(update_model_object) so the mixing warning updates immediately when plate composition changes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Hook sync_filament_temp_mixing_notification() into Selection::notify_instance_update
(3D view drag) and ObjectList::reload_all_plates (arrange, file load, plate operations)
so the mixing warning updates immediately when objects are moved on/off plates.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move the sync call from Selection::notify_instance_update to the end of
GLCanvas3D::do_move, so it runs only once after all plate membership
updates are complete, avoiding flip-flopping between valid/invalid states.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Limit plate config collection and ModelVolume scanning to objects on the
current plate, so removing an object from the plate correctly clears the
high/low temperature mixing error notification.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The global config's wall_filament etc. always reference the default
filament slot, causing false mixing detection when only high-temp
models remain on the plate. Only collect config from current plate.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ing warning

Use MessageDialog with SetButtonLabel for proper OrcaSlicer button styling
instead of manual wxButton with hardcoded green background. Buttons now read
"确认"/"取消" with auto-applied Confirm/Regular ButtonStyle.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace hardcoded Chinese text with _L()/_u8L() wrapped English strings:
- Preferences dialog title, body, and button labels
- Error notification (allow=false): includes guidance to enable in Preferences
- Warning notification (allow=true): concise message without guidance
- Calibration wizard validation error

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Multi-line string literals in _u8L() may not match multi-line msgid entries
in .po files during gettext lookup. Consolidate to single-line strings
in both C++ source and .po msgid for the filament temp mixing messages.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Without this dependency, incremental builds in VS2022 never regenerate
.mo files from .po sources, causing stale translations at runtime.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Build failure during solution generation. Will use a different approach
to ensure updated .mo files are generated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants