Fix gcode viewer not working properly when opening .gcode files (#8761)

* Fix crash during project openning due to preset sync

* Don't reset gcode preview when open as gcode viewer
This commit is contained in:
Noisyfox 2025-03-08 21:26:59 +08:00 committed by GitHub
parent ec213e98fb
commit 0f3fbd4390
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 11 deletions

View file

@ -690,6 +690,15 @@ Print::ApplyStatus BackgroundSlicingProcess::apply(const Model &model, const Dyn
DynamicPrintConfig new_config = config;
new_config.apply(*m_current_plate->config());
Print::ApplyStatus invalidated = m_print->apply(model, new_config);
// Orca: prevent resetting under gcode viewer mode
if (invalidated != PrintBase::APPLY_STATUS_UNCHANGED) {
const auto plater = GUI::wxGetApp().mainframe->m_plater;
if (plater && plater->only_gcode_mode()) {
invalidated = PrintBase::APPLY_STATUS_UNCHANGED;
}
}
if ((invalidated & PrintBase::APPLY_STATUS_INVALIDATED) != 0 && m_print->technology() == ptFFF &&
!m_fff_print->is_step_done(psGCodeExport)) {
// Some FFF status was invalidated, and the G-code was not exported yet.