This commit is contained in:
bubnikv 2019-03-27 10:27:01 +01:00
commit 84ff7f4221
5 changed files with 59 additions and 11 deletions

View File

@ -60,12 +60,14 @@ const std::array<std::string, slaposCount> OBJ_STEP_LABELS =
// Should also add up to 100 (%)
const std::array<unsigned, slapsCount> PRINT_STEP_LEVELS =
{
80, // slapsRasterize
20, // slapsValidate
5, // slapsStats
94, // slapsRasterize
1, // slapsValidate
};
const std::array<std::string, slapsCount> PRINT_STEP_LABELS =
{
L("Calculating statistics"), // slapsStats
L("Rasterizing layers"), // slapsRasterize
L("Validating"), // slapsValidate
};
@ -913,6 +915,16 @@ void SLAPrint::process()
report_status(*this, -2, "", SlicingStatus::RELOAD_SLA_PREVIEW);
};
auto fillstats = [this]() {
m_print_statistics.clear();
// Fill statistics
fill_statistics();
report_status(*this, -2, "", SlicingStatus::RELOAD_SLA_PREVIEW);
};
// Rasterizing the model objects, and their supports
auto rasterize = [this, max_objstatus, ilhs]() {
if(canceled()) return;
@ -1050,8 +1062,6 @@ void SLAPrint::process()
// Print all the layers in parallel
tbb::parallel_for<unsigned, decltype(lvlfn)>(0, lvlcnt, lvlfn);
// Fill statistics
this->fill_statistics();
// Set statistics values to the printer
m_printer->set_statistics({(m_print_statistics.objects_used_material + m_print_statistics.support_used_material)/1000,
double(m_default_object_config.faded_layers.getInt()),
@ -1075,6 +1085,7 @@ void SLAPrint::process()
std::array<slapsFn, slapsCount> print_program =
{
fillstats,
rasterize,
[](){} // validate
};
@ -1116,7 +1127,7 @@ void SLAPrint::process()
}
std::array<SLAPrintStep, slapsCount> printsteps = {
slapsRasterize, slapsValidate
slapsStats, slapsRasterize, slapsValidate
};
// this would disable the rasterization step

View File

@ -11,6 +11,7 @@
namespace Slic3r {
enum SLAPrintStep : unsigned int {
slapsStats,
slapsRasterize,
slapsValidate,
slapsCount

View File

@ -3767,8 +3767,8 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
// of the scene with the background processing data should be performed.
post_event(SimpleEvent(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED));
}
else if (evt.LeftUp() && !m_mouse.dragging && (m_hover_volume_id == -1) && !gizmos_overlay_contains_mouse && !m_gizmos.is_dragging()
&& !is_layers_editing_enabled())
else if (evt.LeftUp() && !m_mouse.dragging && (m_hover_volume_id == -1) && !gizmos_overlay_contains_mouse && !m_gizmos.grabber_contains_mouse() && !m_gizmos.is_dragging()
&& !is_layers_editing_enabled())
{
// deselect and propagate event through callback
if (!evt.ShiftDown() && m_picking_enabled && !m_mouse.ignore_up_event)

View File

@ -203,7 +203,16 @@ bool GUI_App::OnInit()
load_current_presets();
mainframe->Show(true);
/* Temporary workaround for the correct behavior of the Scrolled sidebar panel:
* change min hight of object list to the normal min value (15 * wxGetApp().em_unit())
* after first whole Mainframe updating/layouting
*/
if (obj_list()->GetMinSize().GetY() > 15 * em_unit())
obj_list()->SetMinSize(wxSize(-1, 15 * em_unit()));
update_mode(); // update view mode after fix of the object_list size
m_initialized = true;
return true;
}
@ -317,6 +326,13 @@ void GUI_App::recreate_GUI()
dlg.Update(90, _(L("Loading of a mode view")) + dots);
/* Temporary workaround for the correct behavior of the Scrolled sidebar panel:
* change min hight of object list to the normal min value (15 * wxGetApp().em_unit())
* after first whole Mainframe updating/layouting
*/
if (obj_list()->GetMinSize().GetY() > 15 * em_unit())
obj_list()->SetMinSize(wxSize(-1, 15 * em_unit()));
update_mode();
// #ys_FIXME_delete_after_testing Do we still need this ?
@ -633,12 +649,28 @@ void GUI_App::add_config_menu(wxMenuBar *menu)
}
case ConfigMenuLanguage:
{
/* Before change application language, let's check unsaved changes
* and draw user's attention to the application restarting after a language change
*/
wxMessageDialog dialog(nullptr,
_(L("Application will be restarted after language change, "
"and 3D-Scene will be cleaned.")) + "\n" +
_(L("Please, check your changes before.")) + "\n\n" +
_(L("Continue anyway?")),
_(L("Attention!")),
wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT);
if ( dialog.ShowModal() != wxID_YES)
return;
if (!wxGetApp().check_unsaved_changes())
return;
wxArrayString names;
wxArrayLong identifiers;
get_installed_languages(names, identifiers);
if (select_language(names, identifiers)) {
save_language();
show_info(mainframe->m_tabpanel, _(L("Application will be restarted")), _(L("Attention!")));
// show_info(mainframe->m_tabpanel, _(L("Application will be restarted")), _(L("Attention!")));
_3DScene::remove_all_canvases();// remove all canvas before recreate GUI
recreate_GUI();
}
@ -674,11 +706,11 @@ bool GUI_App::check_unsaved_changes()
// No changes, the application may close or reload presets.
return true;
// Ask the user.
auto dialog = new wxMessageDialog(mainframe,
wxMessageDialog dialog(mainframe,
_(L("You have unsaved changes ")) + dirty + _(L(". Discard changes and continue anyway?")),
_(L("Unsaved Presets")),
wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT);
return dialog->ShowModal() == wxID_YES;
return dialog.ShowModal() == wxID_YES;
}
bool GUI_App::checked_tab(Tab* tab)

View File

@ -127,7 +127,11 @@ ObjectList::~ObjectList()
void ObjectList::create_objects_ctrl()
{
SetMinSize(wxSize(-1, 15 * wxGetApp().em_unit()));
/* Temporary workaround for the correct behavior of the Scrolled sidebar panel:
* 1. set a height of the list to some big value
* 2. change it to the normal min value (15 * wxGetApp().em_unit()) after first whole Mainframe updating/layouting
*/
SetMinSize(wxSize(-1, 3000));
m_sizer = new wxBoxSizer(wxVERTICAL);
m_sizer->Add(this, 1, wxGROW);