mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
ENH: bootup: add slow bootup mode to avoid some possible crash on seldom computers
Change-Id: Ia7a05082eee32dcc8a2ed9ca47cf13287ee2aed9
This commit is contained in:
parent
2aedc84586
commit
d40f9b24ed
3 changed files with 19 additions and 12 deletions
|
@ -995,7 +995,12 @@ void GUI_App::post_init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if BBL_HAS_FIRST_PAGE
|
//#if BBL_HAS_FIRST_PAGE
|
||||||
|
bool slow_bootup = false;
|
||||||
|
if (app_config->get("slow_bootup") == "true") {
|
||||||
|
slow_bootup = true;
|
||||||
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", slow bootup, won't render gl here.";
|
||||||
|
}
|
||||||
if (!switch_to_3d) {
|
if (!switch_to_3d) {
|
||||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", begin load_gl_resources";
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", begin load_gl_resources";
|
||||||
mainframe->Freeze();
|
mainframe->Freeze();
|
||||||
|
@ -1016,17 +1021,19 @@ void GUI_App::post_init()
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", finished init imgui frame";
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", finished init imgui frame";
|
||||||
plater_->canvas3D()->enable_render(true);
|
plater_->canvas3D()->enable_render(true);
|
||||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", start to render a first frame for test";
|
|
||||||
|
|
||||||
plater_->canvas3D()->render(false);
|
if (!slow_bootup) {
|
||||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", finished rendering a first frame for test";
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", start to render a first frame for test";
|
||||||
|
plater_->canvas3D()->render(false);
|
||||||
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", finished rendering a first frame for test";
|
||||||
|
}
|
||||||
if (is_editor())
|
if (is_editor())
|
||||||
mainframe->select_tab(size_t(0));
|
mainframe->select_tab(size_t(0));
|
||||||
mainframe->Thaw();
|
mainframe->Thaw();
|
||||||
plater_->trigger_restore_project(1);
|
plater_->trigger_restore_project(1);
|
||||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", end load_gl_resources";
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", end load_gl_resources";
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
//BBS: remove GCodeViewer as seperate APP logic
|
//BBS: remove GCodeViewer as seperate APP logic
|
||||||
/*if (this->init_params->start_as_gcodeviewer) {
|
/*if (this->init_params->start_as_gcodeviewer) {
|
||||||
|
@ -2342,7 +2349,7 @@ bool GUI_App::on_init_inner()
|
||||||
mainframe->Show(true);
|
mainframe->Show(true);
|
||||||
BOOST_LOG_TRIVIAL(info) << "main frame firstly shown";
|
BOOST_LOG_TRIVIAL(info) << "main frame firstly shown";
|
||||||
|
|
||||||
#if BBL_HAS_FIRST_PAGE
|
//#if BBL_HAS_FIRST_PAGE
|
||||||
//BBS: set tp3DEditor firstly
|
//BBS: set tp3DEditor firstly
|
||||||
/*plater_->canvas3D()->enable_render(false);
|
/*plater_->canvas3D()->enable_render(false);
|
||||||
mainframe->select_tab(size_t(MainFrame::tp3DEditor));
|
mainframe->select_tab(size_t(MainFrame::tp3DEditor));
|
||||||
|
@ -2358,9 +2365,9 @@ bool GUI_App::on_init_inner()
|
||||||
plater_->canvas3D()->render();
|
plater_->canvas3D()->render();
|
||||||
if (is_editor())
|
if (is_editor())
|
||||||
mainframe->select_tab(size_t(0));*/
|
mainframe->select_tab(size_t(0));*/
|
||||||
#else
|
//#else
|
||||||
plater_->trigger_restore_project(1);
|
//plater_->trigger_restore_project(1);
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
obj_list()->set_min_height();
|
obj_list()->set_min_height();
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
|
||||||
#define BBL_HAS_FIRST_PAGE 1
|
//#define BBL_HAS_FIRST_PAGE 1
|
||||||
#define STUDIO_INACTIVE_TIMEOUT 15*60*1000
|
#define STUDIO_INACTIVE_TIMEOUT 15*60*1000
|
||||||
#define LOG_FILES_MAX_NUM 30
|
#define LOG_FILES_MAX_NUM 30
|
||||||
#define TIMEOUT_CONNECT 15
|
#define TIMEOUT_CONNECT 15
|
||||||
|
|
|
@ -5036,7 +5036,7 @@ void Plater::priv::set_current_panel(wxPanel* panel, bool no_slice)
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPanel* old_panel = current_panel;
|
wxPanel* old_panel = current_panel;
|
||||||
#if BBL_HAS_FIRST_PAGE
|
//#if BBL_HAS_FIRST_PAGE
|
||||||
if (!old_panel) {
|
if (!old_panel) {
|
||||||
//BBS: only switch to the first panel when visible
|
//BBS: only switch to the first panel when visible
|
||||||
panel->Show();
|
panel->Show();
|
||||||
|
@ -5044,7 +5044,7 @@ void Plater::priv::set_current_panel(wxPanel* panel, bool no_slice)
|
||||||
if (!panel->IsShownOnScreen())
|
if (!panel->IsShownOnScreen())
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
||||||
current_panel = panel;
|
current_panel = panel;
|
||||||
//BBS: add the collapse logic
|
//BBS: add the collapse logic
|
||||||
if (current_panel == preview && q->only_gcode_mode()) {
|
if (current_panel == preview && q->only_gcode_mode()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue